<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Adobe Flex 3: How to create localized UI component / control</title>
	<atom:link href="http://www.savage7.com/index.php/2009/08/adobe-flex-3-how-to-create-localized-ui-component-control/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.savage7.com/index.php/2009/08/adobe-flex-3-how-to-create-localized-ui-component-control/</link>
	<description>Professional Software Developer / a.k.a. Programming Junkie</description>
	<lastBuildDate>Sat, 10 Apr 2010 02:07:52 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Robert</title>
		<link>http://www.savage7.com/index.php/2009/08/adobe-flex-3-how-to-create-localized-ui-component-control/comment-page-1/#comment-104</link>
		<dc:creator>Robert</dc:creator>
		<pubDate>Fri, 09 Apr 2010 05:29:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.savage7.com/?p=511#comment-104</guid>
		<description>&lt;a href=&quot;#comment-94&quot; rel=&quot;nofollow&quot;&gt;@Tom Gruszowski &lt;/a&gt; 
Hi Tom,
Thanks for pointing that out!  
I need to go back and review some of my implementation of this code for this optimization.</description>
		<content:encoded><![CDATA[<p><code><a href="#comment-94" rel="nofollow">@Tom Gruszowski </a><br />Hi Tom,<br />Thanks for pointing that out!<br />I need to go back and review some of my implementation of this code for this optimization.</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tom Gruszowski</title>
		<link>http://www.savage7.com/index.php/2009/08/adobe-flex-3-how-to-create-localized-ui-component-control/comment-page-1/#comment-94</link>
		<dc:creator>Tom Gruszowski</dc:creator>
		<pubDate>Tue, 23 Feb 2010 16:52:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.savage7.com/?p=511#comment-94</guid>
		<description>I found that addEventListener(Event.ADDED,resources_LocalizationHandler); is terribly inefficient. Breakpointing this handler I saw it getting hit 5-7 times. So instead I added the initial seed of .text/.toolTip value to commitProperties

So my setters are:

public function set resourceBundle(value:String):void
{
	// set new resource bundle
	if (_resourceBundle != value)
	{
		_resourceBundle = value;
		_resourceBundleChanged = true;
		invalidateProperties();
	}
}

And 

override protected function commitProperties():void
{
	super.commitProperties();
	
	if(_resourceNameChanged &amp;&amp; resourceBundle)
	{
		resourcesLocalizationHandler();
	}
}</description>
		<content:encoded><![CDATA[<p><code>I found that addEventListener(Event.ADDED,resources_LocalizationHandler); is terribly inefficient. Breakpointing this handler I saw it getting hit 5-7 times. So instead I added the initial seed of .text/.toolTip value to commitProperties</p><p>So my setters are:</p><p>public function set resourceBundle(value:String):void<br />{<br />	// set new resource bundle<br />	if (_resourceBundle != value)<br />	{<br />		_resourceBundle = value;<br />		_resourceBundleChanged = true;<br />		invalidateProperties();<br />	}<br />}</p><p>And </p><p>override protected function commitProperties():void<br />{<br />	super.commitProperties();</p><p>	if(_resourceNameChanged &amp;&amp; resourceBundle)<br />	{<br />		resourcesLocalizationHandler();<br />	}<br />}</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: admin</title>
		<link>http://www.savage7.com/index.php/2009/08/adobe-flex-3-how-to-create-localized-ui-component-control/comment-page-1/#comment-70</link>
		<dc:creator>admin</dc:creator>
		<pubDate>Fri, 23 Oct 2009 23:18:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.savage7.com/?p=511#comment-70</guid>
		<description>&lt;a href=&quot;#comment-65&quot; rel=&quot;nofollow&quot;&gt;@Manu &lt;/a&gt; 

If you are wanting to embed a default set of resources in the compiled SWF and then also expose a means for user customizable/overridable resource definitions, one idea that comes to mind is that you could use the localeChain to do this.  For example you could define a locale chain of (&#039;en_US_custom&quot;, &#039;en_US&#039;, &#039;en_custom&#039;, &#039;en&#039;) where both &#039;en_US&#039; &amp; &#039;en&#039; are embedded and &#039;en_US_custom&quot; &amp; &#039;en_custom&#039; are loaded at runtime from XML.  This would allow the built-in resource manager to deal with all the resource resolution across all sets of resources.

Or maybe a better option after looking at my XMLResourceLoader class is just to embed the default resource bundles and then allow the XMLResourceLoader class to load the chained XML files.  It looks like I wrote this to handle adding/updating resource keys in existing resource bundles that may have already been loaded.  It first tries to look up an existing bundle by name and then updates the resource entries.  If no bundle by that name exists, it then creates a new resource bundle.  

 - Good Luck!
</description>
		<content:encoded><![CDATA[<p><code><a href="#comment-65" rel="nofollow">@Manu </a> </p><p>If you are wanting to embed a default set of resources in the compiled SWF and then also expose a means for user customizable/overridable resource definitions, one idea that comes to mind is that you could use the localeChain to do this.  For example you could define a locale chain of (&#8216;en_US_custom&#8221;, &#8216;en_US&#8217;, &#8216;en_custom&#8217;, &#8216;en&#8217;) where both &#8216;en_US&#8217; &#038; &#8216;en&#8217; are embedded and &#8216;en_US_custom&#8221; &#038; &#8216;en_custom&#8217; are loaded at runtime from XML.  This would allow the built-in resource manager to deal with all the resource resolution across all sets of resources.</p><p>Or maybe a better option after looking at my XMLResourceLoader class is just to embed the default resource bundles and then allow the XMLResourceLoader class to load the chained XML files.  It looks like I wrote this to handle adding/updating resource keys in existing resource bundles that may have already been loaded.  It first tries to look up an existing bundle by name and then updates the resource entries.  If no bundle by that name exists, it then creates a new resource bundle.  </p><p> &#8211; Good Luck!</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: admin</title>
		<link>http://www.savage7.com/index.php/2009/08/adobe-flex-3-how-to-create-localized-ui-component-control/comment-page-1/#comment-69</link>
		<dc:creator>admin</dc:creator>
		<pubDate>Fri, 23 Oct 2009 23:01:31 +0000</pubDate>
		<guid isPermaLink="false">http://www.savage7.com/?p=511#comment-69</guid>
		<description>&lt;a href=&quot;#comment-65&quot; rel=&quot;nofollow&quot;&gt;@Manu &lt;/a&gt; 

Hi Manu,

Thanks for the comments.  I have run into the very situation that you are talking about where you want to create a set up resources that can easily be edited in the field &lt;strong&gt;without&lt;/strong&gt; requiring recompiling a SWF.  
Take a look at this article I just posted, this includes the ground work for loading resource strings from a XML file using the URLLoader and then creating the Flex resource bundles at runtime.   This sample may get you a head start if you have not already implemented this logic in your codebase.

&lt;a href=&quot;http://www.savage7.com/index.php/2009/10/adobe-flex-3-load-localization-resources-at-runtime-using-xml/&quot; rel=&quot;nofollow&quot;&gt;http://www.savage7.com/index.php/2009/10/adobe-flex-3-load-localization-resources-at-runtime-using-xml/&lt;/a&gt;

Enjoy!
  - Robert</description>
		<content:encoded><![CDATA[<p><code><a href="#comment-65" rel="nofollow">@Manu </a> </p><p>Hi Manu,</p><p>Thanks for the comments.  I have run into the very situation that you are talking about where you want to create a set up resources that can easily be edited in the field <strong>without</strong> requiring recompiling a SWF.<br />Take a look at this article I just posted, this includes the ground work for loading resource strings from a XML file using the URLLoader and then creating the Flex resource bundles at runtime.   This sample may get you a head start if you have not already implemented this logic in your codebase.</p><p><a href="http://www.savage7.com/index.php/2009/10/adobe-flex-3-load-localization-resources-at-runtime-using-xml/" rel="nofollow">http://www.savage7.com/index.php/2009/10/adobe-flex-3-load-localization-resources-at-runtime-using-xml/</a></p><p>Enjoy!<br />  &#8211; Robert</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: admin</title>
		<link>http://www.savage7.com/index.php/2009/08/adobe-flex-3-how-to-create-localized-ui-component-control/comment-page-1/#comment-67</link>
		<dc:creator>admin</dc:creator>
		<pubDate>Fri, 23 Oct 2009 21:29:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.savage7.com/?p=511#comment-67</guid>
		<description>Hi Nick, sorry for the very delayed reply...

Not sure on the repeater situation, I guess I have not run into that one yet.   
As for attribution, my name and a link to this page are perfectly sufficient!  

Thank You!</description>
		<content:encoded><![CDATA[<p><code>Hi Nick, sorry for the very delayed reply&#8230;</p><p>Not sure on the repeater situation, I guess I have not run into that one yet.<br />As for attribution, my name and a link to this page are perfectly sufficient!  </p><p>Thank You!</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Manu</title>
		<link>http://www.savage7.com/index.php/2009/08/adobe-flex-3-how-to-create-localized-ui-component-control/comment-page-1/#comment-66</link>
		<dc:creator>Manu</dc:creator>
		<pubDate>Fri, 23 Oct 2009 19:59:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.savage7.com/?p=511#comment-66</guid>
		<description>The dynamic one can be changed by “field engineers” and applied to the application with a re-compile.
SHOULD READ
The dynamic one can be changed by “field engineers” and applied to the application WITHOUT a re-compile.</description>
		<content:encoded><![CDATA[<p><code>The dynamic one can be changed by “field engineers” and applied to the application with a re-compile.<br />SHOULD READ<br />The dynamic one can be changed by “field engineers” and applied to the application WITHOUT a re-compile.</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Manu</title>
		<link>http://www.savage7.com/index.php/2009/08/adobe-flex-3-how-to-create-localized-ui-component-control/comment-page-1/#comment-65</link>
		<dc:creator>Manu</dc:creator>
		<pubDate>Fri, 23 Oct 2009 19:55:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.savage7.com/?p=511#comment-65</guid>
		<description>Nice writeup!

I thinks the standard way to localize an application using &quot;mxmlc&quot; to create the bundles is not a good solution for many usage scenarios. With that model, the product has to be shipped with swf&#039;s embedded with resource bundles or swf&#039;s that load compiled resource &quot;modules&quot;. Both of which require a mxmlc compilation step...

What is you want to do things without going through the compilation step? That can be done by dynamically creating a Resource Bundle and adding resources using action script code shown below

var moreResources:ResourceBundle = new ResourceBundle(&quot;fr_FR&quot;, &quot;moreResources&quot;);
moreResources.content[&quot;OPEN&quot;] = &quot;Ouvrez&quot;;
moreResources.content[&quot;CLOSE&quot;] = &quot;Fermez&quot;;
resourceManager.addResourceBundle(moreResources);
resourceManager.localeChain = [ &quot;fr_FR&quot; ];
myLabel.text = resourceManager.getString(&quot;moreResources&quot;, &quot;OPEN&quot;);

That solves part of the problem but in my case the perfect solution would be as follows
1. Use your technique to create custom components, trap appropriate events, handle label assignments etc
2. Create Resource bundles for certain parts of the application and embed it in the swf. 
3. Create Resource bundles dynamically (using code snippet shown above) and
4. Hydrate the dynamic resource bundles by reading data from a &quot;properties&quot; file using a URLLoader. This data can be changed on the fly without recompiling the application.

Essentially there is a static resource bundle and a dynamic resource bundle. The dynamic one can be changed by &quot;field engineers&quot; and applied to the application with a re-compile. Additional logic is required in the component to figure out whether to either give precedence to data in the static or dynamic bundle.</description>
		<content:encoded><![CDATA[<p><code>Nice writeup!</p><p>I thinks the standard way to localize an application using &#8220;mxmlc&#8221; to create the bundles is not a good solution for many usage scenarios. With that model, the product has to be shipped with swf&#8217;s embedded with resource bundles or swf&#8217;s that load compiled resource &#8220;modules&#8221;. Both of which require a mxmlc compilation step&#8230;</p><p>What is you want to do things without going through the compilation step? That can be done by dynamically creating a Resource Bundle and adding resources using action script code shown below</p><p>var moreResources:ResourceBundle = new ResourceBundle(&#8220;fr_FR&#8221;, &#8220;moreResources&#8221;);<br />moreResources.content["OPEN"] = &#8220;Ouvrez&#8221;;<br />moreResources.content["CLOSE"] = &#8220;Fermez&#8221;;<br />resourceManager.addResourceBundle(moreResources);<br />resourceManager.localeChain = [ "fr_FR" ];<br />myLabel.text = resourceManager.getString(&#8220;moreResources&#8221;, &#8220;OPEN&#8221;);</p><p>That solves part of the problem but in my case the perfect solution would be as follows<br />1. Use your technique to create custom components, trap appropriate events, handle label assignments etc<br />2. Create Resource bundles for certain parts of the application and embed it in the swf.<br />3. Create Resource bundles dynamically (using code snippet shown above) and<br />4. Hydrate the dynamic resource bundles by reading data from a &#8220;properties&#8221; file using a URLLoader. This data can be changed on the fly without recompiling the application.</p><p>Essentially there is a static resource bundle and a dynamic resource bundle. The dynamic one can be changed by &#8220;field engineers&#8221; and applied to the application with a re-compile. Additional logic is required in the component to figure out whether to either give precedence to data in the static or dynamic bundle.</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nick</title>
		<link>http://www.savage7.com/index.php/2009/08/adobe-flex-3-how-to-create-localized-ui-component-control/comment-page-1/#comment-64</link>
		<dc:creator>Nick</dc:creator>
		<pubDate>Mon, 21 Sep 2009 18:07:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.savage7.com/?p=511#comment-64</guid>
		<description>Hi Robert,

A nice solution, I&#039;ve found however that any bindable properties propogated through a repeater seem to return null to the label and button classes. e.g.



It&#039;s been quite frustrating as to why, a nod in the right direction would be appreciated. 

Also what attribution are you happy with, is your name in the header of the classes sufficient?

Cheers</description>
		<content:encoded><![CDATA[<p><code>Hi Robert,</p><p>A nice solution, I&#8217;ve found however that any bindable properties propogated through a repeater seem to return null to the label and button classes. e.g.</p><p>It&#8217;s been quite frustrating as to why, a nod in the right direction would be appreciated. </p><p>Also what attribution are you happy with, is your name in the header of the classes sufficient?</p><p>Cheers</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: admin</title>
		<link>http://www.savage7.com/index.php/2009/08/adobe-flex-3-how-to-create-localized-ui-component-control/comment-page-1/#comment-43</link>
		<dc:creator>admin</dc:creator>
		<pubDate>Mon, 24 Aug 2009 19:02:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.savage7.com/?p=511#comment-43</guid>
		<description>Not sure I fully understand what you are asking.  I did however update the sample here to include Japanese localized resources.  No special method or utilities are needed to work with Unicode, the string type natively supports Unicode.  All I did was add a &quot;ja_JP&quot; resource property file, set the file encoding to UTF-8 and entered the Japanese symbols for each resource key  (I used Google translate to get Japanese symbols)

Note, Flex 3 does not support Right-To-Left languages out of the box.  For RTL languages, you will need to utilize the Text rendering engine in Flash Player 10.  Use Flex 4 or use the Text Layout Framework in Flex 3.  http://labs.adobe.com/technologies/textlayout
</description>
		<content:encoded><![CDATA[<p><code>Not sure I fully understand what you are asking.  I did however update the sample here to include Japanese localized resources.  No special method or utilities are needed to work with Unicode, the string type natively supports Unicode.  All I did was add a &#8220;ja_JP&#8221; resource property file, set the file encoding to UTF-8 and entered the Japanese symbols for each resource key  (I used Google translate to get Japanese symbols)</p><p>Note, Flex 3 does not support Right-To-Left languages out of the box.  For RTL languages, you will need to utilize the Text rendering engine in Flash Player 10.  Use Flex 4 or use the Text Layout Framework in Flex 3.  <a href="http://labs.adobe.com/technologies/textlayout" rel="nofollow">http://labs.adobe.com/technologies/textlayout</a></code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gautam Dhar</title>
		<link>http://www.savage7.com/index.php/2009/08/adobe-flex-3-how-to-create-localized-ui-component-control/comment-page-1/#comment-42</link>
		<dc:creator>Gautam Dhar</dc:creator>
		<pubDate>Mon, 24 Aug 2009 04:04:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.savage7.com/?p=511#comment-42</guid>
		<description>The content proposed an excellent solution. With a wrapper class.

How to handle a string which need unicode treatment in Flex,
At present in Flex SDK there is no API where I can specify the local and string to display it in UI, we need to call resource manager to handle it.

My problem: 

Flex Compiler verson : flex_sdk_3.3.0.4852_mpl


In Flex Application I am receiving Unicode result from back end ( web service) an displaying it in Flex Label component 

Storing event.result in to a string Eg. Response string = [\u8868\u7af9\uff5eFulfillment~~~~ja] 

I am binding response to label component When I am displaying it in label its not showing me Japanese character . 

Note : Storing this information in properties file works 
Eg. 
Result.properties 
Res=[\u8868\u7af9\uff5eFulfillment~~~~ja] 

In side flex component 

1. define a metadata tag for Result.properties file 
2. call it in Label component as resourceManager.getString(&#039;Result&#039;,,&#039;Res&#039;) 

This show the japaness data in UI 
Result ==[\u8868\u7af9\uff5eFulfillment~~~~ja] 
Need API to support for unicode string ; eg : resourceManager.getString(Result,&quot;ja&quot;); 
Presently there is no api to display unicode string in UI 
  
 Actual Results: 
  [\u8868\u7af9\uff5eFulfillment~~~~ja] 
  
 Expected Results: 
 [表竹～Fulfillment~~~~ja] 
  
Please let me know how to over come this problem</description>
		<content:encoded><![CDATA[<p><code>The content proposed an excellent solution. With a wrapper class.</p><p>How to handle a string which need unicode treatment in Flex,<br />At present in Flex SDK there is no API where I can specify the local and string to display it in UI, we need to call resource manager to handle it.</p><p>My problem: </p><p>Flex Compiler verson : flex_sdk_3.3.0.4852_mpl</p><p>In Flex Application I am receiving Unicode result from back end ( web service) an displaying it in Flex Label component </p><p>Storing event.result in to a string Eg. Response string = [\u8868\u7af9\uff5eFulfillment~~~~ja] </p><p>I am binding response to label component When I am displaying it in label its not showing me Japanese character . </p><p>Note : Storing this information in properties file works<br />Eg.<br />Result.properties<br />Res=[\u8868\u7af9\uff5eFulfillment~~~~ja] </p><p>In side flex component </p><p>1. define a metadata tag for Result.properties file<br />2. call it in Label component as resourceManager.getString(&#8216;Result&#8217;,,&#8217;Res&#8217;) </p><p>This show the japaness data in UI<br />Result ==[\u8868\u7af9\uff5eFulfillment~~~~ja]<br />Need API to support for unicode string ; eg : resourceManager.getString(Result,&#8221;ja&#8221;);<br />Presently there is no api to display unicode string in UI </p><p> Actual Results:<br />  [\u8868\u7af9\uff5eFulfillment~~~~ja] </p><p> Expected Results:<br /> [表竹～Fulfillment~~~~ja] </p><p>Please let me know how to over come this problem</code></p>
]]></content:encoded>
	</item>
</channel>
</rss>
