angular-gettext does not work for escaped double quots

230 views Asked by At

We are using angular-gettext in our project and it's amazing tool, but there is one case I'm just frustrating on. In one template I have input with placeholder which also should be translated. For all the other placeholders it work like a charm, but this one contains double quotes:

<input placeholder='{{"Some text with \"quotes\"" | translate}}'>

and it doesn't work. angular-gettext can't translate it. That was, actually, hard to just add this string as placeholder, because html parser doesn't accept quotes as &quot; or if swap double quotes with single quotes.

So, is there any solution/workaround for that?

1

There are 1 answers

0
fisharebest On

Source text is traditionally written in en_US, and should therefore contain en_US punctuation. This includes quotation marks.

<input placeholder='{{"Some text with “quotes”" | translate}}'>

Your translators will substitute their own localised quotation marks.

du texte avec « guillemets »