You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
by add this <script type="text/javascript" src="{% url 'django.views.i18n.javascript_catalog' %}"></script>, I can call gettext in my jsx file. However, the render server will not know what gettext is.
Is there any solution for this situation ?
The text was updated successfully, but these errors were encountered:
You'll need a way to pass that data to the renderer.
I'm not too familiar with internationalisation in django, but I assume you can interrogate the request for a lang and then dump all the data used for gettext, so you can pass it to renderer. If you're not too familiar with how to implement the interrogation, I'd recommend looking at the implementation details for django.views.i18n.javascript_catalog.
Note that once you're handling data like this, you'll probably need different entry points for your code so that you can handle the different contexts. It's a bit of a pain sometimes, but it does have the benefit that your system will end up less coupled to django's front-end.
how to resolve the problem gettext is not defined.
an example base template file
by add this
<script type="text/javascript" src="{% url 'django.views.i18n.javascript_catalog' %}"></script>
, I can callgettext
in my jsx file. However, the render server will not know whatgettext
is.Is there any solution for this situation ?
The text was updated successfully, but these errors were encountered: