Skip to content

Commit

Permalink
Merge pull request #410 from owncloud/update_userlog_service
Browse files Browse the repository at this point in the history
Add translation capability to the userlog service
  • Loading branch information
mmattel authored Mar 16, 2023
2 parents a95919e + c46e1fb commit a349c92
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions modules/ROOT/pages/deployment/services/s-list/userlog.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,29 @@ https://<your-ocis-instance>/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 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_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 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

include::partial$deployment/services/env-and-yaml.adoc[]

0 comments on commit a349c92

Please sign in to comment.