Opened 7 years ago

Closed 7 years ago

#28434 closed Bug (needsinfo)

JavaScriptCatalog and JSONCatalog don't contain translatations from LOCALE_PATHS

Reported by: Stanislav Owned by: nobody
Component: Internationalization Version: 1.11
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

JavaScriptCatalog and JSONCatalog does not contains translate from locale\de\LC_MESSAGES\django.po or translate from locale\ru\LC_MESSAGES\django.po.

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'),
)

The command line

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

The command line

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/ru/jsi18n/,
http://127.0.0.1:8000/de/jsi18n/
http://127.0.0.1:8000/ru/jsoni18n/
http://127.0.0.1:8000/de/jsoni18n/
does not contains translate 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 asked about this problem in 3 forums, but no one could answer.
Full code here https://github.com/ctac22/django-translation/tree/master/myproject

Change History (2)

comment:1 by Tim Graham, 7 years ago

Summary: JavaScriptCatalog, JSONCatalog does not contains translate from LOCALE_PATHSJavaScriptCatalog and JSONCatalog don't contain translatations from LOCALE_PATHS

It looks like only translations from contrib.admin are present (and none of the other contrib apps). I don't have much usage experience with JavaScriptCatalog and can't tell if this is a bug or a usage mistake.

comment:2 by Claude Paroz, 7 years ago

Resolution: needsinfo
Status: newclosed

There is a specific test for that in the Django test suite. It may be the test is missing something, but you should explore that yourself and explain it if it's the case.

Note: See TracTickets for help on using tickets.
Back to Top