Difference between revisions of "Language Administration"

From GnuCash
Jump to: navigation, search
(Checking New po Files)
(restructured; Glossary ready)
Line 1: Line 1:
 +
This page lists often used commands, sorted by components. Collected from several places in [[Translation]].
 
[[Category:L10N|Language Administration]]
 
[[Category:L10N|Language Administration]]
==Checking New po Files==
+
==Intro==
;Glossary: Check: <Syntaxhighlight lang="sh">
+
As we get translations from several resources, we run basic '''checks''' ''before committing''! Fix them or report them to the LAST TRANSLATOR, if possible.
 +
 
 +
In theory each time a user visible '''message changes''', a ''new pot'' file should be created and ''merged into all po'' files. Sometimes '''new po''' files are requested.
 +
;Notes on command components:
 +
:;LANG=C: serves to get the messages in english to forward them to the translator.
 +
:;$LOCALE: replace it by the desired locale.
 +
==Components==
 +
===Glossary===
 +
;Check: <Syntaxhighlight lang="sh">
 
# 1 file:
 
# 1 file:
msgfmt -c --statistics po/glossary/tr.po
+
msgfmt -c --statistics po/glossary/$LOCALE.po
# all files:
+
# OR all files:
 
for i in po/glossary/*.po; do echo -n "$i:"; LANG=C msgfmt -c --statistics $i ; done
 
for i in po/glossary/*.po; do echo -n "$i:"; LANG=C msgfmt -c --statistics $i ; done
 
</syntaxhighlight>
 
</syntaxhighlight>
  
==Updating pot Files==
+
;Update: <Syntaxhighlight lang="sh">
In theory each time a user visible message changes, a new pot file should be created and merged into all po files. Sometimes new po files are requested.
 
;Glossary: Update: <Syntaxhighlight lang="sh">
 
 
# 1. make pot:
 
# 1. make pot:
 
po/glossary/txt-to-pot.sh po/glossary/gnc-glossary.txt > po/glossary/gnc-glossary.pot
 
po/glossary/txt-to-pot.sh po/glossary/gnc-glossary.txt > po/glossary/gnc-glossary.pot
Line 16: Line 23:
 
for i in po/glossary/*.po; do echo -n "$i:"; LANG=C msgmerge --previous -U $i po/glossary/gnc-glossary.pot ; done
 
for i in po/glossary/*.po; do echo -n "$i:"; LANG=C msgmerge --previous -U $i po/glossary/gnc-glossary.pot ; done
 
</syntaxhighlight>
 
</syntaxhighlight>
: New language: <Syntaxhighlight lang="sh">
+
;New language: <Syntaxhighlight lang="sh">
 
cd po/glossary/
 
cd po/glossary/
# make pot:
+
# 1. make pot:
 
./txt-to-pot.sh gnc-glossary.txt > gnc-glossary.pot
 
./txt-to-pot.sh gnc-glossary.txt > gnc-glossary.pot
# add a new glossary:
+
# 2. add a new glossary:
msginit --no-translator -l # add <locale>
+
msginit --no-translator -l $LOCALE
# add it to CMakeLists.txt
+
# DON'T FORGET: add it to CMakeLists.txt
 
cd ../..
 
cd ../..
 
</syntaxhighlight>
 
</syntaxhighlight>
 +
 +
===Program===
 
;Program:<Syntaxhighlight lang="sh">
 
;Program:<Syntaxhighlight lang="sh">
  
 
</syntaxhighlight>
 
</syntaxhighlight>
;Website:
 
  
==Creating New po Files==
+
===Website===

Revision as of 22:08, 9 February 2021

This page lists often used commands, sorted by components. Collected from several places in Translation.

Intro

As we get translations from several resources, we run basic checks before committing! Fix them or report them to the LAST TRANSLATOR, if possible.

In theory each time a user visible message changes, a new pot file should be created and merged into all po files. Sometimes new po files are requested.

Notes on command components
LANG=C
serves to get the messages in english to forward them to the translator.
$LOCALE
replace it by the desired locale.

Components

Glossary

Check
# 1 file:
msgfmt -c --statistics po/glossary/$LOCALE.po
# OR all files:
for i in po/glossary/*.po; do echo -n "$i:"; LANG=C msgfmt -c --statistics $i ; done
Update
# 1. make pot:
po/glossary/txt-to-pot.sh po/glossary/gnc-glossary.txt > po/glossary/gnc-glossary.pot
# 2. update glossaries:
for i in po/glossary/*.po; do echo -n "$i:"; LANG=C msgmerge --previous -U $i po/glossary/gnc-glossary.pot ; done
New language
cd po/glossary/
# 1. make pot:
./txt-to-pot.sh gnc-glossary.txt > gnc-glossary.pot
# 2. add a new glossary:
msginit --no-translator -l $LOCALE
# DON'T FORGET: add it to CMakeLists.txt
cd ../..

Program

Program

Website