Translations

ExApps translations work in the same way as for PHP apps with a few adjustments and differences.

In short, you just have to provide a l10n/<lang>.js (for front-end) and l10n/<lang>.json (for back-end) files for your app.

Front-end

For the front-end part AppAPI will inject the current user’s locale l10n/<lang>.js script, so that access to translated strings in kept the same as was before in PHP apps.

Note

ExApp l10n files are included only on the ExApp UI pages (Top Menu), Files (for FileAction) and Settings (for DeclarativeSettings).

Back-end

For the back-end part of ExApp which can be written in different programming languages it is up to the developer to decide how to handle and translations files. There is an example repository with translations: UI example with translations.

Manual install

For manual-install type administrator will have to manually extract to the server’s writable apps directory l10n folder of ExApp (e.g. /path/to/apps-writable/<appid>/l10n/*.(js|json)). This will allow server to access ExApp’s strings with translations.

Note

Only l10n folder must be present on the server side, appinfo/info.xml could lead to be misdetected by server as PHP app folder.

Docker install

For docker-install type AppAPI will extract l10n folder to the server automatically during installation from ExApp release archive.

Translation tool

To add support for your language in Nextcloud translationtool feel free to create an issue in the nextcloud/docker-ci repository or open a pull request with the changes made in createPotFile function to extract and convert translation strings.