Now, anwering some other questions.
> - I suppose that the .po / .mo files that open source projects
> traditionally use can not be used in the App Engine world?
Yes, you can use those files with gettext functions. You'll probably
need to wrap those functions and write some utilities to make it
easier to use - but you don't need to do that because there are
excellent libraries that have done it - Babel is the most known in the
python world (I actually don't know any other).
> - Would you have various template files for each languages (like a
> contact.en.html, contact.fr.html, contact.nl.html, etc.) and use the
> appropriate file depending on the language that has been detected from
> the browser header?
No! You would use one template, and have the strings wrapped by a
translation function. The convention is to use a function name "_".
Like:
{{ _("This is my string - I'll translate it later, and if not it'll be
in English forever.") }}
There are issues you'll find, like how to handle singular/plural and
string replacements, but existing solutions cover that.
> - Would you use a single template file, but pass it the strings one by
> one that you would retrieve from the datastore (ouch, just writing
> this solution hurts!)
Absolutelly no. The strings are stored in a .po file, which you
compile into a .mo file. This if you go for the widely used gettext.
> Note: if you execute the following command from inside the GAE dev
> server folder:
> find | xargs -i grep -iH i18n \{\}
> you will see that a lot of files contain the string i18n, and that all
> are related to django. Does that mean that we could use standard
> Django internationalization techniques, or is it just that Google <
> forgot > to remove those files?
I tried to use Django's i18n. Unfortunately Django is too tied to
itself and that library is not reusable outside of Django. Fortunately
later I found a standalone, reusable, well written one: Babel. It
works very well.
-- rodrigo
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google App Engine" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---