I18N and google app engine

105 views
Skip to first unread message

Pierre

unread,
Sep 4, 2008, 4:57:22 PM9/4/08
to Google App Engine
Hi,

Has anybody succeed in getting i18n working with gae ?(if yes, it
could be useful to create some kind of tutorial because I haven't
found much litterature about it when googling).
I thought it could be working with django and I installed django gae
helper to use it but no success.

Is it possible to create an i18n app with out of the box google app
engine install ?

Kind regards, merci, danke shöne ;-)

Pierre

Pierre

unread,
Sep 5, 2008, 6:34:06 PM9/5/08
to Google App Engine
Just to be more precise, here's what I've already done :

- create "locale" folder
- run make-message.py -l fr
- edit django.po to change charset and translate strings
- run compile-messages.py -l fr
- load i18N in template page
- {% trans "Hello World" %}

-> should give "Bonjour le monde" but nothing happens.

Missing something ? Any idea ?

Pierre

On 4 sep, 22:57, Pierre <pierre.vann...@gmail.com> wrote:
> Hi,
>
> Has anybody succeed in gettingi18nworking with gae ?(if yes, it
> could be useful to create some kind of tutorial because I haven't
> found much litterature about it when googling).
> I thought it could be working with django and I installed django gae
> helper to use it but no success.
>
> Is it possible to create ani18napp with out of the box google app

Takashi Matsuo

unread,
Sep 5, 2008, 10:24:15 PM9/5/08
to google-a...@googlegroups.com
Hi,

Perhaps you can use django.middleware.locale.LocaleMiddleware.
Check your settings.py.

Here are my MIDDLEWARE settings:

MIDDLEWARE_CLASSES = (
'django.middleware.common.CommonMiddleware',
'django.middleware.locale.LocaleMiddleware',
# 'django.contrib.sessions.middleware.SessionMiddleware',
# 'django.contrib.auth.middleware.AuthenticationMiddleware',
# 'django.middleware.doc.XViewMiddleware',
)


Regards,

-- Takashi Matsuo

Pierre

unread,
Sep 6, 2008, 1:58:29 AM9/6/08
to Google App Engine
Hi Takashi,

I did it in Myapplication/setting.py, then restart server but
translation isn't working.

? ~~~

Pierre

On 6 sep, 04:24, "Takashi Matsuo" <matsuo.taka...@gmail.com> wrote:
> Hi,
>
> Perhaps you can use django.middleware.locale.LocaleMiddleware.
> Check your settings.py.
>
> Here are my MIDDLEWARE settings:
>
> MIDDLEWARE_CLASSES = (
> 'django.middleware.common.CommonMiddleware',
> 'django.middleware.locale.LocaleMiddleware',
> # 'django.contrib.sessions.middleware.SessionMiddleware',
> # 'django.contrib.auth.middleware.AuthenticationMiddleware',
> # 'django.middleware.doc.XViewMiddleware',
> )
>
> Regards,
>
> -- Takashi Matsuo
>

Waldemar Kornewald

unread,
Sep 6, 2008, 4:59:07 AM9/6/08
to Google App Engine
Hi Pierre,

On 6 Sep., 00:34, Pierre <pierre.vann...@gmail.com> wrote:
> Just to be more precise, here's what I've already done :
>
> - create "locale" folder
> - run make-message.py -l fr
> - edit django.po to change charset and translate strings
> - run compile-messages.py -l fr
> - load i18N in template page
> - {% trans "Hello World" %}
>
> -> should give "Bonjour le monde" but nothing happens.
>
> Missing something ? Any idea ?

I haven't yet tested i18n on the production server, but it runs fine
with Django 1.0 and dev_appserver. In order to find the source of the
problem please try to remove the localization middleware and instead
set the preferred language manually in your settings:

LANGUAGE_CODE = 'fr-FR'

Bye,
Waldemar Kornewald
Message has been deleted

A.TNG

unread,
Sep 6, 2008, 5:25:46 AM9/6/08
to Google App Engine

On Sep 6, 1:58 pm, Pierre <pierre.vann...@gmail.com> wrote:
> Hi Takashi,
>
> I did it in Myapplication/setting.py, then restart server but
> translation isn't working.

Me too. I do exactly the same as Pierre. But I only get original text,
not the translation one. Any hint?
>
> ? ~~~
>
> Pierre
>
> On 6 sep, 04:24, "Takashi Matsuo" <matsuo.taka...@gmail.com> wrote:
>
> > Hi,
>
> > Perhaps  you can use django.middleware.locale.LocaleMiddleware.
> > Check your settings.py.
>
> > Here are my MIDDLEWARE settings:
>
> > MIDDLEWARE_CLASSES = (
> >     'django.middleware.common.CommonMiddleware',
> >     'django.middleware.locale.LocaleMiddleware',
> > #    'django.contrib.sessions.middleware.SessionMiddleware',
> > #    'django.contrib.auth.middleware.AuthenticationMiddleware',
> > #    'django.middleware.doc.XViewMiddleware',
> > )
>
> > Regards,
>
> > -- Takashi Matsuo
>
> > On Sat, Sep 6, 2008 at 7:34 AM, Pierre <pierre.vann...@gmail.com> wrote:
>
> > > Just to be more precise, here's what I've already done :
>
> > > - create "locale" folder
> > > - run make-message.py -l fr
> > > - edit django.po to change charset and translate strings
> > > - run compile-messages.py -l fr
> > > - loadi18Nin template page

Pierre

unread,
Sep 6, 2008, 5:41:36 AM9/6/08
to Google App Engine
Hi Waldemar,

- "LANGUAGE_CODE = 'fr-FR' ".

To do this I need to have django, but my intent is to try to make i18n
work with google app engine without django nor google app engine
django helper. (I had trouble with django 1.0 and you cannot run
"manage.py update" with 0.96, so I'll be waiting 1.0 compatibility of
gae).

It seems like google developpers thought of i18n with file :
/google_appengine/lib/django/django/conf/global_settings.py

# Languages we provide translations for, out of the box. The language
name
# should be the utf-8 encoded local name for the language.
LANGUAGES = (
('ar', gettext_noop('Arabic')),
('bn', gettext_noop('Bengali')),

So, they said out-of the box but it is not working.
Event if you follow django tutorial for i18n.

Has anybody succeded in making this process of translation "out of the
box" working as they say... ?

Regards,

Pierre
Reply all
Reply to author
Forward
0 new messages