Translations
How to translate texts in the administration UI.
Litium uses resource files for texts and translations in the administration UI. If you want to use your own resource files in a project, you need to create them and place them in the /Site/Resources/Administration folder. If this folder does not already exist, it must be created as well. When there are multiple resource files in the folder containing the same key, the file last read will be used.
When you work with resource files, the naming is important. It is specified by different parts, Name[.culture].resx. Name can be whatever you prefer, but probably something that connects it to your add-on. culture is the culture code for the language, which can be skipped if it is the default/fallback language.
- Accelerator.resx is the default fallback values. This file probably contains the English translation.
- Accelerator.sv-se.resx is the Swedish translation. If this file does not contain any value, the fallback file is used.
Using resource files in your add ons makes the installation easier, since no XML files need to be imported into back office. Make sure to use unique names for your strings, for example SpecialWidgetName, if you are building a special widget for the dashboard.
Beginning with Litium 7, the Accelerator is distributed with all strings for the different Areas in a single .resxfile in the Administration folder. The strings are read at runtime and will be updated in the file as soon as they are changed. Strings added for the Sales area, which has not yet been updated to the new API, should be placed in /Site/Resources/ModuleECommerce (Sales) folder.
Usage
The Products area uses angular-translate for translations. More information about angular-translate can be found here.
The Customers, Media and Websites areas use ngx-translate. More information about ngx-translate can be found here.