3

Why is django.contrib.admin in English even though I set LANGUAGE_CODE = 'pl' in the settings?

LANGUAGE_CODE = 'pl'

TIME_ZONE = 'Europe/Warsaw'

USE_I18N = True

USE_L10N = True

USE_TZ = False

LANGUAGES = (
    ('en', _('English')),
    ('pl', _('Polish')),
)

Deleting ('en', _('English')), from LANGUAGES helps but I need it from django-rosetta.

Thank you.

Sebastian Wozny
  • 16,943
  • 7
  • 52
  • 69
aabb
  • 69
  • 2
  • 6
  • Have you updated your `urls.py`? – Wtower Jun 03 '15 at 13:38
  • 3
    possible duplicate of [Change locale for django-admin-tools](http://stackoverflow.com/questions/11177330/change-locale-for-django-admin-tools) – eykanal Jun 03 '15 at 13:38
  • I dont think this is a duplicate, when i delete LANGUAGES = ( ('en', _('English')), ('pl', _('Polish')), ) django admin is translated to polish – aabb Jun 03 '15 at 14:16
  • This might help: http://stackoverflow.com/questions/21469470/how-can-i-change-django-admin-language – chandu Jun 03 '15 at 14:18
  • http://stackoverflow.com/questions/11177330/change-locale-for-django-admin-tools – chandu Jun 03 '15 at 14:19

2 Answers2

3

This function can be used in your root URLconf and Django will automatically prepend the current active language code to all url patterns defined within i18n_patterns()

  urlpatterns += i18n_patterns('',
    url(r'^admin/', include(admin.site.urls)),
)

Source: How can I change Django admin language?

Community
  • 1
  • 1
chandu
  • 1,053
  • 9
  • 18
  • okay but why i get redirected to http://localhost:8000/en/admin/ even though I set LANGUAGE_CODE = 'pl' in settings? – aabb Jun 03 '15 at 14:30
  • user logged in django admin needs to see it in polish by default – aabb Jun 03 '15 at 14:31
  • Have you gone through the above mentioned links.Y not you create a language drop down http://stackoverflow.com/questions/11177330/change-locale-for-django-admin-tools(if required) – chandu Jun 03 '15 at 14:32
  • I dont think you get it, it maybe because of my bad english. Ive gone through all the links above but none solves my problem. I dont want drop down to choose between polish and english in django admin. It just needs to be in polish by default. – aabb Jun 03 '15 at 14:39
  • 2
    I tested by changing the language to LANGUAGE_CODE = 'ru-RU'.And django admin panel by default converted into russian.And did the same for polish language too LANGUAGE_CODE = 'pl'.It works fine. – chandu Jun 04 '15 at 05:56
1

Simply add this in your settings file.I tested it and works fine.

 LANGUAGE_CODE = 'pl'

When user logged in django admin needs it shows polish by default.Some words are shown in english. Still problem is not solved share the screen shot of the django admin.

chandu
  • 1,053
  • 9
  • 18