You can use my simple commons project, it worked fine for my GAE app: http://commons.apache.org/sandbox/i18n/
On 3 Aug., 07:57, NiklasRTZ <[email protected]> wrote: > The sv .po seems to have a colon too much so it doubles with use with > forms. All ready translations from the django library LC_MESSAGES can > get reused for our projects which is very good, templates work with > i18n and a custom request handler and some success currently > integrating translations with djangoforms where I must translate eg. > from django.utils import translation > class i18NForm(djangoforms.ModelForm): > email = forms.CharField(max_length=127,label=_("E-mail > address").capitalize()) > Then sv.LC_MESSAGES.django.po row 1584 read > #: contrib/admin/views/doc.py:297 > msgid "E-mail address" > msgstr "E-postadress:" > Note the colon (:) then doubles when using it with djangoforms. Hence > my suspicion the colon should be removed otherwise it doubles. > It's only in the locale sv locale no didn't double the ":" > #: contrib/admin/views/doc.py:283 > msgid "E-mail address" > msgstr "E-post adresse" > Should the colon get removed? > > On Aug 2, 2:51 pm, Devel63 <[email protected]> wrote: > > > > > 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 <[email protected]> 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 <[email protected]> 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 <[email protected]> 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 [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 -~----------~----~----~----~------~----~------~--~---
