I'm trying to run this command django-admin.py makemessages -d djangojs -l en
with no avail. I already tried what is told here: Unable to generate django javascript i18n catalog
I'm currently running gettext version 0.18.3
urls.py
from django.conf.urls import patterns, include, url
from django.views.i18n import javascript_catalog
from django.contrib import admin
js_info_dict = {
'packages': ('MyApp',),
}
admin.autodiscover()
urlpatterns = patterns('',
url(r'^admin/', include(admin.site.urls)),
url(r'^$', 'MyApp.views.test'),
url(r'^jsi18n/$', javascript_catalog, js_info_dict),
)
Relevant settings
LOCALE_PATHS = (
'/Users/Saturnix/PycharmProjects/TranslationTest/MyApp/locale',
)
TEMPLATE_DIRS = (
'/Users/Saturnix/PycharmProjects/TranslationTest/templates/',
)
(I've also tried to put the template folder inside of MyApp and adjust the settings accordingly: same result).
views.py
def test(request):
return render_to_response("test.html", locals())
test.html (in templates folder)
... some html ...
{% trans 'HELLO_STRING_TEMPLATE' %}
... some javascript ...
document.write(gettext('HELLO_STRING_JS'));
As I run django-admin.py makemessages -d djangojs -l en
I get
CommandError: errors happened while running msguniq
msguniq: error during the reading of "/Users/Saturnix/PycharmProjects/TranslationTest/MyApp/locale/djangojs.pot": No such file or directory
What should I do?
This obscure error message basically means that makemessages
found nothing to translate.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With