Poran

What’s this?

Poran is a highly experimental tool for automatically translating PO files.

Download

https://osdn.net/users/utuhiro/pf/utuhiro/files/

Usage

Try to translate Gedit to Japanese.

cd poran-*/src/
wget https://l10n.gnome.org/POT/gedit.master/gedit.master.pot
msginit -l ja -i gedit.master.pot -o gedit.master.po
ruby poran-po2html.rb gedit.master.po

‘poran.html’ and ‘poran.txt’ are generated. Open ‘poran.html’ with Chromium.

Right click -> Choose ‘Translate to Japanese’.

Press a PageDown key and scroll to the end of the page.

Copy the translated texts (Press Ctrl-A -> Ctrl-C).

Open ‘poran.txt’ and paste the translated texts. -> Save the file.

ruby poran-txt2po.rb
msgfmt -c poran.txt.po -o gedit.mo
=>
poran.txt.po:7: warning: header field 'Project-Id-Version' still has the initial default value
poran.txt.po:777: 'msgstr[0]' is not a valid C format string, unlike 'msgid_plural'. Reason: The character that terminates the directive number 1 is not a valid conversion specifier.
msgfmt: found 1 fatal error

Fix the error.

  msgid_plural ""
  "Changes made to the document in the last minute and %ld seconds will be "
  "permanently lost."
- msgstr[0] "最後の1分間と%2!秒の間にドキュメントに加えられた変更は永久に失われます。"
+ msgstr[0] "最後の1分間と%ld秒の間にドキュメントに加えられた変更は永久に失われます。"

Run msgfmt again.

msgfmt -c poran.txt.po -o gedit.mo
=>
poran.txt.po:7: warning: header field 'Project-Id-Version' still has the initial default value

You can generate gedit.mo without fatal errors.