User:Willee/GettextHowto

From The Mana World

Gettext notes

Upgrade manaplus translation file

To add new untranslated lines in manaplus do:

   $ cd manaplus_src/po
   $ make update-po

(which in its order does msgmerge).

Test potfile

Validate for critical errors (like c-format) and output translation stats (number of fuzzy lines, number of translated and untranslated lines):

   $ msgfmt -cv xx.po

Compile manaplus with new language support, with e.g. --prefix=$HOME/.opt , convert .po to .mo and place into manaplus shared path.

   $ msgfmt -o xx.mo xx.po

Default paths:

  • help - $prefix/share/manaplus/data/translations/help
  • gui - $prefix/share/locale

msgfmt part of gettext distribution.

Helper tools

Get gettext-lint tools, then use POFileChecker. Output suggests missed commas and few other common errors.

Client data testing

Build own local testing server, place translation file xx.po to path client-data/translations .

See: https://wiki.themanaworld.org/index.php/How_to_Develop

Register GM character, set client custom game data location and use /createitems dialog to display all items (this can slow down your box).

Placing local updates file

This is helpful in case you don't have testing server.

Zip target files conforming to client-data structure, place resulted .zip to updates folder (default for tmw can be ~/.local/share/mana/update/tmwdata.org/updates/local ). Then generate adler32 checksum (see e.g. tmwa-server-data/tools) and put in resources.xml, like:

   <?xml version="1.0"?>
   <updates>
       <update type="data" file="urfixhere.zip" hash="840ff7bf" />
   </updates>