Topic: Double escape of slash in translatable js strings

In the file sales/sales_order_entry, line 762 to 765:

        if ($_SESSION['Items']->trans_type==ST_SALESORDER)
            submit_js_confirm('CancelOrder', _('You are about to cancel undelivered part of this order.\nDo you want to continue?'));
        else
            submit_js_confirm('CancelOrder', _('You are about to void this Document.\nDo you want to continue?'));

the "\n" in the translatable strings are listed as "\\n" in the lang/new_language_template/LC_MESSAGES/empty.po file and in the translation .po files.

Is this intentional?

The code however mitigates this using functions that replace them in files in the includes/ui/ folder:

Line 677 in ui_controls.inc: $msg ? '\''.strtr($msg, array("\n"=>'\\n')) . '\';' : 'null;');
Line 484 in gettext.inc: $this->_current_value = str_replace('\\n', "\n", $this->_current_value);
Line 276 in ui_input.inc: . strtr($msg, array("\n"=>'\\n')) . "');};"
Post's attachments

empty_po_double_escape.png 5.7 kb, file has never been downloaded. 

You don't have the permssions to download the attachments of this post.

Re: Double escape of slash in translatable js strings

@joe?

Re: Double escape of slash in translatable js strings

Thanks @joe for the commit.