Comments on: Learning BabelFx: Video Tutorial http://www.gridlinked.info/flex-i18n-with-localizationmaps-video-tutorial-source/ Patterns with Flex, RUX, and software Sun, 29 Aug 2010 13:46:08 +0000 http://wordpress.org/?v=abc hourly 1 By: thomasbhttp://www.gridlinked.info/flex-i18n-with-localizationmaps-video-tutorial-source/#comment-480 thomasb Wed, 28 Jul 2010 16:20:37 +0000 http://www.gridlinked.info/?p=576#comment-480 @Mathieu, The framework localized resources are part of the SDK's pre-compiled resource bundles; e.g. <path to Flex SDK>/frameworks/locale/{locale}. You may need to use CopyLocale.exe to create a localization bundle for a locale that does not already exist. Once you have your custom resource and the frameworks bundles, you can either embed the localized resources into your app (using compiler arguments) or load from external, compiled resource bundle SWFs.RE> Where are the specifications for the names of Dates (months)? For the French locale, check out: <ul> <li><em><path to Flex SDK>/frameworks/projects/framework/bundle/fr_FR/<strong>formatters.properties</strong></em></li> <li><em><path to Flex SDK>/frameworks/projects/framework/bundle/fr_FR/<strong>SharedResources.properties</strong></em></li> </ul> @Mathieu,
The framework localized resources are part of the SDK’s pre-compiled resource bundles; e.g. /frameworks/locale/{locale}. You may need to use CopyLocale.exe to create a localization bundle for a locale that does not already exist.
Once you have your custom resource and the frameworks bundles, you can either embed the localized resources into your app (using compiler arguments) or load from external, compiled resource bundle SWFs.

RE> Where are the specifications for the names of Dates (months)?
For the French locale, check out:

  • <path to Flex SDK>/frameworks/projects/framework/bundle/fr_FR/formatters.properties
  • <path to Flex SDK>/frameworks/projects/framework/bundle/fr_FR/SharedResources.properties
]]>
By: Mathieu St-Gelaishttp://www.gridlinked.info/flex-i18n-with-localizationmaps-video-tutorial-source/#comment-479 Mathieu St-Gelais Wed, 28 Jul 2010 14:59:24 +0000 http://www.gridlinked.info/?p=576#comment-479 I had a nice surprise this morning. It seems that as soon as I set my application's locale to French (fr_CA), all date related objects show French strings. One thing really annoys me though: month names start with a capital letter in French, and they shouldn't. Do you know where Flex takes these names? SDK? Flash Player IE/Firefox plugin? Even the DateFormatter uses those. It would be great if I could only fix this capital letter problem without specifying my own month names using injection.Thanks for any idea you might have. I had a nice surprise this morning. It seems that as soon as I set my application’s locale to French (fr_CA), all date related objects show French strings. One thing really annoys me though: month names start with a capital letter in French, and they shouldn’t. Do you know where Flex takes these names? SDK? Flash Player IE/Firefox plugin? Even the DateFormatter uses those. It would be great if I could only fix this capital letter problem without specifying my own month names using injection.

Thanks for any idea you might have.

]]>
By: Sivanhttp://www.gridlinked.info/flex-i18n-with-localizationmaps-video-tutorial-source/#comment-477 Sivan Fri, 23 Jul 2010 14:59:59 +0000 http://www.gridlinked.info/?p=576#comment-477 excellent work! excellent work!

]]>
By: thomasbhttp://www.gridlinked.info/flex-i18n-with-localizationmaps-video-tutorial-source/#comment-475 thomasb Fri, 23 Jul 2010 14:31:59 +0000 http://www.gridlinked.info/?p=576#comment-475 @Mathieu, Performance has always been a critical focus. I am glad you like the framework.The next set of features will include an online tool that uses Google Translation API to auto-translate your properties files. l10nInjection will soon have a new name: "BabelFx" And stay tuned for a better site and documentation. @Mathieu,
Performance has always been a critical focus. I am glad you like the framework.

The next set of features will include an online tool that uses Google Translation API to auto-translate your properties files.
l10nInjection will soon have a new name: “BabelFx” And stay tuned for a better site and documentation.

]]>
By: Mathieu St-Gelaishttp://www.gridlinked.info/flex-i18n-with-localizationmaps-video-tutorial-source/#comment-474 Mathieu St-Gelais Fri, 23 Jul 2010 13:34:47 +0000 http://www.gridlinked.info/?p=576#comment-474 Wow. I must say this is seriously a nice improvement to my Flex project. I'm currently porting a Flex3/Cairngorm project to Flex4/Mate and your library really simplifies my life. No more intrusive localization code in my views, this is fantastic. Even more, it's faster than only using Flex's resource bundle.Great job and thanks! Wow. I must say this is seriously a nice improvement to my Flex project. I’m currently porting a Flex3/Cairngorm project to Flex4/Mate and your library really simplifies my life. No more intrusive localization code in my views, this is fantastic. Even more, it’s faster than only using Flex’s resource bundle.

Great job and thanks!

]]>
By: thomasbhttp://www.gridlinked.info/flex-i18n-with-localizationmaps-video-tutorial-source/#comment-463 thomasb Thu, 24 Jun 2010 18:55:55 +0000 http://www.gridlinked.info/?p=576#comment-463 @Marco Great question! Remember that the map is intended to centralize all localization injections for the application. The only time, IMHO, that using multiple maps makes sense is when you are using Modules or dynamically loaded sub-apps. I recommend 1 LocalizationMap class per module and 1 per application. The <a href="http://wiki.github.com/ThomasBurleson/l10nInjection_Samples/sample-applications#demo5" rel="nofollow">Intranet demo</a> show this and it works great. Minimizing LocalizationMaps helps you maintain context and centralize management.Now you may ask about the performance impacts when using larger localization maps... One developer has over 400 ResourceProxy tags in their custom LocalizationMap. The LocalizationMap [extends LocaleMap] performs very well and has a very lightweight impact on both memory and CPU. In fact, the l10nInjection engine actually performs faster and requires less memory than if you used traditional approach of data binding with the resourceManager. The traditional approach is NOT a good solution and does not scale nearly as well. @Marco
Great question! Remember that the map is intended to centralize all localization injections for the application. The only time, IMHO, that using multiple maps makes sense is when you are using Modules or dynamically loaded sub-apps. I recommend 1 LocalizationMap class per module and 1 per application. The Intranet demo show this and it works great. Minimizing LocalizationMaps helps you maintain context and centralize management.

Now you may ask about the performance impacts when using larger localization maps… One developer has over 400 ResourceProxy tags in their custom LocalizationMap. The LocalizationMap [extends LocaleMap] performs very well and has a very lightweight impact on both memory and CPU. In fact, the l10nInjection engine actually performs faster and requires less memory than if you used traditional approach of data binding with the resourceManager. The traditional approach is NOT a good solution and does not scale nearly as well.

]]>
By: marcohttp://www.gridlinked.info/flex-i18n-with-localizationmaps-video-tutorial-source/#comment-462 marco Thu, 24 Jun 2010 18:36:49 +0000 http://www.gridlinked.info/?p=576#comment-462 Great stuff! One question concerning the size of the file itself... would it make more sense to split the file in sections (say per screen or logical business section) rather than having one big file with all the mappings for the entire application? Great stuff!
One question concerning the size of the file itself… would it make more sense to split the file in sections (say per screen or logical business section) rather than having one big file with all the mappings for the entire application?

]]>
By: thomasbhttp://www.gridlinked.info/flex-i18n-with-localizationmaps-video-tutorial-source/#comment-461 thomasb Wed, 23 Jun 2010 16:29:44 +0000 http://www.gridlinked.info/?p=576#comment-461 @Flemming, You are right that the l10nInjection only expects to inject into target properties; it does not format parameters but it will do parameter substitution. The StringUtil.substitute() is a printf() analogy and is an accepted programmatic standard.Consider the tag <ResourceProxy property="text" key="<em>caseClosed</em>" parameters="{[dateClosed]} /> where the localized value for "<em>caseClosed</em>" is "Cased closed on the {0}". The <em>dateClosed</em> should be a string that is ALREADY formatted; otherwise you are attempting to put logic or DSL syntax in localized resources. Now if the <em>dateClosed</em> format depends on the locale (which it usually does) then I recommend that you inject the date format string into a target property BEFORE you inject caseClosed; you can inject the date format using target implicit setter function set dateFormat(val:String):void { ... }. Then the date is already formatted when you inject the value for caseClosed.As you can tell, there are a myriad solutions and complications to Localization... that is why I created the l10nInjection. Hope this helps. Good luck. @Flemming,
You are right that the l10nInjection only expects to inject into target properties; it does not format parameters but it will do parameter substitution. The StringUtil.substitute() is a printf() analogy and is an accepted programmatic standard.

Consider the tag <ResourceProxy property=”text” key=”caseClosed” parameters=”{[dateClosed]} /> where the localized value for “caseClosed” is “Cased closed on the {0}”. The dateClosed should be a string that is ALREADY formatted; otherwise you are attempting to put logic or DSL syntax in localized resources. Now if the dateClosed format depends on the locale (which it usually does) then I recommend that you inject the date format string into a target property BEFORE you inject caseClosed; you can inject the date format using target implicit setter function set dateFormat(val:String):void { … }. Then the date is already formatted when you inject the value for caseClosed.

As you can tell, there are a myriad solutions and complications to Localization… that is why I created the l10nInjection. Hope this helps. Good luck.

]]>
By: Flemming Bregnvighttp://www.gridlinked.info/flex-i18n-with-localizationmaps-video-tutorial-source/#comment-460 Flemming Bregnvig Wed, 23 Jun 2010 14:54:38 +0000 http://www.gridlinked.info/?p=576#comment-460 Thank you very much for the presentation and the I10N injection framework. It is so nice to work with.I have a question though. One of my parameters is a date.But as far as I can see I have no way to specify my formatString as part of the message.I.e: "Case closed on the {0}"I would have loved to do something like this:"Case closed on the {0,YY/MM/DD}"But as far as I can see you are using the StringUtil to substitute the parameters. And then that is not possible.Or maybe I'm missing the point of how to work with dates.Any help would be appreciated :) Regards, Flemming Thank you very much for the presentation and the I10N injection framework. It is so nice to work with.

I have a question though. One of my parameters is a date.

But as far as I can see I have no way to specify my formatString as part of the message.

I.e: “Case closed on the {0}”

I would have loved to do something like this:

“Case closed on the {0,YY/MM/DD}”

But as far as I can see you are using the StringUtil to substitute the parameters. And then that is not possible.

Or maybe I’m missing the point of how to work with dates.

Any help would be appreciated :)
Regards, Flemming

]]>
By: thomasbhttp://www.gridlinked.info/flex-i18n-with-localizationmaps-video-tutorial-source/#comment-451 thomasb Wed, 16 Jun 2010 13:20:04 +0000 http://www.gridlinked.info/?p=576#comment-451 @Fletch Thank you for your kind words and suggestion regarding a default "property". < ResourceProxy ... /> can be used to injection resources into any public property or mutator. This means that colors, sizes, text, skins, states (etc.) all can be changed via localization injection. My concern is that the ResourceProxy default property "text" may not be an intuitive default. If we made that change, however, and the default "text" property did not exist on the target instance, the l10nInjection framework could still LOG.warn() a warning. Let me deliberate and consider the impacts. - ThomasB @Fletch
Thank you for your kind words and suggestion regarding a default “property”. < ResourceProxy … /> can be used to injection resources into any public property or mutator. This means that colors, sizes, text, skins, states (etc.) all can be changed via localization injection. My concern is that the ResourceProxy default property “text” may not be an intuitive default. If we made that change, however, and the default “text” property did not exist on the target instance, the l10nInjection framework could still LOG.warn() a warning. Let me deliberate and consider the impacts.
- ThomasB

]]>