python - Django Default language not working -
i have django app supports 2 languages english , arabic need change default language arabic
language_code = 'ar' languages = ( (u'ar', _('arabic')), (u'en', _('english')), ) use_i18n = true use_l10n = true use_tz = false
but when open 127.0.0.1:8000 redirects english 127.0.0.1:8000/en not arabic
url.py include
urlpatterns = patterns( '', url(r'^i18n/', include('django.conf.urls.i18n')), )
any suggestions ?
try checking middleware_classes django.middleware.locale.localemiddleware. more on implementing available url: https://docs.djangoproject.com/en/1.8/topics/i18n/translation/#how-django-discovers-language-preference
i hope useful.
source: https://docs.djangoproject.com/en/1.8/topics/i18n/translation/
Comments
Post a Comment