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
没有合适的资源?快使用搜索试试~ 我知道了~
小黑屋-小游戏-NAS-WebStation-HTML5
共232个文件
flac:86个
js:60个
css:34个
需积分: 0 1 下载量 163 浏览量
2023-08-21
15:32:53
上传
评论
收藏 6.52MB ZIP 举报
温馨提示
小黑屋-小游戏,部署于NAS的WebStation等服务器上,分配端口即可使用,Index文件内已去除广告
资源推荐
资源详情
资源评论
收起资源包目录
小黑屋-小游戏-NAS-WebStation-HTML5 (232个子文件)
babel.cfg 41B
main.css 10KB
dark.css 3KB
space.css 3KB
world.css 1KB
path.css 1KB
outside.css 855B
room.css 848B
fabricator.css 517B
main.css 382B
main.css 280B
main.css 173B
main.css 130B
main.css 130B
main.css 130B
main.css 130B
main.css 129B
main.css 129B
main.css 129B
main.css 129B
main.css 129B
main.css 129B
main.css 128B
main.css 128B
main.css 128B
main.css 128B
main.css 128B
main.css 128B
main.css 128B
main.css 128B
main.css 128B
main.css 128B
main.css 128B
main.css 128B
ship.css 85B
thumbs.db 81KB
.ds_store 10KB
raucous-village.flac 197KB
large-village.flac 183KB
landmark-town.flac 157KB
tiny-village.flac 157KB
modest-village.flac 152KB
world.flac 143KB
lonely-hut.flac 137KB
silent-forest.flac 133KB
ending.flac 120KB
ship.flac 118KB
landmark-ironmine.flac 117KB
landmark-crashed-ship.flac 116KB
landmark-borehole.flac 108KB
landmark-friendly-outpost.flac 106KB
landmark-swamp.flac 103KB
dusty-path.flac 99KB
landmark-destroyed-village.flac 99KB
fire-burning.flac 96KB
landmark-sulphurmine.flac 96KB
landmark-cave.flac 94KB
landmark-city.flac 94KB
landmark-house.flac 89KB
event-hut-fire.flac 87KB
event-soldier-attack.flac 86KB
event-ruined-trap.flac 83KB
encounter-tier-2.flac 78KB
event-mysterious-wanderer.flac 78KB
encounter-tier-1.flac 77KB
fire-flickering.flac 76KB
landmark-coalmine.flac 75KB
encounter-tier-3.flac 74KB
fire-roaring.flac 73KB
landmark-battlefield.flac 73KB
fire-dead.flac 71KB
event-wandering-master.flac 70KB
fire-smoldering.flac 69KB
event-thief.flac 68KB
event-shady-builder.flac 65KB
event-beggar.flac 63KB
event-noises-inside.flac 62KB
event-nomad.flac 59KB
event-beast-attack.flac 56KB
event-plague.flac 53KB
event-noises-outside.flac 53KB
event-sickness.flac 52KB
event-scout.flac 52KB
event-sick-man.flac 48KB
space.flac 42KB
crash.flac 37KB
asteroid-hit-6.flac 27KB
asteroid-hit-7.flac 27KB
asteroid-hit-8.flac 24KB
asteroid-hit-5.flac 21KB
upgrade-engine.flac 20KB
lift-off.flac 19KB
asteroid-hit-4.flac 17KB
asteroid-hit-2.flac 16KB
asteroid-hit-3.flac 14KB
reinforce-hull.flac 13KB
build.flac 13KB
asteroid-hit-1.flac 12KB
weapon-ranged-3.flac 12KB
weapon-ranged-2.flac 11KB
共 232 条
- 1
- 2
- 3
资源评论
LightingVPC
- 粉丝: 0
- 资源: 48
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功