3
我正在一个项目中使用React js作为前端,Django作为后端。我需要实现i18n国际化和本地化 我看到了Django文档并碰到了django I18n javascript_catalog。 如何在React JS中使用getText()。有没有其他的方式来实现?i18n React Django的国际化和本地化
由于提前
我正在一个项目中使用React js作为前端,Django作为后端。我需要实现i18n国际化和本地化 我看到了Django文档并碰到了django I18n javascript_catalog。 如何在React JS中使用getText()。有没有其他的方式来实现?i18n React Django的国际化和本地化
由于提前
使用下面的代码项目的urls.py
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),
添加下面一行到你的基地HTML文件
<script type="text/javascript" src="/jsi18n/"></script>