1

I want to write a Python script that would extract the msgid strings from the Django.po files generated by makemessages command for i18n.

Sample:

#: views.py:231
msgid "Jack and Jill went up the hill."
msgstr ""

#: views.py:34
msgid "Wrong choice. Select wisely."
msgstr ""

#: views.py:100 views.py:420 views.py:655 templates/thankYou.html:4
msgid "Thank You. You will be contacted shortly."
msgstr ""

I'd like to:

  1. Extract each msgid string and place it in a text file.

  2. Meanwhile, I'd also create a corresponding list of line numbers of the msgid's msgstrs, so that after translation, I could easily insert the translated text back into their corresponding msgstr "" quotes

  3. And then after I translate the text file wholly, I feed it back to the 2nd part of my script which then puts the translated strings back into their corresponding msgstr parts.

Any ideas how I should go about this ?

Tony K
  • 61
  • 3
  • 10
  • Why not translate the entries in the po file? It's format is stupid simple even for non-technical translators. – Maciej Gol May 16 '14 at 06:26

0 Answers0