Loading a po file containing the following msg string:
msgstr "You are leaving this page.\r\nContinue?"
and saving the translation back to file, the message string is changed to:
msgstr "You are leaving this page.\r\nContinue?"
which makes the line split into two sentences instead of writing back the original string.
This is problably due to a missing escape of the \ char.
In our case it is important to preserve the "\r\n" as a string of chars because it is used in a javascript alert which otherwise throw a javascript error.
The same behaviour occurs with \t and other encoded chars.
Loading a po file containing the following msg string: msgstr "You are leaving this page.\r\nContinue?"
and saving the translation back to file, the message string is changed to: msgstr "You are leaving this page.\r\nContinue?"
which makes the line split into two sentences instead of writing back the original string. This is problably due to a missing escape of the \ char.
In our case it is important to preserve the "\r\n" as a string of chars because it is used in a javascript alert which otherwise throw a javascript error.
The same behaviour occurs with \t and other encoded chars.
A fix could be change the function escape from:
to: