Skip to content

How do you want to handle links in translations #54

Answered by kevinpapst
cavasinf asked this question in Q&A
Discussion options

You must be logged in to vote

I don't like any of these options (but 1 & 2 definitely not).

Why not

{{ 'foo %link%'|trans({ '%link%': '<a href="https://.../discussions/54">' ~ ('Test'|trans) ~ '</a>' }, 'messages')|raw }}

?
Another option is to rephrase your translation and simply append the URL to the end of the translation.

{{ 'foo %link%'|trans }}: <a href="https://github.com/kevinpapst/TablerBundle/discussions/54">Test</a>

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@cavasinf
Comment options

cavasinf Jan 11, 2022
Collaborator Author

@kevinpapst
Comment options

@cavasinf
Comment options

cavasinf Jan 12, 2022
Collaborator Author

@kevinpapst
Comment options

Answer selected by cavasinf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants