diff --git a/backend/src/config/opencast.rs b/backend/src/config/opencast.rs index c496a0d08..89cdd9b90 100644 --- a/backend/src/config/opencast.rs +++ b/backend/src/config/opencast.rs @@ -8,6 +8,8 @@ use crate::{ config::HttpHost, }; +use super::TranslatedString; + #[derive(Debug, confique::Config)] pub(crate) struct OpencastConfig { @@ -49,6 +51,20 @@ pub(crate) struct OpencastConfig { /// be trusted. #[config(default = [])] pub(crate) other_hosts: Vec, + + /// Set the return label for Editor. + /// This is for text on a button that will take you back to Tobira + /// after editing is done. + /// Part of that text ("Return to" / "Zurück zu") is fixed in Editor and + /// cannot be configured here. + /// The label can be configured in english and german. + /// + /// Example: + /// editor_return_label.en = "Tobira" + /// editor_return_label.de = "Aribot" + /// + /// Results in "Return to Tobira" / "Zurück zu Aribot". + pub(crate) editor_return_label: Option, } impl OpencastConfig { diff --git a/backend/src/http/assets.rs b/backend/src/http/assets.rs index fcd168e8b..3746200c6 100644 --- a/backend/src/http/assets.rs +++ b/backend/src/http/assets.rs @@ -286,6 +286,7 @@ fn frontend_config(config: &Config) -> serde_json::Value { "uploadNode": config.opencast.upload_node().to_string(), "studioUrl": config.opencast.studio_url().to_string(), "editorUrl": config.opencast.editor_url().to_string(), + "editorReturnLabel": config.opencast.editor_return_label, }, "logo": { "large": logo_obj(&config.theme.logo.large), diff --git a/docs/docs/setup/config.toml b/docs/docs/setup/config.toml index b78eae74d..897cbae4c 100644 --- a/docs/docs/setup/config.toml +++ b/docs/docs/setup/config.toml @@ -427,6 +427,20 @@ # Default value: [] #other_hosts = [] +# Set the return label for Editor. +# This is for text on button that will take you back to Tobira +# after editing is done. +# Part of that text ("Return to" / "Zurück zu") is fixed in Editor and +# cannot be configured here. +# The label can be configured in english and german. +# +# Example: +# editor_return_label.en = "Tobira" +# editor_return_label.de = "Aribot" +# +# Results in "Return to Tobira" / "Zurück zu Aribot". +#editor_return_label = + [sync] # Username of the user used to communicate with Opencast for data syncing. diff --git a/frontend/src/config.ts b/frontend/src/config.ts index 978c0078d..7f81e2591 100644 --- a/frontend/src/config.ts +++ b/frontend/src/config.ts @@ -83,6 +83,7 @@ type OpencastConfig = { uploadNode: string; studioUrl: string; editorUrl: string; + editorReturnLabel: TranslatedString; }; type VersionInfo = { diff --git a/frontend/src/routes/manage/Video/Details.tsx b/frontend/src/routes/manage/Video/Details.tsx index 775dcb15f..e1e2013a6 100644 --- a/frontend/src/routes/manage/Video/Details.tsx +++ b/frontend/src/routes/manage/Video/Details.tsx @@ -71,7 +71,10 @@ const Page: React.FC = ({ event }) => { params={{ id: event.opencastId, callbackUrl: document.location.href, - callbackSystem: translatedConfig(CONFIG.siteTitle, i18n), + callbackSystem: translatedConfig( + CONFIG.opencast.editorReturnLabel, + i18n, + ), }} fallback="button" css={buttonStyle(config, "normal", isHighContrast)} diff --git a/util/dev-config/config.toml b/util/dev-config/config.toml index 94150bb7b..44395df10 100644 --- a/util/dev-config/config.toml +++ b/util/dev-config/config.toml @@ -37,6 +37,8 @@ secret_key = "jwt-key.pem" [opencast] host = "http://localhost:8081" +editor_return_label.en = "Video" +editor_return_label.de = "dem Video" [sync] user = "admin"