27
I am building a json object in jinja file:
object_name = {
property_name: "{{ _("Some Text which might have "quotes" in it") }}"
}
And then import the above jinja2 file in a script tag
note: _("Text") is used to be replaced by a translation text, so the text in the () will be replaced with text of another language so i can not predict if the translation will contain double quotes
any idea how to escape the incoming quotes and convert them to for example "
Edited
The solution:
The solution to this problem for us was by making python go through all the translations and escape all qoutations. but we always have to make sure at least the english text not to be problematic and anyway we have controll over this.... so far :)
Look at this document aswell
http://pology.nedohodnik.net/doc/user/en_US/ch-poformat.html#sec-poescapes