Ticket #818 (closed defect: worksforme)

Opened 7 months ago

Last modified 2 months ago

i18n localize bug

Reported by: kenci Owned by: knut
Priority: normal Milestone: 3.1.3
Component: Prado Framework v3 Version: 3.1
Severity: minor Keywords: I18n Globalization localize
Cc:

Description

If i set this code in Page.php:

$this->Title = Prado::localize("Login");

I edited messages.xml file and insert the translated strings in there, but the localize function doesn't return me the translated text. Instead of returning the translated string it writes the same source strings in there, and this each request.

If i set this in Page.php:

$this->Title = "Login";

everything seems to be fine.

Thanks.

Change History

Changed 7 months ago by sergeymorkovkin

Probably, I was the first one discovering this: #636.

Changed 7 months ago by kenci

Hi sergeymorkovkin,

i think #636 is not the same what i have written. I downloaded the fixed TTranslate.php, where your bug was fixed, from the trunk, but the problem still exists. It writes every request the same string in messages.xml.

Changed 7 months ago by xue

  • milestone changed from 3.1.2 to 3.1.3

Changed 2 months ago by knut

  • owner changed from xue to knut

Is this still a problem? I can't reproduce it. If it is please attach a complete sample application with your problem in a ZIP-file.

I'm using:

myapp/
  protected/
    application.xml
    lang/
      no_NO/
        messages.xml
    pages/
      LocalizeTest.page
      LocalizeTest.php

protected/application.xml:

...
	<modules>
		<module id="globalization" class="TGlobalization" Culture="no_NO">
			<translation type="XLIFF" source="Application.lang" autosave="true" cache="false" />
		</module>
	</modules>
...

protected/lang/no_NO/messages.xml:

<?xml version="1.0"?>
<xliff version="1.0">
 <file source-language="EN" target-language="no_NO" datatype="plaintext" original="messages" date="2008-08-06T00:23:08Z" product-name="messages">
  <body>
  
<trans-unit id="1">
<source>Login</source>
<target>Logg inn</target>
</trans-unit>
</body>
 </file>
</xliff>

protected/pages/LocalizeTest.php:

<?php
class LocalizeTest extends TPage {
	public function onInit($param) {
		parent::onInit($param);
		$this->Title = Prado::localize("Login");
	}
}
?>

Changed 2 months ago by kenci

Everything seems to be fine now.

Changed 2 months ago by knut

  • status changed from new to closed
  • resolution set to worksforme
Note: See TracTickets for help on using tickets.