1 Star 0 Fork 0

ZHUYQ/Printrun

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
README.i18n 1.64 KB
一键复制 编辑 原始数据 按行查看 历史
freddii 提交于 2021-01-26 20:08 . fixed typos
Printrun Internationalization
Date: 06 August 2011
Author: Jonathan Marsden <jmarsden@.fastmail.fm>
Printrun is in the very early stages of being internationalized.
The pronterface.py now uses gettext for the messages it generates.
The corresponding pronterface.pot file is at locale/pronterface.pot
and was generated using
pygettext -o locale/pronterface.pot *.py printrun/*.py printrun/*/*.py
on some systems you have to replace the pygettext with pygettext2 or pygettext3..
followed by minor edits to the generated header.
This template is the basis for all pronterface message catalogs. Right
now there is only one, for German. New ones can be created:
# Create new pronterface message catalog for a different language
newlang="es" # use the correct code for your language
mkdir -p locale/${newlang}/LC_MESSAGES
cp locale/pronterface.pot locale/${newlanguage}/LC_MESSAGES/pronterface.po
cd locale/${newlanguage}/LC_MESSAGES/
# Edit the .po file to add messages for newlang (debian offers e.g.: poedit or gtranslator)
msgfmt -o pronterface.mo pronterface.po
To update a previously created message catalog from the template, use :
msgmerge -U locale/fr/LC_MESSAGES/pronterface.po locale/pronterface.pot
As currently coded, the default location for these message catalogs is
/usr/share/locale/
So, to install the catalogs, copy them to there:
sudo cp -a locale /usr/share/
To test pronterface in a new language, you can temporarily set LANG to
the language you are testing, for example
LANG=de.UTF-8 python pronterface.py
Further automation for localization and packaging of Printrun would be
nice to see, but is not here yet.
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/pandapanda99/Printrun.git
git@gitee.com:pandapanda99/Printrun.git
pandapanda99
Printrun
Printrun
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385