panchicore
panchicore

Reputation: 11932

LANGUAGE_CODE with dashes does not work: "es-mx, es-es, es-ar" but "es" does

in settings.py LANGUAGE_CODE = 'es-mx' or LANGUAGE_CODE = 'es-ar' does not work, but LANGUAGE_CODE = 'es' or LANGUAGE_CODE = 'mk' works OK when rendering the templates, I18N is active en the project settings and this is how .mo and .po looks like:

enter image description here

and this is the i18n context processor information:

{'LANGUAGES': (('ar', 'Arabic'), ('az', 'Azerbaijani'), ('bg', 'Bulgarian'), ('bn', 'Bengali'), ('bs', 'Bosnian'), ('ca', 'Catalan'), ('cs', 'Czech'), ('cy', 'Welsh'), ('da', 'Danish'), ('de', 'German'), ('el', 'Greek'), ('en', 'English'), ('en-gb', 'British English'), ('es', 'Spanish'), ('es-ar', 'Argentinian Spanish'), ('es-mx', 'Mexican Spanish'), ('es-ni', 'Nicaraguan Spanish'), ('et', 'Estonian'), ('eu', 'Basque'), ('fa', 'Persian'), ('fi', 'Finnish'), ('fr', 'French'), ('fy-nl', 'Frisian'), ('ga', 'Irish'), ('gl', 'Galician'), ('he', 'Hebrew'), ('hi', 'Hindi'), ('hr', 'Croatian'), ('hu', 'Hungarian'), ('id', 'Indonesian'), ('is', 'Icelandic'), ('it', 'Italian'), ('ja', 'Japanese'), ('ka', 'Georgian'), ('km', 'Khmer'), ('kn', 'Kannada'), ('ko', 'Korean'), ('lt', 'Lithuanian'), ('lv', 'Latvian'), ('mk', 'Macedonian'), ('ml', 'Malayalam'), ('mn', 'Mongolian'), ('nl', 'Dutch'), ('no', 'Norwegian'), ('nb', 'Norwegian Bokmal'), ('nn', 'Norwegian Nynorsk'), ('pa', 'Punjabi'), ('pl', 'Polish'), ('pt', 'Portuguese'), ('pt-br', 'Brazilian Portuguese'), ('ro', 'Romanian'), ('ru', 'Russian'), ('sk', 'Slovak'), ('sl', 'Slovenian'), ('sq', 'Albanian'), ('sr', 'Serbian'), ('sr-latn', 'Serbian Latin'), ('sv', 'Swedish'), ('ta', 'Tamil'), ('te', 'Telugu'), ('th', 'Thai'), ('tr', 'Turkish'), ('uk', 'Ukrainian'), ('ur', 'Urdu'), ('vi', 'Vietnamese'), ('zh-cn', 'Simplified Chinese'), ('zh-tw', 'Traditional Chinese')), 'LANGUAGE_BIDI': False, 'LANGUAGE_CODE': 'es-ar'}

According django-i18n-docs "es-mx" and "es-ar" are standard lang format.

Am I missing something here? thanks in advace.

Upvotes: 4

Views: 9697

Answers (2)

Guillaume Cisco
Guillaume Cisco

Reputation: 2945

The documentation linked in the settings.py file for django 1.3.1 redirect to : http://www.i18nguy.com/unicode/language-identifiers.html

Maybe try to use es-AR

I had the same problem for fr-FR.

Hope it helps you.

Upvotes: 3

panchicore
panchicore

Reputation: 11932

I looked in the django repository how the framework is handling the locale forder structure and I found the solution (see the folders name):

enter image description here

Thanks for viewing.

Upvotes: 6

Related Questions