Skip to content
Ondrej Kosarko edited this page Jun 30, 2026 · 11 revisions

Localization

CLARIN-DSpace v7+

UI message strings — stock, see upstream

The translatable UI strings use the stock dspace-angular i18n system, so there is nothing CLARIN-specific to document — follow the upstream guides:

Orientation (see upstream for the details):

  • UI translations live in src/assets/i18n/*.json5 in the Angular frontend.
  • Enabled languages are set in the languages section of config/config.*.yml.
  • yarn run sync-i18n syncs a locale file against the authoritative English file.

Static HTML pages (license texts, about, FAQ…) — CLARIN-specific

Long-form static content is not in the i18n message files. CLARIN-DSpace adds a static-files/ mechanism (StaticPageComponent / HtmlContentService): HTML files in src/static-files/ are served at <UI_URL>/static/<file>.html. This is where the deposit license, the per-licence texts (license-*.html, licence-*.html), about.html, faq.html, deposit.html, cookies.html, etc. live.

To localise a static page, place a translated copy under a locale subdirectory src/static-files/<locale>/<file>.html — e.g. src/static-files/cs/faq.html. The resolver (HtmlContentService.getHmtlContentByPathAndLocale) works like this:

  • For a non-en locale it first tries static-files/<locale>/<file>.html.
  • If that is missing it falls back to the default static-files/<file>.html.
  • en always uses the default (no en/ subdir).

So you only need to translate the files you actually want localised; everything else transparently falls back to the default (English) version. See the existing src/static-files/cs/ directory for the set of pages currently translated to Czech.

Note: the deposit/distribution license shown on a collection's contract page comes from the collection's License object via the REST API, not from static-files/ — that text is localised/edited as collection data, not here.

If we diverge from stock anywhere else, document that delta here rather than re-describing the upstream workflow.


Legacy (DSpace 5 / XMLUI) — reference only

⚠️ Everything below applies to the old XMLUI-based releases (lindat-dspace) and is kept for historical reference. It does not apply to v7+.

Before release 2017.04

These instructions describe the steps to provide the repository in a different language, mirroring the changes in #459 and 0e1454 (minus the *.java/*.xsl work that internationalized missed strings). To jump start translations, check whether upstream DSpace was already translated into the target language (see the old dspace-xmlui-lang project).

Configuration — set supported.locales in local.properties, e.g. supported.locales = en, cs.

Translating the UI — most UI strings are in messages.xml; provide a messages_LOC.xml (where LOC is the locale). Start from messages.template placed into dspace/modules/xmlui/.../i18n. The rest live in JS files (each carrying its own dictionary); search for i18n.load and provide your translation in:

./dspace-xmlui/src/main/webapp/themes/UFAL/lib/js/dragndrop.js
./dspace-xmlui/src/main/webapp/themes/UFAL/lib/js/fileupload.js
./dspace-xmlui/src/main/webapp/themes/UFAL/lib/bootstrap/js/ufal.min.js

If you changed input-forms.xml you'll need matching message keys; this gist can help generate them. Forms can be overlaid.

Translating static content — put translations into /dspace-xmlui/.../html/LOC; check the cs/ dir to see which files need translating. Files come in .xml + .html pairs (the .html must be well-formed XML). The dummy.* files provide the "no translation yet" fallback. The selection logic is based on URL and locale.

Deposition license — if per-collection licenses are not set, default.license is shown/stored; for non-English locales an alternative license is shown on /xmlui/page/contract (the default one is still stored). See #491.

Flags — language-switch flags are part of lindat common, expected under /themes/UFAL/lib/lindat/public/img/flags/.

From release 2017.04 onwards (v5)

By 2017.04 the JS message system changed to per-locale messages_LOC.js files. To localise:

  1. Determine the two-letter locale code (e.g. de).
  2. Copy the English sources to locale versions:
    • XML: dspace-xmlui/.../i18n/messages.xmldspace/modules/xmlui/.../i18n/messages_de.xml
    • JS: dspace-xmlui/.../js/messages/messages.js.../js/messages/messages_de.js
    • license: dspace/config/licenses/default.licensedspace/config/licenses/alternative_de.license
  3. Create a locale subdir (e.g. .../UFAL/lib/html/de/) with copies of the static HTML pages.
  4. Translate the XML/JS messages, license, and static HTML.
  5. Set the locale in the last line of the JS file, e.g. jQuery.i18n.load('de', messages);.
  6. Update the front-end (with lindat-common: add a flag icon and translated header/footer).
  7. Add the locale to supported.locales in local.properties.
  8. Open a PR to include your XML/JS message and license translations (see Code contributions).

Updating an installation localised before 2017.04 — your XML mostly still works, but migrate the JS: create messages_de.js, set the locale, then fold the i18n.load blocks from the other JS files (e.g. dragndrop.js) into it and delete those blocks.

Checking message keys when upgrading — there may be new/changed keys:

$ python utilities/project_helpers/scripts/check-message-translations.py de
$ python utilities/project_helpers/scripts/check-message-usages.py de

(The second is less reliable since some keys are generated dynamically.)

Home


Getting Started

Features

Operations

For Users

Development

Reference


Archive (v5 / stale)

Clone this wiki locally