In the templates, use {% trans 'My string' %}. Put {% load i18n %} at the top of the file (must be one of first couple lines).
On Aug 1, 11:22 am, Emilien Klein <emilien.kl...@gmail.com> wrote: > Hi Devel63, > Thanks for your answer. But this is just for inside your Python files, > how do you manage text in the templates? Or don't you use templates? I > don't really see how you're managing this... > Is your app open source (i.e. Is there a place where I can see your > code)? > > On 1 août, 10:31, Devel63 <danstic...@gmail.com> wrote: > > > We use the Django 0.96 that is bundled with GAE. > > > from django.utils.translation import gettext as _ > > > Then just use _('My String") in the code, combined with the .po/.mo > > files. > > > On Aug 1, 8:16 am, Rodrigo Moraes <rodrigo.mor...@gmail.com> wrote: > > > > On Sat, Aug 1, 2009 at 11:51 AM, Emilien Klein wrote: > > > > The problem I see with using Babel is that it IS an external library, > > > > which means that I need to integrate it with my project. What I'm > > > > looking for is a way to have a translated application WITHOUT having > > > > to install any external library... > > > > Without any other external library, you have 2 options: > > > > 1. use gettext -http://docs.python.org/library/gettext.html > > > 2. hack and patch django's i18n > > > > The problem with the 2nd option is that your app stays tied to > > > django's ecosystem - later you need i18n in a small project and you'll > > > have to add django just for it. Ok, it is a valid solution, I just > > > personally prefer to use a external library that is not coupled with a > > > bunch of unrelated things, and avoid all the monkeypatching mess. > > > > -- 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 google-appengine@googlegroups.com To unsubscribe from this group, send email to google-appengine+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~----------~----~----~----~------~----~------~--~---