Portuguese (pt) request.LANGUAGE_CODE problem

8 views
Skip to first unread message

Patrick J. Anderson

unread,
Jan 16, 2007, 1:40:50 PM1/16/07
to django...@googlegroups.com
Hi, everybody!

I wanted to post about a little problem I have while developing
multilingual site I'm working on.

I plan to include content in various languages, focusing on 3 at the
moment: English, Spanish and Portuguese.

I have followed the docs on i18n and this are working great, except for
one little detail. I'm not able to switch current language to
Portuguese(pt) language, while I can change to Brazilian
Portuguese(pt_br). I see that Portuguese(pt) locale does not exist in
the framework, but does that prevent me from using it on my site?

Below are the appropriate settings I use in settings.py:

-------------------------------------------------------

LANGUAGE_CODE = 'en'

LANGUAGES = (
#('de', 'Deutsch'),
('en', 'English'),
('es', 'Español'),
#('fr', 'Français'),
#('hu', 'Magyar'),
#('it', 'Italiano'),
#('ja', '日本語'),
#('pl', 'Polski'),
('pt', 'Português'),
#('ro', 'Română'),
#('ru', 'Руский'),
#('zh', '中文'),
)

USE_I18N = True

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

TEMPLATE_CONTEXT_PROCESSORS = (
'django.core.context_processors.auth',
'django.core.context_processors.debug',
'django.core.context_processors.i18n',
'django.core.context_processors.request',
)

--------------------------------------------------------


Has anyone working on Portuguese sites encountered the same problem?
Should I use Brazilian Portuguese instead?

I'd appreciate some help with figuring out how to go about adding that
locale to my site in simplest and sensible way.

James Bennett

unread,
Jan 16, 2007, 2:57:45 PM1/16/07
to django...@googlegroups.com
On 1/16/07, Patrick J. Anderson <pat.j.a...@gmail.com> wrote:
> I'd appreciate some help with figuring out how to go about adding that
> locale to my site in simplest and sensible way.

The simplest way is to produce a translation for the 'pt' locale ;)

See this for information:

http://www.djangoproject.com/documentation/i18n/#how-to-create-language-files

You might also want to check on the django-i18n mailing list to see if
anyone else is working on a 'pt' translation, and coordinate efforts.
Once the translation is ready, you can begin using it, and if you like
you can open a ticket in the Django Trac for it to have it added to
the framework.

--
"May the forces of evil become confused on the way to your house."
-- George Carlin

Patrick J. Anderson

unread,
Jan 16, 2007, 5:22:31 PM1/16/07
to django...@googlegroups.com
James Bennett wrote:
>
> On 1/16/07, Patrick J. Anderson <pat.j.a...@gmail.com> wrote:
>> I'd appreciate some help with figuring out how to go about adding that
>> locale to my site in simplest and sensible way.
>
> The simplest way is to produce a translation for the 'pt' locale ;)
>
> See this for information:
>
> http://www.djangoproject.com/documentation/i18n/#how-to-create-language-files
>
>
> You might also want to check on the django-i18n mailing list to see if
> anyone else is working on a 'pt' translation, and coordinate efforts.
> Once the translation is ready, you can begin using it, and if you like
> you can open a ticket in the Django Trac for it to have it added to
> the framework.
>

Thanks, James! I would do it if I spoke Portuguese :) Unfortunately, I'm
just a developer with a requirement for Portuguese translations.

Maybe I should copy 'pt_br' locale to 'pt' and when I add this language
to my project, I'll ask translators to go through the Brazilian
Portuguese .po file and make it 'Portuguese'.

Nuno Mariz

unread,
Jan 17, 2007, 12:27:05 PM1/17/07
to Django users
Hi,
I'm portuguese and I'm going to translate django to pt-pt in this
month. Stay tune.

Nuno Mariz

Patrick J. Anderson

unread,
Jan 17, 2007, 12:38:57 PM1/17/07
to django...@googlegroups.com

That'd be great! Looking forward to it being included in the framework!

Nuno Mariz

unread,
Mar 16, 2007, 7:29:26 AM3/16/07
to Django users
You can download now the unofficial Portuguese(pt_PT) translation of
Django in http://mariz.org/downloads/

Reply all
Reply to author
Forward
0 new messages