.ini files are commonly used in applications on various platforms. There is no standard for .ini files and the applications can vary in their use of key-value delimiters, comment masks, comment positions, sections nesting, support for blank lines…
So LingoHub has applied the following rules for .ini files that should match common variations.
- Key-value pairs are delimited with the equal character (=) or colon (:) and terminated by a new line.
- Values can not spread to multiple lines.
- Section declarations can have this form: [section].
- All keys after the section declaration are associated with that section.
- There is no explicit “end of section” delimiter and sections end on the next section declaration or at the end of the file.
- Sections can not be nested.
- The translation title will be a combination of the section and the segment key. This combination has to be unique in your LingoHub project.
- Placeholders are not supported because there is no standardized format. This means LingoHub is not able to detect placeholders to give you LingoChecks support.
- Comment lines can start with a hash sign (#) or semicolon (;) and everything up to the end of the line is treated as a comment.
- A comment is assigned to the next key-value pair unless there are any blank lines or section declarations in between.
Additional example files can be accessed here.
|; this comment is ignored because it is not directly followed by a key-value pair|
|; this comment will be stored along with the section information|
|; comments in .ini files can start with hash|
|hello_user = Hello stranger!|
|; this key belongs to section2 and no longer to section1|
|welcome_message = Welcome back, we have missed you|
|; multi line comments belong to the next key value pair|
|; as long as they are not interrupted by a white line|
|visit_count = this is your millionth visit to our site|