INI files
INI file localization: translate the values, keep the keys.
Lingobit Localizer reads an .ini file as sections, keys, and values. Translators see only the values; sections, keys, and comments stay exactly as they are. For each language you get a translated de\app.ini in the encoding of the original, ready for your application to load.
- Translated
- The value after
= - Kept
- Sections, keys, comments
- Encodings
- ANSI, UTF-8, UTF-16
- Output
de\app.inifor each language
On this page
What Lingobit translates in an INI file.
Each key=value line becomes one string, identified by its section and key. The key is how Lingobit finds the translation again when the file changes in the next release.
app.ini
; Settings dialog
[Main]
Title=MyApp Settings
ButtonOK=OK
Width=640
[Messages]
Saved=File saved.
Greeting=Hello, %s!
de\app.ini
; Settings dialog
[Main]
Title=MyApp-Einstellungen
ButtonOK=OK
Width=640
[Messages]
Saved=Datei gespeichert.
Greeting=Hallo, %s!
| Part of the file | What happens |
|---|---|
[Section] | Kept; groups the strings in the project tree. |
Key= | Kept; the ID of the string. |
| The value | Translated. Spaces around it are trimmed; quotes are part of the value. |
; comment | Kept, also after a value: Title=Settings ; dialog title translates only Settings. |
Lines without = | Kept as they are, for example # comments. |
Every value is a string, including numbers, paths, and colors. Lock the ones that must not change, such as Width=640: locked items cannot be translated, are not sent to translators, and are not counted as work.
Steps
From app.ini to a file for each language.
Add the fileCreate a project with your target languages and add
app.ini. Lingobit detects ANSI, UTF-8, or UTF-16, with or without a byte order mark.Lock what staysLock numbers, paths, and other values the application reads as data.
TranslateIn the project table, with translation memory and machine suggestions from DeepL, Google Translate, or Microsoft Azure Translator, or send the strings to translators with Prepare Translation Task.
CheckValidation runs on the translations before you create the files; Create Localized Files lists characters the file's encoding cannot hold.
Create the filesCreate Localized Files writes
de\app.ini,fr\app.ini, and so on, in the encoding of the original. The output pattern can be changed for the project or for the file.Next releaseScan for Changes compares the new
app.iniby section and key: new and changed values need translation, the rest keep theirs.
Tips for INI files that translate well.
- Unique keys. A key that appears twice in one section is ambiguous for every tool, including Windows' own
GetPrivateProfileString. - Text and settings apart. A separate
[Strings]section, or a separate file, keeps data values out of the translators' way. - Placeholders, not concatenation.
Saved=Saved %s.translates;Saved1=SavedplusSaved2=.does not. - UTF-8 or UTF-16 for new files. An ANSI file holds one code page: Japanese text needs a Japanese code page or a Unicode file.
Questions.
Where does the translated file go?
By default into a folder for each language next to the original: de\app.ini, fr\app.ini. Your application, or your installer, picks the file for the user's language.
Are section names and keys translated?
No. The application finds its values by section and key, so both stay as they are in every language.
Can translators work without Lingobit?
Yes. Prepare Translation Task writes XLIFF 1.2 or CSV for their own tools, or a project for Translator Edition, which is included with every Localizer license. See XLIFF and TMX.
Can I translate the INI files together with the application?
Yes. One project can hold the EXE and DLL files, the INI files, help, and other files of a release; translation memory and terminology are shared between them. See Supported formats.
Related paths
- Win32 / MFC — The dialogs, menus, and strings of the application itself.
- XML — Settings and data files in XML, selected by XPath.
- XLIFF and TMX — Exchange with translators and their tools.
- Supported formats — Every format and the edition that reads it.