I am developing an add-on in Firefox 83 and I am wondering how we should use non-breaking spaces in the
First of all, two requirements:
- As the docs always recommend, I use no HTML, but
.textContentfor inserting the text.
- I want to make it translatable, so I use the
- Also, the literal
_ _is probably not good, because it is not readable and translators could overlook that this is a “special” space. So I want to show it somehow.
I have this text:
Awesome Emoji Picker
What I’ve tried:
– obviously does not work, because I need an HTML-less version
messages.jsonand then the JSON was broken and I thought I had to escape this. After all, writing
\Ain a translation also just returns
\\u00a0surprisingly, however, kept the backslash when doing a
browser.i18n.getMessage, which broke it again.
And yes I could of course workaround by using a replacement character (and doing a replace afterwards), but I wonder why this does not work…