Skip to content

Commit 0a26402

Browse files
authored
Update README.md
1 parent aa2e2c0 commit 0a26402

File tree

1 file changed

+47
-6
lines changed

1 file changed

+47
-6
lines changed

README.md

Lines changed: 47 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,12 @@ Example: `"ModeSelectionMenuNormalMode": "Normal game."`
3737

3838
The object must contain the key Culture with a two-letter language code (ISO 639-1).
3939

40+
Example: `"Culture": "en"`
41+
4042
There must also be a Language key containing the name of the language in lowercase.
4143

44+
Example: `"Language": "english"`
45+
4246
The file name is the language name in lowercase, for example, english.lng.
4347

4448
### pot
@@ -51,12 +55,30 @@ A translation file compatible with gettext.
5155

5256
We use the two-letter language code as the file name, for example, ru.po.
5357

58+
### docs
59+
Projects that have documentation, such as BallBouncer, have a docs directory.
60+
61+
This directory contains subdirectories named as two-letter language codes, for example en.
62+
63+
Each such subdirectory contains project documentation files.
64+
65+
#### md
66+
md files are documentation files in markdown format, such as readme.md.
67+
68+
#### pot
69+
Standard translation template file generated by the xgettext program, such a file is generated for each md file in docs/en, for example readme.pot.
70+
71+
#### po
72+
A translation file compatible with gettext.
73+
5474
## Sequence of Adding a Translation
5575
### From our side
5676
If resx files are used, we convert them all into an lng file with an English translation, english.lng.
5777

5878
Then the <project name>.pot file is generated from english.lng.
5979

80+
English documentation markdown files are processed by the mdpo program, it extracts blocks of text and forms pot files from them.
81+
6082
### From the translator's side
6183
You need to fork this repository and create a branch for the new translation.
6284

@@ -65,25 +87,44 @@ Then you should choose your preferred translation method.
6587
#### po
6688
You can load the .pot file into a translation program, such as Poedit, and perform the translation there.
6789

68-
Then the completed po file, for example, fr.po, needs to be added to the project directory and a pull request should be sent to this repository.
90+
Then the completed po file, for example, fr.po, needs to be added to the project directory.
91+
92+
To translate documentation, you need to use pot files from the docs/en directory as a template.
93+
94+
In the docs directory, you should create a subdirectory for translated files, the name should be the two-letter language code.
95+
96+
Ready po files, for example readme.po, need to be placed in the created directory.
6997

7098
#### lng
71-
You can translate the lng file directly. As a template, you can use any existing file in this repository, not necessarily english.lng.
99+
This is not a recommended method, because... At the moment, we cannot offer a convenient way to update and validate translations.
100+
101+
Use it only if it is impossible to use poedit or similar software.
102+
103+
You can translate the lng file directly. As a template, you can use any existing file in this repository, but we recommend to translate english.lng.
72104

73105
If you use a file other than english.lng and decide to send an unfinished translation, be sure to delete all untranslated strings so that the file contains only strings in the target translation language.
74106

75107
For example, if you decided to translate russian.lng to French, translated half of it, and decided to send this intermediate result, delete all remaining Russian strings, leaving only the French ones.
76108

109+
This is necessary so that the untranslated strings fallback to the english language.
110+
77111
When using english.lng as a template, it is not necessary to delete untranslated strings.
78112

79113
In the lng file, you need to set the correct values for the Culture and Language keys; see the section above about the lng format.
80114

81-
Then the completed lng file, for example, french.lng, needs to be added to the project directory and a pull request should be sent to this repository.
115+
Then the completed lng file, for example, french.lng, needs to be added to the project directory.
82116

83-
#### resx
84-
Please do not translate resx files; we do not validate them and do not accept translations in this format.
117+
#### resx and md
118+
Please do not translate resx and md files; we do not validate them and do not accept translations in this format.
85119

86120
#### Next Steps
87-
Submit a pull request with your translation. We will review it, ask for changes if necessary, and if the translation is correct, we will merge it into master.
121+
When the translation is completed and all files are in their places, submit a pull request with your translation. We will review it, ask for changes if necessary, and if the translation is correct, we will merge it into master.
88122

89123
After that, the translations will be added to the corresponding products and delivered to users via the update system.
124+
125+
### Translating new/changed strings
126+
When we make changes to our projects, the source language files will be updated in this repository.
127+
128+
You will need to merge the master branch into your branch, and then update your translation from the updated pot files and translate the new lines.
129+
130+
For lng files, as stated above, we cannot offer a convenient way to update the translation, but we will try to solve this problem in the future.

0 commit comments

Comments
 (0)