Add-on Internationalization#
The internationalization workflow is the same as in main Volto: you develop your add-on, then add the translations to your code. See Creating i18n Strings for how to mark strings and phrases as translatable.
Your add-on has a locales folder with a .pot file.
Create the following structure in your add-ons
localesfolder for every language you want to support. As an example for the language Italian:it └── LC_MESSAGES └── volto.poMake sure you depend your add-on on
@plone/scriptslibrary."dependencies": { "@plone/scripts": "*", }
This will allow you to run
yarn i18nfrom inside your add-on, even if it's outside a project.Run
yarn i18nin the context of your add-on.Go to each
.pofile in yourlocalesfolder, and write the translations for each translation literal.
In the context of your project (eg. in the root), run yarn i18n to merge the add-on translations with the ones of your project.
Override translations#
The workflow allows you to override translations from your project scope, so the project translations "always win".