Skip to content

Theme i18n

Mark Reeves edited this page Jan 4, 2018 · 8 revisions

Theme Internationalisation

The WComponents theme uses i18next for internationalisation.

Out of the box only English messages are available however you may add translations for any locale you wish to support.

The full list of messages keys and default text is available as a gettext pot file in the wcomponents-i18n respository. Translators can use the pot file in a tool like Poedit.

The translator will provide you with a .po or .mo file which you can convert to i18next JSON format using the po2json.js script in the wcomponents-i18n project. Instruction on its use are in the header comments of the script.

The JSON file can be provided on the classpath, by default in:

resources/wc/theme/i18n

The file itself should be named {lang}.json for example fr-CA.json.

Further information

Clone this wiki locally