diff --git a/accounts_app/templates/accounts/login.html b/accounts_app/templates/accounts/login.html index 5eb46c4..8555d35 100644 --- a/accounts_app/templates/accounts/login.html +++ b/accounts_app/templates/accounts/login.html @@ -1,5 +1,5 @@ {% load i18n %} - + {% trans 'Auth' %} diff --git a/clientsideapp/templates/clientsideapp/ext.html b/clientsideapp/templates/clientsideapp/ext.html index 65e236c..fe10a31 100644 --- a/clientsideapp/templates/clientsideapp/ext.html +++ b/clientsideapp/templates/clientsideapp/ext.html @@ -1,5 +1,5 @@ {% load globaltags %}{% load i18n %} - + diff --git a/djing/settings.py b/djing/settings.py index 32c00b7..90dd784 100644 --- a/djing/settings.py +++ b/djing/settings.py @@ -62,6 +62,7 @@ INSTALLED_APPS = [ MIDDLEWARE = [ 'django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', + 'django.middleware.locale.LocaleMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', @@ -83,6 +84,7 @@ TEMPLATES = [ 'django.template.context_processors.request', 'django.contrib.auth.context_processors.auth', 'django.contrib.messages.context_processors.messages', + 'django.template.context_processors.i18n', 'taskapp.context_proc.get_active_tasks_count', 'msg_app.context_processors.get_new_messages_count' ], @@ -125,7 +127,7 @@ SESSION_COOKIE_HTTPONLY = True # Internationalization # https://docs.djangoproject.com/en/1.11/topics/i18n/ -LANGUAGE_CODE = 'ru-RU' +LANGUAGE_CODE = 'ru' LANGUAGES = [ ('ru', _('Russian')), diff --git a/djing/urls.py b/djing/urls.py index 9b0d66c..ca62106 100644 --- a/djing/urls.py +++ b/djing/urls.py @@ -18,6 +18,10 @@ urlpatterns = [ url(r'^msg/', include('msg_app.urls', namespace='msg_app')), url(r'^dialing/', include('dialing_app.urls', namespace='dialapp')), url(r'^groups/', include('group_app.urls', namespace='group_app')), + + # Switch language + url(r'^i18n/', include('django.conf.urls.i18n')), + # url(r'^admin/', admin.site.urls) ] diff --git a/locale/ru/LC_MESSAGES/django.po b/locale/ru/LC_MESSAGES/django.po index 330cab6..f9f8301 100644 --- a/locale/ru/LC_MESSAGES/django.po +++ b/locale/ru/LC_MESSAGES/django.po @@ -107,3 +107,6 @@ msgstr "Звонки" #: templates/base.html:85 msgid "Devices" msgstr "Устройства" + +msgid "Language" +msgstr "Язык" diff --git a/mapapp/templates/maps/ya_index.html b/mapapp/templates/maps/ya_index.html index 916a66a..2043655 100644 --- a/mapapp/templates/maps/ya_index.html +++ b/mapapp/templates/maps/ya_index.html @@ -1,6 +1,6 @@ {% extends 'base_no_lmenu.html' %}{% load i18n %} {% block main %} - +