2

i need some help with a internationalization (I18N) issue for a website.

In trying to change the value of the language name of the I18N code, I have a select form with the languages so i change it, this is the code of the select:

<form action="/i18n/setlang/" method="post">
       {% csrf_token %}
         <input name="next" type="hidden" value="{{ redirect_to }}" />
              <select name="language" onchange="this.form.submit()">
                        {% get_language_info_list for LANGUAGES as languages %}
                        {% for language in languages %}
                        <option value="{{ language.code }}"{% if language.code == LANGUAGE_CODE %} selected="selected"{% endif %}>
                        {{ trans 'language.name_local|capfirst'  }}
                        </option>
                        {% endfor %}
               </select>
      </form>

This is the languages declaration in setting.py

ugettext = lambda s: s
LANGUAGES = (
('es', ugettext('Spanish')),
('en', ugettext('English')),
('eu', ugettext('Euskera')),

)

Euskera is the local language of the spanish state Basque country.

But in the select it shows the values: "Español","English","Basque" and I want it to show different values depending the current language.

If i want the website in Spanish it should show: "Español", "Ingles", "Euskera". If i want the website in English it should show: "Spanish", "English", "Basque" If i want the website in Spanish it should show: "Español", "Ingles", "Euskera"

I have three django.po files for each languaje and they translate other texts correctly.

If you have any idea, please share it.

Thank you.

Mikel
  • 141
  • 11
  • Why do that? Imagine you visit a website in spanish.. Would you find your language easier as "Inglés" rather than "English"? – Alvaro Feb 14 '14 at 18:58
  • Something is weird. It should be "Español","English","Euskera". Anyway, I think this is the correct behavior. Imagine you stumble on a Japanese site, you don't understand it, and want to switch to English. Would you recognize "English" written in Japanese characters? – Mihai Nita Apr 23 '14 at 06:00

0 Answers0