|
| 1 | +.ini Language Files Format |
| 2 | + |
| 3 | +An .ini file is composed of strings and comments. See [Specification of language files](https://docs.joomla.org/Specification_of_language_files). |
| 4 | + |
| 5 | +### Formatting |
| 6 | + |
| 7 | +#### Comments |
| 8 | +There are 2 types of comments: |
| 9 | +- Comments used as sections, to clarify the use of a group of strings. |
| 10 | +- Comments used to inform translators of some characteristics of the string(s) just below. These should not be preceded by a blank line. |
| 11 | + |
| 12 | +#### Strings |
| 13 | +- All language strings are in British English (en-GB). See [Joomla! en-GB User Interface Text Guidelines](https://developer.joomla.org/en-gb-user-interface-text-guidelines/introduction.html) |
| 14 | +- The lines commented should start with a semi-colon. |
| 15 | +- The strings should be alphabetically ordered using the "Standard Alphabetical Order" and not the "ASCII order". This mostly means here that the underscore is sorted BEFORE the letters. |
| 16 | + |
| 17 | +Example: |
| 18 | +```ini |
| 19 | +COM_ABCD_FORMAT_WHATEVER |
| 20 | +``` |
| 21 | +comes before |
| 22 | +```ini |
| 23 | +COM_ABCD_FORMATTING_WHATEVER |
| 24 | +``` |
| 25 | + |
| 26 | +Some specific text editors only sort by "ASCII order" and should not be used. |
| 27 | + |
| 28 | +### Plugins |
| 29 | +Some IDEs have specific plugins to sort the lines by "Standard Alphabetical Order". |
| 30 | + |
| 31 | +Examples: |
| 32 | +- Atom [Sort selected elements](https://github.com/BlueSilverCat/sort-selected-elements) |
| 33 | +- Eclipse [Sortit](https://github.com/channingwalton/eclipse-sortit/tree/master/com.teaminabox.eclipse.sortit) |
| 34 | +- NetBeans [Sort line tools](http://plugins.netbeans.org/plugin/45925/sort-line-tools) |
| 35 | +- PhpStorm [String Manipulation](https://plugins.jetbrains.com/plugin/2162-string-manipulation) |
| 36 | + |
| 37 | +It may be necessary to set the sorting to "Case Insensitive Sort" to obtain the correct results. |
| 38 | + |
| 39 | +### Online tools |
| 40 | +There is also an online tool which lets order this way (among other goodies): https://wordcounter.net/alphabetize |
| 41 | + |
| 42 | +### Notes |
| 43 | +When the file includes commented sections, the strings should be alphabetically ordered in each section. |
| 44 | +Warning: when the comments concern specific strings and sorting has modified the order, the comments should be moved to the right place. |
0 commit comments