Uploaded image for project: 'Apache Flex'
  1. Apache Flex
  2. FLEX-11775

Add 'locale' parameter to ResourceManager methods that get resources

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • Adobe Flex SDK Previous
    • None
    • i18n : Bundle Support
    • None
    • Affected OS(s): All OS Platforms
      Affected OS(s): All OS Platforms
      Language Found: English

    Description

      The ResourceManager supports a locale chain, automatically getting resources from the first locale in the chain, and walking up the chain if it doesn't find the requested resource.
      However, there are cases where an application may need to get a resource for a specific locale rather than for the first locale in the chain. For example, an application may resource locale-specific formatting data in different (locale-specific) resource bundles; yet, the selection of such data at run-time is likely to be independent from the selection of the user interface (it may depend on downloaded user data, etc.).

      Currently, it may be possible to call method 'getResourceBundle( locale , bundleName )' and then use a get method of the returned bundle. However, it's neither clean ('getResourceBundle()' returns an 'IResourceBundle' instance, and that interface class does not have any methods to get resources; thus, the caller must know the correct type and cast) nor consistent (the get methods of class 'ResourceBundle' are considered deprecated and users are encouraged to use methods of the 'ResourceManager' class instead.

      Thus, a better approach is to enhance the get methods of the 'ResourceManager' class, adding a 'locale' parameter (with a default value of 'null'). If the 'locale' parameter is 'null', the method should use the locale chain as currently done. Otherwise, it should get the resource specifically from the requested locale.

      Attachments

        Activity

          People

            adobejira Adobe JIRA
            adobejira Adobe JIRA
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: