Translation (i18n)

5 views
Skip to first unread message

Anton Danilchenko

unread,
Dec 16, 2010, 2:49:47 PM12/16/10
to gaefra...@googlegroups.com
Today we have fixed old bug with translate application text if we use one application in another. For example, we need include "comment" app to "blog" app. We can detect that used "blog" app if shown blog entity page. And "comment" block not translated because we try to load translation file for "blog" app.

Now we have fixed bug only for Models. If you have used one model in another application - that we correctly detect application name by model prefix (blog detected by model name BlogEntity, and comment detected by Comment model).

Also we have added second parameter to template tag {% translate %}. You can pass application name in second parameter like this {% translate "Hello World!" blog %}. We not found how to detect application name, if we have used one template included in another. For example, we want to include page "user/login_form.html" into "page/welcome.html". We have see form with translated fields and choices - but all texts from template "user/login_form.html" do not translated!

If you have a good idea about how to automatically detect current application name in template - please tell us. This is not urgent task - but we need complete this component for non-english speakers, who want to translate application to different languages.

Regards, Anton.

Niklas Rosencrantz

unread,
Dec 18, 2010, 9:49:53 PM12/18/10
to gaefra...@googlegroups.com
Thanks for the update. Can user select language or admin/programmer
only? GAE/Django I used behaved according to HTTP header
ACCEPT_LANGUAGE, cookie django_language or hardcoded variable in a
file like settings.py Now I understand translations with GAE Framework
are done in yaml files while default GAE has .po files.
I translated .po to Swedish using escape for ampersand eg:

msgid "Sports & Outdoors"
msgstr "Sport & Fritid"

It's not obvious to me that I can't do this:
msgid "Sports & Outdoors"
msgstr "Sport & Fritid"

I also mixed markup in a translation I have doubts whether to keep
html in the translation files:

msgid "You can <a href='/li'>search</a>...
msgstr "<a href='/li'>Finn din vara gratis.</a>...

Best regards,
Niklas

Anton Danilchenko

unread,
Dec 20, 2010, 1:53:26 PM12/20/10
to gaefra...@googlegroups.com
Now we can not detect user language. You can help u detect user language and set this property to user session (or cookie)

Anton Danilchenko

unread,
Dec 26, 2010, 4:06:53 PM12/26/10
to gaefra...@googlegroups.com
Was updated internationalization support documentation page

Niklas Rosencrantz

unread,
Dec 26, 2010, 5:42:08 PM12/26/10
to gaefra...@googlegroups.com

It looks very good and easier for translators to work with yaml than. po. I'll update by svn to latest version. Thank you Anton!

Anton Danilchenko

unread,
Dec 27, 2010, 12:02:25 PM12/27/10
to gaefra...@googlegroups.com
Today we have fixed bug with translation.

Previously you can see error message if you have used empty translation file (without content). Now we have detect empty files and use empty dictionary instead.

Please upgrade your applications to latest changes from SVN if you have used translations.
Reply all
Reply to author
Forward
0 new messages