New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use placeholders for URLs in translation strings #6507
Conversation
core-bundle/src/Resources/views/Error/invalid_request_token.html.twig
Outdated
Show resolved
Hide resolved
cfe309d
to
7e89106
Compare
On second thought, passing the replacement strings to the @contao/developers What do you think? Do we care? |
I don't understand the issue. You want to translate a string, this always ties it to a translator? And what do you mean by "default Twig parser"? |
The template is part of |
Ok, then I will merge this as soon as it has been approved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM but I think we should still ask @m-vo for a review just because it's affecting Twig and I don't want to interfere with his plans here.
Agreed, although none of these templates are related to his work. This is Contao 4.13 after all. 😄 |
Changes look good to me. There is one thing we could think about, though: With HTML in the translated strings, we need to bypass the escaper ( <trans-unit id="XPT.tokenExplainTwo">
<source>Learn more about speeding up your workflow by using {{link_open::%s::blank}}keyboard shortcuts{{link_close}}.</source>
</trans-unit> <p>{{ 'XPT.tokenExplainTwo'|trans(['https://to.contao.org/support'])|insert_tag_raw }}</p> Wdyt? |
I don’t like the idea of using insert tags, especially things like I think the “correct” solution would be that the link comes from the templates like this (pseudocode): <trans-unit id="message">
<source>Learn more about speeding up your workflow by using [keyboard shortcuts].</source>
</trans-unit> {{ 'message'|trans({'[' => '<a href="…">', ']' => '</a>'}) }} Not sure if this can be implemented in a way so that the message still gets encoded correctly. But for now I think we can keep it as it is. |
So that we can change the URLs without creating unnecessary work for the translators. See contao/to.contao.org#80 for more information.