Skip to content

Commit

Permalink
Merge pull request #966 from owncloud/activitylog_translations
Browse files Browse the repository at this point in the history
Default locale for the activity log service
  • Loading branch information
mmattel authored Aug 23, 2024
2 parents bb19f31 + 325769d commit b8b286f
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 59 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ include::partial$deployment/services/log-service-ecosystem.adoc[]

include::partial$multi-location/caching-list.adoc[]

:envvar_name: ACTIVITYLOG_TRANSLATION_PATH
include::partial$deployment/services/translations.adoc[]

== Event Bus Configuration

include::partial$multi-location/event-bus.adoc[]
Expand Down
31 changes: 2 additions & 29 deletions modules/ROOT/pages/deployment/services/s-list/notifications.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -77,35 +77,8 @@ or embedded as a CID source like:

In the latter case, image files must be located in the `templates/html/img` subfolder. Supported embedded image types are `png`, `jpeg`, and `gif`. Consider that embedding images via a CID resource may not be fully supported in all email web clients.

== Translations

The `notifications` 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 `NOTIFICATIONS_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]
----
{NOTIFICATIONS_TRANSLATION_PATH}/{language-code}/LC_MESSAGES/translations.po
----

The language code pattern is composed of `language[_territory]` where `language` is the base language and `_territory` is optional and defines a country.

For example, for the language `de`, one needs to place the corresponding translation files to

[source,plaintext]
----
{NOTIFICATIONS_TRANSLATION_PATH}/de/LC_MESSAGES/translations.po
----

include::partial$deployment/services/webui_language_code.adoc[]

=== Translation Rules

* If a requested language code is not available, the service tries to fall back to the base language if available. For example, if the requested language-code `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.

== Default Language

The default language can be defined via the `OCIS_DEFAULT_LANGUAGE` environment variable. See the xref:{s-path}/settings.adoc#default-language[settings] service for a detailed description.
:envvar_name: NOTIFICATIONS_TRANSLATION_PATH
include::partial$deployment/services/translations.adoc[]

== Event Bus Configuration

Expand Down
31 changes: 2 additions & 29 deletions modules/ROOT/pages/deployment/services/s-list/userlog.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -84,35 +84,8 @@ https://<your-ocis-instance>/ocs/v2.php/apps/notifications/api/v1/notifications/
to remove a global message is a restricted action, see the xref:authentication[Authentication] section for more details.
--

== 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 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 of `language[_territory]` where `language` is the base language and `_territory` is optional and defines a country.

For example, for the language `de`, one needs to place the corresponding translation files to

[source,plaintext]
----
{USERLOG_TRANSLATION_PATH}/de/LC_MESSAGES/userlog.po
----

include::partial$deployment/services/webui_language_code.adoc[]

=== Translation Rules

* If a requested language code is not available, the service tries to fall back to the base language if available. For example, if the requested language-code `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.

== Default Language

The default language can be defined via the `OCIS_DEFAULT_LANGUAGE` environment variable. See the xref:{s-path}/settings.adoc#default-language[settings] service for a detailed description.
:envvar_name: USERLOG_TRANSLATION_PATH
include::partial$deployment/services/translations.adoc[]

== Configuration

Expand Down
33 changes: 33 additions & 0 deletions modules/ROOT/partials/deployment/services/translations.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// to be included by a service

== Translations

The `{service_name}` 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 `{envvar_name}` 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 `{service_name}.po` (or `{service_name}.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,subs="attributes+"]
----
{{envvar_name}}/\{language-code\}/LC_MESSAGES/{service_name}.po
----

The language code pattern is composed of `language[_territory]` where `language` is the base language and `_territory` is optional and defines a country.

For example, for the language `de`, one needs to place the corresponding translation files to

[source,plaintext,subs="attributes+"]
----
{{envvar_name}}//de/LC_MESSAGES/{service_name}.po
----

{empty} +

IMPORTANT: For the time being, the embedded ownCloud Web frontend only supports the main language code but does not handle any territory. When strings are available in the language code `language_territory`, the web frontend does not see it as it only requests `language`. In consequence, any translations made must exist in the requested `language` to avoid a fallback to the default.

=== Translation Rules

* If a requested language code is not available, the service tries to fall back to the base language if available. For example, if the requested language-code `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.

=== Default Language

The default language can be defined via the `OCIS_DEFAULT_LANGUAGE` environment variable. See the xref:{s-path}/settings.adoc#default-language[settings] service for a detailed description.

This file was deleted.

0 comments on commit b8b286f

Please sign in to comment.