on i4PACE(i for Personal Archiving and Creating Environment)
actions » SearchLogin 89 articles • 30 Jul 2010

Article with comments

Thursday, 04 Dec 2008

permalink Japanese translation of Pinax 1

Working on translating Pinax into Japanese.

Using gettext and its tools, useful commands are: msgfmt : create .mo file from .po file msgunfmt : create .po file from .mo file msgmerge old.po temp.po > new.po : create new.po with template temp.po using data in old.po

Pootle has turned out to be an excellent tool. To install on Ubuntu,

$ sudo apt-get install pootle

Edit files in /etc/pootle. Create translation projects in /var/lib/pootle. Start pootle server by

$ sudo /etc/init.d/pootle start

As for translation memory, Pootle has "terminology" feature, which is limited to 30 characters per item and upto 500 words. Better program is updatetm as explained at http://translate.sourceforge.net/wiki/pootle/updatetm. E.g.,

$ updatetm -i sample.po -t memory.tmx -o sample.po.tm

where sample.po.tm is created from sample.po with memory.tmx as a translation memory, and is a translation memory file used to create suggestions on Pootle.

Well, it uses the translation memory, but how do I create it? There are other commands as shown at http://translate.sourceforge.net/wiki/decathlon/wordpress_files:

$ po2tmx -l ja -i translation_folder -o translation.tmx

which reads the po files under the folder translation_folder and put the translation into the translaton memory file translation.tmx. When a template po file sample.pot is created by xgettext or django-admin.py/manage.py makemessages, run

$ pot2po -t translation.tmx -i sample.pot -o sample.po

.

Just found out that there are many other "msg" commands:

$ man -k msg
msgattrib (1)        - attribute matching and manipulation on message catalog
msgcat (1)           - combines several message catalogs
msgcmp (1)           - compare message catalog and template
msgcomm (1)          - match two message catalogs
msgconv (1)          - character set conversion for message catalog
msgen (1)            - create English message catalog
msgexec (1)          - process translations of message catalog
msgfilter (1)        - edit translations of message catalog
msgfmt (1)           - compile message catalog to binary format
msggrep (1)          - pattern matching on message catalog
msghack (1)          - Alter .po files in ways no sane mind would think about
msginit (1)          - initialize a message catalog
msgmerge (1)         - merge message catalog and template
msgunfmt (1)         - uncompile message catalog from binary format
msguniq (1)          - unify duplicate translations in message catalog
poen (1)             - Initialises a directory English PO files by taking POT...

In addition, there are html2po and po2html commands as well:

$ html2po -t old_readme.html.po -i readme.html -o new_readme.html.po
$ po2html -t readme.html -i new_readme.html.po -o new_readme.html

as shown at http://translate.sourceforge.net/wiki/decathlon/wordpress_files.

• Wrote Teru at 15:00 (edited 7×, last on 04 Dec 2008) | read 44× | Add comment

Comments (0)

No comments for this article yet.

Write a comment

Your name  
E-mail   (only visible for blog owner)
Homepage
How much is 2×4?   (protection against spam-bots)
Text:

[b] [i] [u] [tt] [center] [code] [quote] [url] [url=] [img] [@] [@@] [@:]
detailed help about markup
Process times: page=0.022 request=0.037 cpu=0.030