forked from doublespeakgames/adarkroom
-
Notifications
You must be signed in to change notification settings - Fork 0
/
translation.txt
137 lines (92 loc) · 3.69 KB
/
translation.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
HOW TO TRANSLATE
=====================================================================
** NOTE TO DEVELOPERS **:
All strings sent to the page must go through the javascript function _() which will translate it. So please if you add new strings, wrap them with _('') function.
If you want to add some strings in the css (using content), please edit /script/localization.js too.
Thank you :)
ADDING A NEW LANGUAGE
=====================================================================
Required tools:
ubuntu:
apt-get install gettext
apt-get install poedit
apt-get install python
windows:
http://poedit.net/
https://www.python.org/download/windows/
mac:
http://poedit.net
https://www.python.org/downloads/mac-osx/
Steps:
1) Create a new directory lang/{new_language_code}
2) Download the file adarkroom.pot in the lang folder as translation template
3) Create the new po file:
ubuntu:
msginit --locale {locale for new language eg: en_US} -i lang/adarkroom.pot -o lang/{new_language}/strings.po
windows:
- open application interface > File > New... > [select language for translation] > Save as... > lang/{new_language_code}/strings.po
- [update from POT file] > select lang/adarkroom.pot
4) Copy lang/main.css to lang/{new_language}
5) Open lang/{new_language}/strings.po with a software poedit
6) Translate ...
7) Keep translating ...
8) Finished? Sure?
9) Use the python script (/tools/po2js.py) to convert the po file to a js file
run from command line/terminal:
python tools/po2js.py lang/{new_language}/strings.po
Note:
make sure to have polib module installed or the command line/terminal will give you an error
polib can be downloaded and installed via the command line/terminal from the python website
on windows it could be necessary to run the command prompt as Administrator
Win Vista/7: start > right-click on command prompt > Run as Administrator
Win 8: File panel > mouse over Command prompt > click on Run command prompt as Administrator
10) Edit README.md and add the following string: [{new_language_name}](http://adarkroom.doublespeakgames.com/?lang={new_language_code})
11) Edit lang/langs.js and add the new language
Note: If your sentence are too big and you need to update some css, overload it in /lang/{new_language}/main.css
UPDATE TEMPLATE FILE
=====================================================================
When new content or changes in the code introduce new strings, the file lang/adarkroom.pot must be updated.
Required tools:
ubuntu:
apt-get install python3-babel
windows & mac:
poedit
Steps:
ubuntu:
pybabel extract -F babel.cfg -c "TRANSLATORS" script > lang/adarkroom.pot
windows:
use poedit
Use menu "Cataloge"-> "New Catalog from POT file..."
UPDATE LANGUAGE AFTER UPDATE
=====================================================================
Required tools:
ubuntu:
* gettext
windows & mac:
* poedit
- ubuntu:
msgmerge -U lang/{language}/strings.po lang/adarkroom.pot
windows:
Open lang/{language}strings.po in poedit
Use menu "Cataloge"-> "Update from POT file..."
OR
After "SETUP POEDIT"
Use menu "Cataloge"-> "Update from source"
- Edit in poedit as in "ADD A NEW LANGUAGE"
SETUP POEDIT
=====================================================================
To update from source without pot file need:
- Create new parser:
File > Preferences > Parsers > New
Language:
JS
List of extension:
*.js
Parser command:
xgettext --language=JavaScript --force-po --add-comments=TRANSLATORS -o %o %C %K %F
Item in Keyword List:
-k%k
Item in input files list:
%f
Source code charset:
--from-code=%c