<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[FrontAccounting forum — Small bug for gettext translations - locations.php]]></title>
	<link rel="self" href="https://frontaccounting.com/punbb/extern.php?action=feed&amp;tid=7083&amp;type=atom" />
	<updated>2017-10-31T21:58:21Z</updated>
	<generator>PunBB</generator>
	<id>https://frontaccounting.com/punbb/viewtopic.php?id=7083</id>
		<entry>
			<title type="html"><![CDATA[Re: Small bug for gettext translations - locations.php]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=29383#p29383" />
			<content type="html"><![CDATA[<p>@apmuthu I&#039;ve finally understood what you were saying..you&#039;re right. My apologies for any confusion.</p>]]></content>
			<author>
				<name><![CDATA[poncho1234]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=19944</uri>
			</author>
			<updated>2017-10-31T21:58:21Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=29383#p29383</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Small bug for gettext translations - locations.php]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=29378#p29378" />
			<content type="html"><![CDATA[<p>apmuthu, as previously stated the exact string &#039;Inventory Locations&#039; exists in the po file with its translation.</p><p>the exact string &#039;Fixed Assets Locations&#039; does not exist in the po file therefore would not be translated anyway.</p><p>I am unable to attach screenshots</p>]]></content>
			<author>
				<name><![CDATA[poncho1234]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=19944</uri>
			</author>
			<updated>2017-10-31T16:36:23Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=29378#p29378</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Small bug for gettext translations - locations.php]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=29372#p29372" />
			<content type="html"><![CDATA[<p>apmuthu, there is a bug in locations.php, please load another language go to:-</p><p>/inventory/manage/locations.php?<br />And you will see that the page title &#039;Inventory Locations&#039; has not been translated</p><p>then go to:-<br />/inventory/manage/locations.php?FixedAsset=1<br />And you will see that the page title &#039;Fixed Assets Locations&#039; has not been translated</p><p>Where do these page titles come from? The only place in FA that lists them is locations.php</p>]]></content>
			<author>
				<name><![CDATA[poncho1234]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=19944</uri>
			</author>
			<updated>2017-10-31T13:59:34Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=29372#p29372</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Small bug for gettext translations - locations.php]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=29339#p29339" />
			<content type="html"><![CDATA[<p>The translations will be available when the <strong>lang/new_language_template/LC_MESSAGES/empty.po</strong> is refreshed in the next release. In the meanwhile you are free to change your .po file and compile it into a .mo file and use it.</p>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2017-10-31T04:33:51Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=29339#p29339</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Small bug for gettext translations - locations.php]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=29334#p29334" />
			<content type="html"><![CDATA[<p>The bug is &#039;Inventory Locations&#039; and also &#039;Fixed Assets Locations&#039; are not being translated in their relevant screens</p>]]></content>
			<author>
				<name><![CDATA[poncho1234]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=19944</uri>
			</author>
			<updated>2017-10-30T23:16:58Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=29334#p29334</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Small bug for gettext translations - locations.php]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=29329#p29329" />
			<content type="html"><![CDATA[<p>But practically all usage of $help_context variable are inside the gettext.<br />See <strong>sales/manage/sales_areas.php</strong>:<br /></p><div class="codebox"><pre><code>page(_($help_context = &quot;Sales Areas&quot;));</code></pre></div><p>Normal assignment of strings to a variable and then using it in gettext is what is used in locations.php:<br /></p><div class="codebox"><pre><code>page(_($help_context));</code></pre></div>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2017-10-30T20:18:12Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=29329#p29329</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Small bug for gettext translations - locations.php]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=29328#p29328" />
			<content type="html"><![CDATA[<p>Do you want me to put this on mantis?</p>]]></content>
			<author>
				<name><![CDATA[poncho1234]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=19944</uri>
			</author>
			<updated>2017-10-30T19:59:32Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=29328#p29328</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Small bug for gettext translations - locations.php]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=29310#p29310" />
			<content type="html"><![CDATA[<p><s>Yes, variable assignment is not acceptable inside the gettext</s> function call since it is checked for presence in the compiled .mo file if available and else the string is returned verbatim if valid.</p>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2017-10-30T14:25:31Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=29310#p29310</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Small bug for gettext translations - locations.php]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=29305#p29305" />
			<content type="html"><![CDATA[<p>Maybe when the PO file updates strings from source it finds all _() functions and put whatever in it to be translated, may be at that time $help_context is undefined so it will not end up to PO file.</p><p>So we should not put a variable to gettext function.<br />I&#039;m not sure this analyse is right but if change code as follow it will work.</p><div class="codebox"><pre><code>if (isset($_GET[&#039;FixedAsset&#039;])) {
    $help_context = _(&quot;Fixed Assets Locations&quot;);
    $_POST[&#039;fixed_asset&#039;] = 1;
} else
    $help_context = _(&quot;Inventory Locations&quot;);

page($help_context);</code></pre></div>]]></content>
			<author>
				<name><![CDATA[notrinos]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=36772</uri>
			</author>
			<updated>2017-10-30T03:20:23Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=29305#p29305</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Small bug for gettext translations - locations.php]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=29303#p29303" />
			<content type="html"><![CDATA[<p>The ,po file should then be compiled into a .mo file which is what the gettext engine will lookup. If any string does not exist in the translations files then the source string will be used. All translations will generally get updated during the release phase. Compare the empty.po file with the one you have for your language and update as necessary. Alternatively code and collect at Transifex.</p>]]></content>
			<author>
				<name><![CDATA[apmuthu]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=364</uri>
			</author>
			<updated>2017-10-30T02:34:23Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=29303#p29303</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Small bug for gettext translations - locations.php]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=29299#p29299" />
			<content type="html"><![CDATA[<p>Well that didn&#039;t work <img src="https://frontaccounting.com/punbb/img/smilies/sad.png" width="15" height="15" alt="sad" /></p><p>Also in the .po file</p><p>Inventory Locations Exists<br />but<br />Fixed Assets Locations does not.</p><p>may have more time tomorrow..</p>]]></content>
			<author>
				<name><![CDATA[poncho1234]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=19944</uri>
			</author>
			<updated>2017-10-29T21:19:45Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=29299#p29299</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Small bug for gettext translations - locations.php]]></title>
			<link rel="alternate" href="https://frontaccounting.com/punbb/viewtopic.php?pid=29298#p29298" />
			<content type="html"><![CDATA[<p>&#039;Inventory Locations&#039; and also &#039;Fixed Assets Locations&#039; is not being translated; looking at file locations.php I believe the relevant code is below:-</p><div class="codebox"><pre><code>File: \inventory\manage\locations.php
21: if (isset($_GET[&#039;FixedAsset&#039;])) {
22:     $help_context = &quot;Fixed Assets Locations&quot;;
23:     $_POST[&#039;fixed_asset&#039;] = 1;
24: } else
25:     $help_context = &quot;Inventory Locations&quot;;</code></pre></div><p>I cannot see where gettext picks up the translation? There&#039;s no &#039;_&#039; underscore?</p><p>Shouldn&#039;t it be something like:-</p><div class="codebox"><pre><code>File: \inventory\manage\locations.php
21: if (isset($_GET[&#039;FixedAsset&#039;])) {
22:     page(_($help_context = &quot;Fixed Assets Locations&quot;));
23:     $_POST[&#039;fixed_asset&#039;] = 1;
24: } else
25:     page(_($help_context = &quot;Inventory Locations&quot;));</code></pre></div><p>I have not tested this</p>]]></content>
			<author>
				<name><![CDATA[poncho1234]]></name>
				<uri>https://frontaccounting.com/punbb/profile.php?id=19944</uri>
			</author>
			<updated>2017-10-29T21:06:13Z</updated>
			<id>https://frontaccounting.com/punbb/viewtopic.php?pid=29298#p29298</id>
		</entry>
</feed>
