Soluling home Document home
INI Localization and Internationalization
INI file (Wikipedia) a text-based de facto standard for configuration files. Soluling localization tool and service support INI. You might have a standalone INI file that needs to be localized, or your other file (e.g., application) contains embedded INI data that needs to be localized. Soluling can handle them both.
The end of the document contains links to get the full source code of the samples. After reading this document, we recommend reading a tutorial about how to use Soluling.
INI file contains sections and each section zero or more properties. Let's look at a sample file. You can find it from
[simple] product=Skim milk code=skim price=1.15 onsale=0
The sample file contains one section that has four properties. Product property contains a string value, "Skim milk." It should be localized. Code property contains a string value, "skim," but it should not be localized. Price property contains a number value, 1.15. Onsale property contains a boolean value, 0 (false). If we want to localize the file to Finnish, we would like to see a file like this:
[simple] product=Rasvaton maito code=skim price=1.15 onsale=0
The Finnish file is identical to the original English file except instead of "Skim milk" we have now "Rasvaton maito." Japanese file would be like this:
[simple] product=脱脂粉乳 code=skim price=1.15 onsale=0
Our next step is to go through the steps needed to make this happen using Soluling. Start by creating a new project for Simple.ini. The Project Wizard will first detect the format of INI file and shows Options sheet that lets you to specify the detailed format.
If Soluling did not detect the format of your INI file correctly, change the settings to match your file. Click Next button. Items sheet appears.
You have two options to specify what to localize. The first option, Localize all items of selected types, is to localize all items that contain certain types of values. By default, the type is a string so that Soluling will localize all properties containing strings values. The second option, Select items you want to localize, is to select those properties that you want to localize. Which one you use depends on your file. If the file contains only localizable properties, or if all string properties should be localized or your file is very big, then you better choose Localize all items of selected types. If only some of the string properties should be localized, then you better choose Select items you want to localize. We will go through both methods. Let's start with Localize all items of selected types. Click Next button. Data types sheet appears.
This sheet lets you to choose what data types are localized. The list contains all the data types that your file contains. Check those types you want to localize. Uncheck thos types you don't want to localize. We want to localize only strings so leave String check box checked and all other unchecked. Click Next button. The Select languages sheets appears. Add the target languages and click Next button to create the project.
Soluling extracted all string properties from the file. There are two rows: product and code. However code property should not be localized. We have few options here. The first one is to mark that row as Do not translate. If you do that the row remains in the project but it is turned read only and translator can not enter or import any translations for it. To mark a row a Do not translate right click on the yellow squere in the left side of the row and choose Do not translate.
Another option is to exclude the row. If you do that the row disappers from the project. To exclude a row right click on the yellow square in the left side of the row and choose Exclude | Only this Row.
The third option is to make Soluling to localize only the selected properties. Select Simple.ini in the project tree and right click. Choose Properties. Source dialog appears. Select Items sheet. Check Select items you want to localize radio button. Finally double click code item in the INI tree to uncheck it.
Now you have told Soluling to localize only product property and to ignore all other properties. Click OK to accpet the new settings. Soluling recongnize that properties have been changed and asks to rescan the project.
Click Yes. Soluling rescans the project and because code property is not set to be localized any more it will disapper.
When you create a project you can directly selected the properties that are localized in Items sheet of Project Wizard.
You can also set non-string properties to be localized. Double click price node to check it. Right click onsale node and choose Select data format | Boolean to set the data type to boolean and to check it.
You can read more about selecting items to be localized.
GitHub and <data-dir>\Samples\Ini contains following INI sample directories:
|Simple||A simple INI file. Study this first.|
|Boolean||A sample file that contains boolean values.|
|Data||A sample file that contains binary data encoded as base64 strings.|
|Encoding||Sample files that use various character encodings.|
|Image||A sample file that contains base64, base32, base16/hex and URL encoded images.|
|NewLine||Sample files that use various new line combinations.|
|NonEnglish||Sample files that use some other language but English.|
|Sport||A sample file that contains text and numbers.|
|Types||A sample file that contains various data types and a property that uses expression.|
You can configure how to localize your INI file or data by selecting the item in the project tree, right-clicking, and choosing the Options menu. A source dialog appears that lets you edit the options. This source uses the following option sheets.
Read more about other data files such as XML, JSON, YAML, INI, Excel, SVG, TMX, XLIFF, text and binary files.