I18n Internationalization and Localization in Django Action
I am working on a project where I am using React js for the Front-End and Django for the backend. I need to implement i18n Internationalization and Localization I saw the Django documentation and came across jjbjdjcjdjjjjjdjo. How can I use the same with getText () in React JS ?. Is there any other way to implement ?.
Thanks in Advance
+3
source to share
1 answer
Use below code in urls.py of project
from django.views.i18n import javascript_catalog
js_info_dict = {
'domain': 'djangojs',
'packages': ('name',)
}
urlpatterns += i18n_patterns(
url(r'^jsi18n/$', javascript_catalog, js_info_dict),
Add below line to your base html file
<script type="text/javascript" src="/jsi18n/"></script>
+1
source to share