Questions tagged [django-i18n]

Django internationalization provides developers with the ability to build web applications and provide content in multiple languages and locales.

Django internationalization provides developers with the ability to build web applications and provide content in multiple languages and locales.

For text translations, the Django developer can accomplish this goal by adding a minimal amount of hooks to Python and templates. These hooks are called translation strings. They tell Django: “This text should be translated into the end user’s language, if a translation for this text is available in that language.”

Internationalization is achieved in three steps:

  1. Embed translation strings in your Python code and templates.
  2. Get translations for those strings, in whichever languages you want to support.
  3. Activate the locale middleware in your Django settings.
359 questions
0
votes
0 answers

What localization files django use in current request?

I'm trying to debug my Django localization, and can't find out why one of my language file doesn't work. Other languages from this location are working fine. LANGUAGES = ( ('ru', u'Русский'), ('en', u'English'), ('uk', u'Українська'), )…
inlanger
  • 2,904
  • 4
  • 18
  • 30
0
votes
1 answer

Django, change language while redirecting

I have set up my Django app to support various languages. POST /i18n/setlang/ works and changes the language from the drop down menu.
{% csrf_token %}
xpanta
  • 8,124
  • 15
  • 60
  • 104
0
votes
1 answer

Django i18n routing doesn't work properly

I have a problem with Django i18n routing. I want to set language in URL but doesn't work. I created urls.py in project, and in app another urls.py. The code looks like this: personal/urls.py from django.conf.urls import patterns, include, url from…
Asier
  • 11
  • 2
0
votes
1 answer

Translate url regex pattern for django internationalization

I am trying to set up a multi-language django site, I have added the languages I need in my settings file and translated everything in my django.po file. I added the locale middleware and language blocks to my urls and they display correctly when I…
Ruben Quinones
  • 2,442
  • 8
  • 26
  • 30
0
votes
1 answer

Django translation i18n thread

I have the following problem regarding translation using the i18n. My application have the foolowing structure: apps\ app1\ app2\ ... app_n\ manage.py settings.py And two langs: lang1 (default), and lang2. In the app2 I have the following…
Sergiu
  • 297
  • 3
  • 16
0
votes
0 answers

Some of translated strings in django i18n are ignored

I have django app which uses i18n. Everything works fine except few string. Example: I have form with code: tos_accept = forms.BooleanField(label=u'%s %s'%(_('I accept'),_('ToS')),error_messages={'required':_('Acceptance…
dease
  • 2,975
  • 13
  • 39
  • 75
0
votes
1 answer

How to add new locale at runtime in Django?

I have situation when i have two types of locales. First needed for website and second need for creating reports. Second type of locales added dynamically so it cant be set in settings. Im interesting is there possibility to add new locales at…
Andrey Nikishaev
  • 3,759
  • 5
  • 40
  • 55
0
votes
1 answer

Django load LANGUAGES parameter from the database

I would like to set my LANGUAGES variable dynamically by loading the values from the database. Let's say i have a table like this COLUMN_NAME ----------- id name identifier active and i would like to define these languages: LANGUAGES = ( ('en',…
Maxim
  • 3,836
  • 6
  • 42
  • 64
0
votes
0 answers

Django internationalization not working

My django is not executing translations that i define in my *.po files. I have my setup like this: MainFolder: locale en LC_MESSAGES django.po django.mo de LC_MESSAGES django.po django.mo app1 …
Maxim
  • 3,836
  • 6
  • 42
  • 64
0
votes
1 answer

Django i18n uses it's own translations

I have created a .po file for pl locale and translated all the strings. Everything works allright except for "Log in" string. I translated "Log in" into "Zaloguj" but in HTML it appears as "Zaloguj się" though such translation doesn't even appear in…
Michał Tabor
  • 2,441
  • 5
  • 23
  • 30
0
votes
2 answers

Does not update translations in rosetta for Django

I have some translations in rosetta and it have worked. Now I need to update some of those trasnlations. I have done it in rosetta adminstrator and checked it in .po file, and are ok. Now, I compile the .po file, django-admin.py compilemessages -l…
Java Developer
  • 172
  • 1
  • 2
  • 10
0
votes
1 answer

Internationalization not working properly - No action seems to be happening

I configured my setting.py as show below: LANGUAGE_CODE = 'pt-br' USE_I18N = True LANGUAGES = ( ('pt_br', ('Portugues Brasileiro')), ('en_us', ('English')) ) MIDDLEWARE_CLASSES = ( ... 'django.middleware.locale.LocaleMiddleware', …
Lucas Rezende
  • 2,516
  • 8
  • 25
  • 34
0
votes
1 answer

Django LocaleMiddleware does not add slash with APPEND_SLASH enabled

I've encountered a problem using LocaleMiddleware in django 1.6. It does not add extra slash event if settings.APPEND_SLASH is set to True. The text error text is: Request Method: GET Request URL: http://pollina.ru/ua/add Django Version: …
1099511627776
  • 176
  • 1
  • 18
0
votes
1 answer

Not Able to create django.po

I am new to django web app, my project structure looks like: x ->x ->settings.py in settings.py I have following entry: from django.utils.translation import ugettext_lazy as _ LOCALE_PATHS = ( join (BASE_DIR, 'locale'), ) MIDDLEWARE_CLASSES =…
Jayaram
  • 1,715
  • 18
  • 30
0
votes
0 answers

App name is not translated

Can't figure out why my app is not translated. Here is the what I have in django.po file: #: products/__init__.py:4 msgid "Products" msgstr "Продукты" And I've put this into app's __init__ file: from django.utils.translation import ugettext_lazy as…
Dmitrii Mikhailov
  • 5,053
  • 7
  • 43
  • 69
1 2 3
23
24