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.

Your source INI app.ini Lingobit Localizer Project SourceGerman New Order Neue Bestellung Customer: Kunde: Quantity: Menge: Each string, translated in the project You get app.ini de\app.ini fr\app.ini ja\app.ini A translated file for each language; keys stay as they are Your source INI app.ini Translate in Lingobit Project SourceGerman New Order Neue Bestellung Customer: Kunde: Quantity: Menge: You get app.ini source de\app.ini fr\app.ini ja\app.ini
Translated
The value after =
Kept
Sections, keys, comments
Encodings
ANSI, UTF-8, UTF-16
Output
de\app.ini for 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!
How each part of an INI file is handled
Part of the fileWhat happens
[Section]Kept; groups the strings in the project tree.
Key=Kept; the ID of the string.
The valueTranslated. Spaces around it are trimmed; quotes are part of the value.
; commentKept, 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.

  1. 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.

  2. Lock what staysLock numbers, paths, and other values the application reads as data.

  3. 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.

  4. CheckValidation runs on the translations before you create the files; Create Localized Files lists characters the file's encoding cannot hold.

  5. 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.

  6. Next releaseScan for Changes compares the new app.ini by 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=Saved plus Saved2=. 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.