Skip to the content
Documentation
Help Start
Reading in:
  • German: 9,196 of 9,196 pages
About the help in other languages
All help pages

Translations in a theme

Ship the interface texts of a theme in several languages - translations/<locale>/translation.ts, TranslationExtensions[], the i18n operator with the theme's own context - and keep the files complete.

Download as PDF

Address: https://doc.exponential.earth/exphelp/viewer/help/designers/extensions/translations-in-a-theme.md

On this page

Translations in a theme

This page is for designers whose theme shows texts of its own ("Read more", "Search this site", button labels) and should work in more than one language. Writing the template side is explained in Translating template strings; here: the files in the extension.

The files

extension/mytheme/translations/
├── untranslated/translation.ts     every source string, no translations (a template for translators)
├── ger-DE/translation.ts
└── fre-FR/translation.ts

sevenx_themes_simple ships eng-US, esl-ES, esl-MX, ger-DE, heb-IL, lat-VA, tlh-QO and untranslated; sevenx_themes_media adds more, for example fre-FR, ita-IT, nor-NO and pol-PL.

Step by step

  1. In templates, mark every text with a context of your theme:

    {'Read more'|i18n( 'extension/mytheme' )}
  2. Create translations/ger-DE/translation.ts in the Qt Linguist format with a <context> named extension/mytheme and one <message> per text.

  3. Register the extension for translations in extension/mytheme/settings/site.ini.append.php:

    <?php /* #?ini charset="utf-8"?
    
    [RegionalSettings]
    TranslationExtensions[]=mytheme
    
    */ ?>
  4. Check the XML of every file: xmllint --noout extension/mytheme/translations/*/translation.ts (no output expected).

  5. Clear the caches: php bin/php/ezcache.php --clear-tag=ini --allow-root-user and php bin/php/ezcache.php --clear-id=template,translation --allow-root-user.

  6. Open a siteaccess whose locale is ger-DE and check the texts.

Good practice

  • Keep one context per theme, so translators find everything in one place.
  • Ship untranslated/translation.ts with every source string, so a new language starts from a complete list.
  • Never repeat the same message twice in one context.
  • A right-to-left language (heb-IL, ara-SA) needs the layout to follow too (Right-to-left designs).

Become an Exponential Partner

Partners share their information, provide funding, contribute back and develop the products with us, and that is how Exponential grows. A partner website and dashboard are planned for mid-2027: please become a partner today to speed up our growth rate and land new features faster.

Something wrong on this page? Report an error

Documentation license

This documentation is free documentation, licensed under the GNU Free Documentation License 1.3 or later.

Exponential Copyright © 1998-2026 Exponential Foundation and 7x