Difference between revisions of "Language Administration"

From GnuCash
Jump to: navigation, search
(restructured; Glossary ready)
(Components: sketch Program)
Line 10: Line 10:
 
==Components==
 
==Components==
 
===Glossary===
 
===Glossary===
 +
The glossary defines the terminology used in all components.
 
;Check: <Syntaxhighlight lang="sh">
 
;Check: <Syntaxhighlight lang="sh">
 
# 1 file:
 
# 1 file:
Line 34: Line 35:
  
 
===Program===
 
===Program===
;Program:<Syntaxhighlight lang="sh">
+
;Assumption: Usage of '''ninja'''. If you are using make replace ''ninja'' by ''make''.
 +
;Check: <Syntaxhighlight lang="sh">
 +
# 1 file:
 +
msgfmt -c --check-accelerators="_" --statistics po/$LOCALE.po
 +
# OR all files:
 +
for i in po/*.po; do echo -n "$i:"; LANG=C msgfmt -c --check-accelerators="_" --statistics $i ; done
 +
</syntaxhighlight>
 +
:;Errors caused by <tt>--check-accelerators="_"</tt>: should be reported to the translator only,
 +
:;Other errors: should be fixed. At least set the <tt>fuzzy</tt> flag to inform the translator.
  
 +
;Update: <Syntaxhighlight lang="sh">
 +
# 1. make pot:
 +
ninja pot
 +
# 2. update po files:
 +
for i in po/*.po; do echo -n "$i:"; LANG=C msgmerge --previous -U $i $BUILDDIR/po/gnucash.pot ; done
 +
</syntaxhighlight>
 +
;New language: <Syntaxhighlight lang="sh">
 +
# 1. make pot: (tut's das?)
 +
$BUILDDIR/ninja pot
 +
# 2. add a new glossary:
 +
cd po/
 +
msginit --no-translator -i $BUILDDIR/po/gnucash.pot -l $LOCALE
 +
# DON'T FORGET: add it to CMakeLists.txt
 +
cd ..
 
</syntaxhighlight>
 
</syntaxhighlight>
  
 
===Website===
 
===Website===

Revision as of 22:58, 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

The glossary defines the terminology used in all components.

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

Assumption
Usage of ninja. If you are using make replace ninja by make.
Check
# 1 file:
msgfmt -c --check-accelerators="_" --statistics po/$LOCALE.po
# OR all files:
for i in po/*.po; do echo -n "$i:"; LANG=C msgfmt -c --check-accelerators="_" --statistics $i ; done
Errors caused by --check-accelerators="_"
should be reported to the translator only,
Other errors
should be fixed. At least set the fuzzy flag to inform the translator.
Update
# 1. make pot:
ninja pot
# 2. update po files:
for i in po/*.po; do echo -n "$i:"; LANG=C msgmerge --previous -U $i $BUILDDIR/po/gnucash.pot ; done
New language
# 1. make pot: (tut's das?)
$BUILDDIR/ninja pot
# 2. add a new glossary:
cd po/
msginit --no-translator -i $BUILDDIR/po/gnucash.pot -l $LOCALE
# DON'T FORGET: add it to CMakeLists.txt
cd ..

Website