SX Spring Actionscript
  1. SX Spring Actionscript
  2. SESPRINGACTIONSCRIPTAS-117

Allow loading of Resource Bundles from external application context configuration

    Details

    • Type: New Feature New Feature
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: IoC container
    • Labels:
      None

      Description

      Currently it is possible to load resource bundle property files from within ActionScript via the FlexXMLApplicationContext as follows:

      applicationContext.addResourceBundleLocation("url.properties", "strings", "en_US");

      This is nice, since the resource bundle will be loaded before Event.COMPLETE is dispatched to the client. However, we still have to hardcode these values or pass in FlashVars to define each resource bundle location.

      What would be very nice would be to be able to define all of this configuration of resource bundles within the application context XML itself:

      <?xml version="1.0"?>
      <objects>
      <r:resource-bundle name="strings">
      <r:language name="en_US" file="resources.en_US.properties"/>
      <r:language name="en_GB" file="resources.en_GB.properties"/>
      <r:language name="fr_FR" file="resources.fr_FR.properties"/>
      </r:resource-bundle>

      <r:resource-bundle name="alternates">
      <r:language name="en_US" file="alternate-resources.en_US.properties"/>
      </r:resource-bundle>
      </objects>

      These resource bundles would be automatically created and injected into the ResourceManager, so that "resourceManager.getString('strings', 'my.button.label');" would get the "my.button.label" property in the current locale from "resources..properties" and "resourceManager.getString('alternates', 'my.alternate.label');" would get the 'my.alternate.label' property from the right 'alternate-resources..properties' file.

        Activity

        Hide
        TK Kocheran added a comment -

        Additionally, resource bundles could be named with a prefix in order to avoid weird confusion. For example "strings" above could be auto-renamed to "resourceBundle_strings" in the application context so naming wouldn't overlap.

        Show
        TK Kocheran added a comment - Additionally, resource bundles could be named with a prefix in order to avoid weird confusion. For example "strings" above could be auto-renamed to "resourceBundle_strings" in the application context so naming wouldn't overlap.

          People

          • Assignee:
            Christophe Herreman
            Reporter:
            TK Kocheran
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated: