diff --git a/backend/src/config/opencast.rs b/backend/src/config/opencast.rs index 8e8ec3db2..f42e41b5e 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 { @@ -44,6 +46,20 @@ pub(crate) struct OpencastConfig { /// /// Example: "https://admin.oc.my-uni.edu/editor-ui/index.html". pub(crate) editor_url: Option, + + /// 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". + 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 7c8bb388b..a07963410 100644 --- a/docs/docs/setup/config.toml +++ b/docs/docs/setup/config.toml @@ -421,6 +421,20 @@ # Example: "https://admin.oc.my-uni.edu/editor-ui/index.html". #editor_url = +# 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"