<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[FrontAccounting forum — Double escape of slash in translatable js strings]]></title>
	<link rel="self" href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=6842&amp;type=atom" />
	<updated>2017-06-28T17:56:20Z</updated>
	<generator>PunBB</generator>
	<id>https://frontaccounting.com/punbb/viewtopic.php?id=6842</id>
		<entry>
			<title type="html"><![CDATA[Re: Double escape of slash in translatable js strings]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=28065#p28065" />
			<content type="html"><![CDATA[<p>Thanks @joe for the <a href="https://github.com/FrontAccountingERP/FA/commit/c389dc1204205da3235907b9db3ab4aaf246719b">commit</a>.</p>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2017-06-28T17:56:20Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=28065#p28065</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Double escape of slash in translatable js strings]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=28061#p28061" />
			<content type="html"><![CDATA[<p>@joe?</p>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2017-06-26T14:23:08Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=28061#p28061</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Double escape of slash in translatable js strings]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=28056#p28056" />
			<content type="html"><![CDATA[<p>In the file <strong>sales/sales_order_entry</strong>, line 762 to 765:<br /></p><div class="codebox"><pre><code>        if ($_SESSION[&#039;Items&#039;]-&gt;trans_type==ST_SALESORDER)
            submit_js_confirm(&#039;CancelOrder&#039;, _(&#039;You are about to cancel undelivered part of this order.\nDo you want to continue?&#039;));
        else
            submit_js_confirm(&#039;CancelOrder&#039;, _(&#039;You are about to void this Document.\nDo you want to continue?&#039;));</code></pre></div><p>the &quot;<strong>\n</strong>&quot; in the translatable strings are listed as &quot;<strong>\\n</strong>&quot; in the <strong>lang/new_language_template/LC_MESSAGES/empty.po</strong> file and in the translation .po files. </p><p>Is this intentional?</p><p>The code however mitigates this using functions that replace them in files in the <strong>includes/ui/</strong> folder:<br /></p><div class="codebox"><pre><code>Line 677 in ui_controls.inc: $msg ? &#039;\&#039;&#039;.strtr($msg, array(&quot;\n&quot;=&gt;&#039;\\n&#039;)) . &#039;\&#039;;&#039; : &#039;null;&#039;);
Line 484 in gettext.inc: $this-&gt;_current_value = str_replace(&#039;\\n&#039;, &quot;\n&quot;, $this-&gt;_current_value);
Line 276 in ui_input.inc: . strtr($msg, array(&quot;\n&quot;=&gt;&#039;\\n&#039;)) . &quot;&#039;);};&quot;</code></pre></div>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2017-06-23T11:28:28Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=28056#p28056</id>
		</entry>
</feed>
