Localization Service
Last updated
Was this helpful?
Last updated
Was this helpful?
The Localization Service is a simple service that features storage and retrieval of text snippets, translated into multiple languages. A snippet is identified by a key, for example mail_closing
, and has associated values in all translated languages.
The as well as the are aware of the Localization Service, and have . They both use the Localization Service in order to generate notifications, emails and PDFs in appropriate languages based on a pre-defined template, which in turn are filled with localization keys that can be managed by the Localization Service.
Translated text snippets can be stored in Localization objects, which are uniquely identified by the key
attribute. The translations and their respective language codes () are stored as key-value pairs in the text
attribute.
The easiest way to manage your localizations is by using the .
The ExH CLI allows you to simply define your localizations as a list of key/value pairs per language. When instructed, the CLI will combine these into localization objects and sync them with the Localization Service.
Example file structure:
Once you have configured your localizations, you can use them in your application or within ExH services which have localization support.
For example, to retrieve translated texts form the mail_closing
localization in Dutch and English:
Syncing the localizations with the CLI will result in a localization matching the example mentioned in the above:
See the for more information.
As mentioned before, the has built-in support for localizations. This also affects the , which uses the Template Service to generate emails. Allowing you to create fully localized emails.
You can also use the Localization Service directly in your application(s) by using the .