User:Willee/GettextHowto

From The Mana World
Revision as of 08:35, 28 December 2014 by Willee (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Gettext notes[edit]

Upgrade manaplus translation file[edit]

To add new untranslated lines in manaplus do:

   $ cd manaplus_src/po
   $ make update-po

(which in its order does msgmerge).

Test potfile[edit]

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[edit]

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

Client data testing[edit]

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[edit]

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>