sebastian-ardila / google-app-engine-django

Automatically exported from code.google.com/p/google-app-engine-django
Apache License 2.0
0 stars 0 forks source link

Unable to make i18N work #182

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1. set USE_I18N = True and LANGUAGE_CODE = 'sk' in seetings.py

2. add 'django.core.context_processors.i18n' to the list of 
TEMPLATE_CONTEXT_PROCESSORS in settings.py

3. create following template and save it as 'i18n.html' in 'templates' 
directory:

{% load i18n %}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>i18n</title>
</head>
<body>
    {% trans "Slovak" %}
</body>
</html>

4. create following request handler in 'views.py':

def i18n(request):
    return render_to_response('../templates/i18n.html')

5. add following url pattern to 'urlpatterns' in 'urls.py':

(r'^i18n$', i18n)

6. hit created page http://localhost:8000/i18n

What is the expected output? What do you see instead?

Because Slovak language is a part of Django's available localizations a its po 
file is in place, you should be getting localized meessage, i.e. 'slovenský'.

Instead the 'Slovak' string is not replaced/translated.

What version of the product are you using? On what operating system?

Google App Engine SDK 1.3.7
Google App Engine Helper for Django r105
Django 1.2.1

Please provide any additional information below.
Django is provided as zip archive

Original issue reported on code.google.com by michal.j...@gmail.com on 15 Sep 2010 at 2:55

GoogleCodeExporter commented 9 years ago
Do you get any errors or debugging output to suggest why the translation is not 
being picked up correctly?

Do you have any insight into what is going wrong here?

Original comment by m...@google.com on 26 Oct 2010 at 12:32

GoogleCodeExporter commented 9 years ago
I tried to reproduce the problem and with the same result. No error is 
reported. I was using django.zip. Then I unzipped django.zip a removed 
django.zip file and it worked. Looks like there's some problem with i18n when 
using zipped django. 
(I tested on django version 1.2.3)

Original comment by igor.mih...@gmail.com on 12 Nov 2010 at 2:46