So I'm working on a django project and we're having English translated to Czech (not important). I can do fine with regular tags being translated with {% trans 'sample text' %}
However, I have a button inside a link and on click, this link returns a confirmation. The full html looks like this
<a href="{% url 'foo' %}" onclick="return confirm(
'Sample text')">
<button>
{% trans 'Regular trans tag' %}
</button>
</a>
Now I would like to somehow translate the 'Sample text' text inside the confirm, however when I try it with {% trans %}
it gives me error that 'foo/bar expected (js)'
Translate "Sample text" inside the JS:
Or there are other options, if you need all the languages to be available on the client at runtime. Do you need this?