Resource files
Litium Studio has moved from using translation strings in back office to use resource files. This will facilitate upgrades and applying hotfixes.
To use your own resource files in your project for built-in Litium Studio modules, you must create an own file and place it in the folder /Site/Resources/[Module] (the folder should first be created if not already existing). If there are multiple resource files in the folder containing the same key, the file last read will be used.
The directory for system strings is named "General" and for modules the name should be the module class name of the; for example ModuleCMS for resource files the web publishing module.
When working with resource files naming is important and specified by different parts; "Name[.culture].resx" where the name is whatever you prefer, but probably something that connects it to your addon. The culture is the culture code for the language the translation is specified for, or skipped if it is the defaut/fallback language.
- General.resx is the default fallback values for system strings, this file probably contains the English translation.
- General.sv-se.resx is the Swedish system strings translation, if the 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. Ensure to use unique names on your strings, for example "SpecialWidgetName" if you are building a special widget for the dashboard.
Converting Xml-Definitions to resource file
- Download the ResxGenerator.zip and extract the zip in the same folder where you already have your xml-definitions
- Open Windows Powershell command prompt
- Type for example the following to convert the existing Chinese system strings to resource file>
.\ConvertDefinitionToResx.ps1 SystemStringsChinese.xml SystemStrings.zh-CN.resx
- Copy the resource file to the correct folder for system or module string as explained the previous paragraph
Translate Litium Studio
If you need to translate Litium Studio back office to other languages than Swedish and English you need to create these languages as resource files and you cannot add the translated strings directly in Litium Studio's control panel. The reason you can't add the strings in Litium Studio's control panel is that each string's key is unique and strings that already exist in resource files cannot be created in Litium Studio control panel.
If you already have translations of Litium Studio as resource files or from an export of the strings from the current installation you can use the steps above to convert xml-definitions to resource files.