Closed kdidenko closed 7 years ago
Why don't you use UTF-8 files ? And do what you said: #{__("— or —")}
@gjuchault Can you give more details on how I can use HTML in my json files ? I understand the UTF-8 files format, but how can I achieve this? Is there a config in i18n-2?
@SamBellerose You can use UTF-8 files directly and avoid thinking about encoding and HTML chars. Let's say you want the mdash character (—). Instead of
{ "foo": "—" }
Use
{ "foo": "—" }
When using HTML character entities they are not displayed properly. For example:
#{__("— or —")}
is translated to:— or —
Is there any way to escape
&
so it will be converted to&
? Then everything should work fine. It is very strange that only&
is converted since when I'm using#{__("— or —")}
the—
entity is not converted to—
and is rendered in html as is.