Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

djangojs makemessage fails - djangojs.pot: No such file or directory

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?

like image 583
Saturnix Avatar asked May 19 '14 23:05

Saturnix


1 Answers

This obscure error message basically means that makemessages found nothing to translate.

like image 56
alex vasi Avatar answered Oct 03 '22 07:10

alex vasi