Skip to content

Commit c2bed76

Browse files
roland-dwilsonge
authored andcommitted
Add codestyle for language files (#241)
1 parent 6e003c6 commit c2bed76

File tree

2 files changed

+46
-1
lines changed

2 files changed

+46
-1
lines changed

manual/basic-guidelines.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ This chapter outlines the basic guidelines covering files contributed to the Joo
44

55
All files contributed to Joomla must be:
66

7-
* Stored as ASCII text
7+
* Stored as ASCII text
8+
Exceptions: languages locales and some test files containing non-ASCII characters
89
* Use UTF-8 character encoding
910
* Be Unix formatted following these rules.
1011
1. Lines must end only with a line feed (LF).

manual/ini.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
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

Comments
 (0)