Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Printing " with gettext

I want to output the translation of this string

By clicking on "Post"

Using gettext, how do I escape the quotation mark? Should I try \ "?

msgid "By clicking on"
msgstr ""
like image 227
Niklas Rosencrantz Avatar asked Dec 27 '22 02:12

Niklas Rosencrantz


1 Answers

Yes, you need to escape double quotes with a backslash (\").

The gettext manual says the following:

The two strings, untranslated and translated, are quoted in various ways in the PO file, using " delimiters and \ escapes

...

Each of untranslated-string and translated-string respects the C syntax for a character string, including the surrounding quotes and embedded backslashed escape sequences.

like image 63
Jörn Horstmann Avatar answered Mar 08 '23 08:03

Jörn Horstmann