django / django-localflavor

Country-specific Django helpers, formerly of contrib fame
https://django-localflavor.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
833 stars 292 forks source link

Javascript Support? #498

Open chrisspen opened 1 year ago

chrisspen commented 1 year ago

Is there any way to use localflavor's translations from Javascript?

If I setup the jsi18n include, per the docs like:

urlpatterns += i18n_patterns(
    path("jsi18n/", JavaScriptCatalog.as_view(), name="javascript-catalog"),
)

and then include it in my base template like:

<script type="text/javascript" src="{% url 'javascript-catalog' %}"></script>

none of localflavor's translations are included in the autogenerated i18n Javascript include.

This is intentional or am I not using the correct URL pattern?