Open MartinBoge opened 1 week ago
Hi Martin, it sounds like a bug that should be fixed.
@JuroOravec Mind helping me understand what the right syntax should be here? tooltip_text="{% trans "Responsible..." %}"
?
@MartinBoge Do you have access to the full stack trace? Could you post it here?
Btw, @MartinBoge, so if you omit the single apostrophe, then you are able to pass the text like so?
{% component "card_header" tooltip_text=_("Responsible for the organisations data protection compliance") / %}
I haven't worked with Django's translation / internationalisation features, so personally I never tried passing the key=_("some text")
syntax through components. I wonder if that has something to do with it?
@MartinBoge could you check which of the following syntaxes work correctly? The one you mentioned above is case 7. below. I expect that cases 1-4 SHOULD work, but no idea how 5-8 behave.
Without _()
, without single apostrophe, self-closing:
{% component "card_header" tooltip_text="organisations" / %}
Without _()
, without single apostrophe, end-tag:
{% component "card_header" tooltip_text="organisations" %} {% endcomponent %}
Without _()
, with single apostrophe, self-closing:
{% component "card_header" tooltip_text="organisation's" / %}
Without _()
, with single apostrophe, end-tag:
{% component "card_header" tooltip_text="organisation's" %} {% endcomponent %}
With _()
, without single apostrophe, self-closing:
{% component "card_header" tooltip_text=_("organisations") / %}
With _()
, without single apostrophe, end-tag:
{% component "card_header" tooltip_text=_("organisations") %} {% endcomponent %}
With _()
, with single apostrophe, self-closing:
{% component "card_header" tooltip_text=_("organisation's") / %}
With _()
, with single apostrophe, end-tag:
{% component "card_header" tooltip_text=_("organisation's") %} {% endcomponent %}
I'll be able to have a look at this towards the end of this week :)
Hi Emil
First off - thank you very much for this sweet sweet library. If this issue is redundant or you find it irrelevant just go ahead and close it.
I currently have a card header component that i want to use like so:
But i get the following error:
The workaround for me right is to let the tag be self-closing via the
/ %}
syntax and then it works.I have narrowed down the cause to being that i have an apostrophe ( ' ) in my text and causes and issue when the template is being parsed. That means i do NOT get the error if i:
And also note that with or without translation the bug remains.
Is this a known issue?