Sunday, August 13, 2017

JavaScriptCatalog: it's big or not?

Hi, 
JavaScriptCatalog and JSONCatalog don't contain translations from LOCALE_PATHS.


settings.py
LANGUAGE_CODE = 'en-us'
TIME_ZONE
= 'UTC'
USE_I18N
= True
USE_L10N
= True
USE_TZ
= True

LANGUAGES
= [
   
('en', _('English')),
   
('de', _('German')),
   
('ru', _('Russian')),
]
LOCALE_PATHS
= (
    os
.path.join(BASE_DIR, 'locale'),
)

urls.py
urlpatterns += i18n_patterns(
    url
(r'^jsi18n/$', JavaScriptCatalog.as_view(), name='javascript-catalog'),
    url
(r'^jsoni18n/$', JSONCatalog.as_view(), name='json-catalog'),
)

terminal
django-admin makemessages -l de
django
-admin makemessages -l ru

I'm added translation into locale\de\LC_MESSAGES\django.po, locale\ru\LC_MESSAGES\django.po

terminal
django-admin makemessages -d djangojs -l de
django
-admin makemessages -d djangojs -l ru
django
-admin compilemessages


But the response from the 
​http://127.0.0.1:8000/de/jsi18n/ 
​http://127.0.0.1:8000/ru/jsi18n/
​http://127.0.0.1:8000/ru/jsoni18n/
​http://127.0.0.1:8000/de/jsoni18n/
dont contain translations from LOCALE_PATHS. 
This urls contains tranlate only from
django\contrib\admin\locale\de\LC_MESSAGES\djangojs.po
django\contrib\admin\locale\ru\LC_MESSAGES\djangojs.po

I created a small case https://github.com/ctac22/django-localization

Can anyone explain me is it a bug or a usage mistake?


--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/3cd59b3a-4095-4327-8a6e-0cd658b1034d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment