Unescaped HTML in translation text
See original GitHub issueThese translated strings contain unescaped HTML which makes the translation linter unhappy.
[user-scalable="no"]
is not used in the<meta name="viewport">
element and the[maximum-scale]
attribute is not less than 5.- The document does not use
<meta http-equiv="refresh">
[user-scalable="no"]
is used in the<meta name="viewport">
element or the[maximum-scale]
attribute is less than 5.<input type="image">
elements have[alt]
text- The document uses
<meta http-equiv="refresh">
<input type="image">
elements do not have[alt]
text
Issue Analytics
- State:
- Created 5 years ago
- Comments:15 (12 by maintainers)
Top Results From Across the Web
HTML tags in i18next translation - Stack Overflow
Show activity on this post. I'm using i18next to power i18n for my weblog. It works great on text-only content, but when I...
Read more >HTML in translations - Loco
The short answer is "you just type the code into the editor". Loco Translate doesn't care whether your translation is HTML or plain...
Read more >Three ways to use HTML in your Rails translations - LingoHub
When a translation title ends with "_html", Rails assumes that the text contains HTML and you don't want to escape it.
Read more >Free Online HTML Escape / Unescape Tool - FreeFormatter.com
A free online tool to escape or unescape HTML documents and files.
Read more >esc_html_e() | Function - WordPress Developer Resources
Displays translated text that has been escaped for safe use in HTML output.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think I see what you’re proposing now with the change in https://github.com/GoogleChrome/lighthouse/pull/9114/commits/74e11c15bf7c7149a5863ae85b0e3a8b1dcebea8#diff-0b037964dfdf09e1e312fb06ffb7f8bcR28
If real ICU replacements are always inside google placeholders, it seems like it takes care of many issues:
We will have to figure out how the placeholder
example
will work in a way that’s useful for translators, but I can see you’re looking at that 😃I think to me, the advantage of the objects is that we are closer to a chrome standard format for i18n and that it allows simple placeholder syntax. It isn’t strictly required, we can hack together our own replacement conversion and have the strings be processed into this format right before going into en-US, but I think that would be messier (see “2.”).
I think that our strings have gotten sufficiently complex that we should start to think about encapsulating these as objects and converging on this
messages.json
syntax. We already have messages, descriptions, replacements, ICU, non-translated static blocks, markdown control syntax; honestly, I think that this could use some more structure, esp if we start to follow the placeholder rules better and stop sending non-translated text through.Specific answers to your questions:
detection -> conversion->translation->re-add
type deal. But this is exactly what themessage.json
syntax was made for, and is already a solved problem, and I think that it will be easier to maintain this moving forward if we get closer to the standard, not farther away.