Django module to implement i18n translations support for angularJS applications. Work together with angular module ng-django-translate
-
pip install git+https://github.com/magnitronus/djangular-translate.git
-
Add 'ngtranslate' to INSTALLED_APPS in settings.py:
INSTALLED_APPS = (... 'ngtranslate', ... )
-
Define LOCALE_PATHS in settings.py:
LOCALE_PATHS = ( os.path.join(BASE_DIR, '../locale'), )
-
Add path to ngtranslate to your urlpatterns in urls.py:
urlpatterns = [ ... url(r'^i18n/', include('ngtranslate.urls')), ... ]
Ngtranslate overrides native django management "makemessages" command. For making messages from angular directives, your angular static templates must be placed in django templates folder (you can use symbolic links for this). For make messages try use "djangular" domain:
python manage.py makemessages -d djangular -s -l <your_locale>