OK, I think you're a little confused. You can use gettext and po / mo files from appengine, since gettext is exported from the Google implementation django.util (a discussion of this can be found in google- appengine google group ):
from django.utils.translation import gettext as _
I am not familiar with the AppEngine CSV i18n format, but there is a very simple way to extract internationalized strings from code and tornado templates using xgettext , just basically force python from the command line. As an example:
xgettext -L Python -o myproject.pot *.html
This command will get all i18n 'lines from * .html in your current directory and put them in myproject.pot. You can initialize this file and translate it into let say./it_IT/myproject.po using any commercial or open source tool (I would recommend poedit or pootle ), and once you translate all the lines, you can convert the file to CVS using Translate Toolkit po2csv , which is also written in python:
po2csv -i it_IT/myproject.po -o it_IT/myproject.csv
The format location:codeLine,source,target , which is quite simple, can easily be converted to any other format (I am not familiar with the appengine i18n CSV format), you can call po2csv without the -o argument and output the output from STDOUT.
I donβt know if this question solves your question, but basically I think you should accept the code-> pot / po-> csv workflow as there are many tools that expect po / pot / mo and allow you to handle your translations or working with memory translation / spellchecking etc ... try and let me know if you need more help.
Ews
source share