On 10/27/16, 2:02 PM, "ScolabAndre" <[email protected]> wrote:
>Hi, > >I'm trying to convert a lib to FlexJS. The library is using >RessourceManager >with RessourceBundle for internationalization. This feature of Flex is >probably not available, can't find equivalent in org.apache. Does the >flexJS >sdk generate JS classes for properties files already and need >implementation >for mx.resources.ResourceManager? > >Or alternative idea for implementing this feature? We haven't taken on resource bundles in FlexJS yet. Some questions: 1) Are all of your resources strings and/or numbers? Or are there bitmaps and other objects? 2) Do you want to compile in the resource bundles or load them at runtime? IMO, for non-object resources, the pay-as-you-go principle would have the properties file either compile into a JSON object or load and parse the actual properties file as a string. Resource modules would essentially be a network fetch of a JSON or text response. The mx.resources.ResourceManager was way more robust than you need for just strings and numbers. For many scenarios the amount of code that downloaded and ran in order to just return strings and numbers was way more than actually embedding the .properties files and parsing them on-demand. Another thing to note is that Flex has a way of supporting non-standard CSS properties. FlexJS already uses it to specify certain default beads. It is possible to leverage that and/or org.apache.flex.core.ValuesManager to get some locale-dependent strings in your app relatively quickly. A custom valuesImpl in the application could subclass SimpleCSSValuesImpl and override getValue and return strings. If you want to try to create such a thing, feel free to ask more questions and we'll help you out. Thanks, -Alex
