# Localisation for Lithophane
Localisation is based on gettext and jed (http://slexaxton.github.io/Jed/).
1. Extract the strings
======================
Run following command to generate messages.po file:
$ find . -iname '*.js' | xargs xgettext -c --from-code=utf-8 --force-po --debug -o locales/lithophane.pot
$ find . -iname '*.html' | xargs xgettext -c --from-code=utf-8 --join-existing --debug --keyword=pgettext:1c,2 --keyword=npgettext:1c,2,3 --language=python -o locales/lithophane.pot
As an alternative you could consider jspot: https://github.com/praekelt/jspot
2. Start translating
====================
To start translating, we initialize a po file your language. Let's consider Dutch:
$ cd locales
$ msginit -l nl -i lithophane.pot -o nl.po
Now translate the strings in nl.po. You can use a text editor, or a dedicated
translater like Babel
3. Updating translation
=======================
When new or changed strings are present, we need to add them for translation.
First, do the step in 1. to generate a new lithophane.pot file with all strings.
This now must be merged in your existing version of the tranlation. Concider again
Dutch as before:
$ cd locales
$ msgmerge -U nl.po lithophane.pot
4. Generate json version
========================
You need po2json.
On Ubuntu:
$ sudo apt-get install node.js npm
$ npm install po2json
This will give you the po2json binary in node_modules/po2json/bin/po2json
If on running the next line you obtain a node error: "/usr/bin/env: node: No such file or directory", it is because node is called nodejs on Ubuntu. To fix, assuming you have no node program: $ sudo ln -s /usr/bin/nodejs /usr/bin/node
Use po2json to obtain json version:
$ /dir_to_install_location/po2json nl.po nl.json -f jed -p -d lithophane --fallback-to-msgid
Remove -p if you don't want the whitespace.
As we cannot set the stringOnly condition on CLI, you need to remove all entries "null,"
5. Use translation
==================
Create a .js file, use the Jed for English as base, or nl.js. Copy the translations from
your json file to the js file.
Make sure in index.html this js file in loaded, and that the Jed object is initialized
with it.
没有合适的资源?快使用搜索试试~ 我知道了~
所有来源均来自3DP.Rock网站和博客_JavaScript_HTML_下载.zip
共41个文件
js:13个
png:9个
html:5个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 13 浏览量
2023-05-01
00:01:15
上传
评论
收藏 374KB ZIP 举报
温馨提示
所有来源均来自3DP.Rock网站和博客_JavaScript_HTML_下载.zip
资源推荐
资源详情
资源评论
收起资源包目录
所有来源均来自3DP.Rock网站和博客_JavaScript_HTML_下载.zip (41个子文件)
3dp.rocks-master
LICENSE 1KB
README.md 2KB
lithophane
nav-bar.html 1KB
locales
lithophane.pot 2KB
nl.po 3KB
nl.js 2KB
README.md 2KB
js
app.js 10KB
jed.js 37KB
main.js 63KB
FileSaver.js 7KB
libs
bootstrap
bootstrap.min.js 35KB
angular.js
angular.min.js 123KB
jquery
jquery.min.js 94KB
three
Detector.js 2KB
three.min.js 406KB
controls
OrbitControls.js 15KB
NormalControls.js 9KB
TrackballControls.js 13KB
data
layout.json 11KB
layout_it.json 12KB
css
style.css 243B
style.css.map 2KB
bootstrap
bootstrap.min.css 115KB
bootstrap.css 138KB
images-page.html 2KB
scss
style.css.map 1KB
style.scss 4KB
index.html 3KB
view-page.html 2KB
images
formthumbs
form_cylinder.png 12KB
form_heart.png 9KB
form_dome_side.png 11KB
form_outer.png 9KB
form_flat.png 12KB
form_pillow.png 12KB
form_inner.png 9KB
form_dome_top.png 10KB
logo.png 2KB
README.md 451B
settings-pages.html 5KB
共 41 条
- 1
资源评论
快撑死的鱼
- 粉丝: 1w+
- 资源: 9154
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功