Add-on internationalization

Add-on internationalization#

The internationalization (i18n) workflow in and add-on is similar to core Volto. You develop your add-on, then add the translations to your code.

See Create i18n strings for how to mark strings and phrases as translatable.

Your add-on has a locales folder with a .pot file.

  1. Create the following structure in your add-ons locales folder for every language you want to support. As an example for the language Italian:

    it
    └── LC_MESSAGES
        └── volto.po
    
  2. Run pnpm i18n in the context of your add-on.

  3. Go to each .po file in your locales folder, and write the translations for each translation literal.

In the context of your project, run pnpm i18n to merge the add-on translations with the ones of your project.

Override translations#

If you have multiple add-ons installed in your project, the translations are loaded in the order your add-ons are listed in package.json. If two add-ons provide different translations for the same message, then the last defined add-on wins.

When running pnpm i18n in the context of your project, the project's own locales are processed last and can override translations from any add-on.