computing/locale
Lunovox 78807d0feb
2024-11-22 13:45:50 -03:00
..
computing.pt.tr 2024-11-22 13:45:50 -03:00
computing.pt_BR.tr 2024-11-22 13:45:50 -03:00
po2tr.lua [add] Added internacionalization. [translate] Translated to 'portuguese' (pt) and 'brazilian portuguese' (pt_BR). 2024-11-18 19:06:00 -03:00
pt.po 2024-11-22 13:45:50 -03:00
pt_BR.po 2024-11-22 13:45:50 -03:00
README.md 2024-11-18 19:33:22 -03:00
template.pot 2024-11-22 13:45:50 -03:00

HOW TO TRANSLATE

To generate the 'template.pot' file (if it does not exist), use the terminal command:

cd computing
xgettext -n *.lua -L Lua --force-po --keyword=modComputing.translate --from-code=UTF-8 -o ./locale/template.pot


Create '.po' file to translate (if it does not exist) from '.pot' template file.

Sintaxe:

msginit --no-translator --no-wrap --locale=$LANG.UTF-8 --output-file=$LANG.po --input=$POT

Example to brasilian portuguese language (pt_BR):

msginit --no-translator --no-wrap --locale=pt_BR.UTF-8 --output-file=./locale/pt_BR.po --input=./locale/template.pot

Update '.po' file to translate from '.pot' template file.

Sintaxe:

msgmerge --sort-output --no-wrap --update --backup=off $LANG.po $POT

Example to brasilian portuguese language (pt_BR):

msgmerge --sort-output --no-wrap --update --backup=off ./locale/pt_BR.po ./locale/template.pot

To edit '.po' files to your language use app poedit.:

Example of translation into brasilian portuguese language (pt_BR):

cd computing
sudo apt-get inatall poedit
poedit ./locale/pt_BR.po
  • See others locales used: ca;cs;da;de;dv;eo;es;et;fr;hu;id;it;ja;jbo;kn;lt;ms;nb;nl;pl;pt;pt_BR;ro;ru;sl;sr_Cyrl;sv;sw;tr;uk

Convert '.po' file to '.tr' file.

The '.tr' file is used as translations up to version '5.9.1'. Only from version '5.10' was support for translation via '.po' file implemented.

cd ./locale/
lua po2tr.lua "computing" "pt_BR.po"
mv "pt_BR.tr" "computing.pt_BR.tr"
cat computing.pt_BR.tr | less

TO ENABLE YOUR LANGUAGE IN MINETEST/LUANTI

  • For Sample: To enable the translate to brasilian portuguese language, write language = pt_BR in file "minetest.conf". Or write the command /set -n language pt_BR in game chat, and run again the minetest game.

SUBMITTING YOUR TRANSLATION

If you understand any language other than English, please consider submitting your language translation '.po' file to 'lunovox@disroot.org'!


See more: