From a810382f2b428690987ecd7e4a568f4c91b70862 Mon Sep 17 00:00:00 2001 From: mmattel Date: Tue, 14 Mar 2023 17:09:04 +0100 Subject: [PATCH 1/2] Add translation capability to the userlog service --- .../deployment/services/s-list/userlog.adoc | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/modules/ROOT/pages/deployment/services/s-list/userlog.adoc b/modules/ROOT/pages/deployment/services/s-list/userlog.adoc index b6b11638..06c20589 100644 --- a/modules/ROOT/pages/deployment/services/s-list/userlog.adoc +++ b/modules/ROOT/pages/deployment/services/s-list/userlog.adoc @@ -70,6 +70,29 @@ https:///ocs/v2.php/apps/notifications/api/v1/notification containing the IDs to delete. +== Translations + +The `userlog` service has embedded translations sourced via transifex to provide a basic set of translated languages. These embedded translations are available for all deployment scenarios. In addition, the service supports custom translations, though it is currently not possible to just add custom translations to embedded ones. If custom translations are configured, the embedded ones are not used. To configure custom translations, the `USERLOG_TRANSLATION_PATH` environment variable needs to point to a base folder that will further contain the translation files. This path must be available from all instances of the userlog service, a shared storage is recommended. Translation files must be of type https://www.gnu.org/software/gettext/manual/html_node/PO-Files.html#PO-Files[.po] or https://www.gnu.org/software/gettext/manual/html_node/Binaries.html[.mo]. For each language, the filename needs to be `userlog.po` (or `userlog.mo`) and stored in a folder structure defining the language code. In general the path/name pattern for a translation file needs to be: + +[source,plaintext] +---- +{USERLOG_TRANSLATION_PATH}/{language-code}/LC_MESSAGES/userlog.po +---- + +The language-code pattern is composed as `language[_territory]` where `language` is the base language and `_territory` is optional defining a country. + +As example, for the language `de_DE`, one needs to place the corresponding translation files to + +[source,plaintext] +---- +{USERLOG_TRANSLATION_PATH}/de_DE/LC_MESSAGES/userlog.po +---- + +=== Translation Rules + +* If a requested language-code is not available, the service tries to fallback to the base language if available. As example, if `de_DE` is not available, the service tries to fall back to translations in `de` folder. +* If the base language is also not available like when the language code is `de_DE` and neither `de_DE` nor the `de` folder is available, the service falls back to the systems default `en`, which is the source of the texts provided by the code. + == Configuration include::partial$deployment/services/env-and-yaml.adoc[] From c46e1fbbb0e8cb866014824d3085407d22ba05a6 Mon Sep 17 00:00:00 2001 From: Edith Parzefall Date: Tue, 14 Mar 2023 17:36:17 +0100 Subject: [PATCH 2/2] Apply suggestions from code review language review --- .../ROOT/pages/deployment/services/s-list/userlog.adoc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/ROOT/pages/deployment/services/s-list/userlog.adoc b/modules/ROOT/pages/deployment/services/s-list/userlog.adoc index 06c20589..b303d60c 100644 --- a/modules/ROOT/pages/deployment/services/s-list/userlog.adoc +++ b/modules/ROOT/pages/deployment/services/s-list/userlog.adoc @@ -72,16 +72,16 @@ containing the IDs to delete. == Translations -The `userlog` service has embedded translations sourced via transifex to provide a basic set of translated languages. These embedded translations are available for all deployment scenarios. In addition, the service supports custom translations, though it is currently not possible to just add custom translations to embedded ones. If custom translations are configured, the embedded ones are not used. To configure custom translations, the `USERLOG_TRANSLATION_PATH` environment variable needs to point to a base folder that will further contain the translation files. This path must be available from all instances of the userlog service, a shared storage is recommended. Translation files must be of type https://www.gnu.org/software/gettext/manual/html_node/PO-Files.html#PO-Files[.po] or https://www.gnu.org/software/gettext/manual/html_node/Binaries.html[.mo]. For each language, the filename needs to be `userlog.po` (or `userlog.mo`) and stored in a folder structure defining the language code. In general the path/name pattern for a translation file needs to be: +The `userlog` service has embedded translations sourced via transifex to provide a basic set of translated languages. These embedded translations are available for all deployment scenarios. In addition, the service supports custom translations, though it is currently not possible to just add custom translations to embedded ones. If custom translations are configured, the embedded ones are not used. To configure custom translations, the `USERLOG_TRANSLATION_PATH` environment variable needs to point to a base folder that will contain the translation files. This path must be available from all instances of the userlog service, a shared storage is recommended. Translation files must be of type https://www.gnu.org/software/gettext/manual/html_node/PO-Files.html#PO-Files[.po] or https://www.gnu.org/software/gettext/manual/html_node/Binaries.html[.mo]. For each language, the filename needs to be `userlog.po` (or `userlog.mo`) and stored in a folder structure defining the language code. In general the path/name pattern for a translation file needs to be: [source,plaintext] ---- {USERLOG_TRANSLATION_PATH}/{language-code}/LC_MESSAGES/userlog.po ---- -The language-code pattern is composed as `language[_territory]` where `language` is the base language and `_territory` is optional defining a country. +The language code pattern is composed of `language[_territory]` where `language` is the base language and `_territory` is optional and defines a country. -As example, for the language `de_DE`, one needs to place the corresponding translation files to +For example, for the language `de_DE`, one needs to place the corresponding translation files to [source,plaintext] ---- @@ -90,8 +90,8 @@ As example, for the language `de_DE`, one needs to place the corresponding trans === Translation Rules -* If a requested language-code is not available, the service tries to fallback to the base language if available. As example, if `de_DE` is not available, the service tries to fall back to translations in `de` folder. -* If the base language is also not available like when the language code is `de_DE` and neither `de_DE` nor the `de` folder is available, the service falls back to the systems default `en`, which is the source of the texts provided by the code. +* If a requested language code is not available, the service tries to fall back to the base language if available. For example, if `de_DE` is not available, the service tries to fall back to translations in the `de` folder. +* If the base language `de` is also not available, the service falls back to the system's default English (`en`), which is the source of the texts provided by the code. == Configuration