Issue Details (XML | Word | Printable)

Type: Sub-task Sub-task
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Ed Burns
Reporter: cayhorstmann
Votes: 3
Watchers: 3

If you were logged in you would be able to see more operations.

Resource localization is too rigid and forces undesirable duplication

Created: 27/Apr/09 02:39 PM   Updated: 22/Mar/12 08:25 PM   Resolved: 22/Mar/12 08:25 PM
Component/s: Resources
Affects Version/s: 2.0
Fix Version/s: 2.2 Sprint 11 B

Time Tracking:
Not Specified


Operating System: All
Platform: All

Issuezilla Id: 548
Status Whiteboard:

cat2 frame size_medium importance_large

Participants: cayhorstmann, Ed Burns, kito75, lamine_ba and Ryan Lubke

 Description  « Hide

Consider this situation, which is not uncommon.

  • I need a JavaScript library for all locales
  • I need images that vary by locale
    Resource handling, as described in section 2.6, makes it impossible to vary the
    images by locale without also unnecessary duplicating the JavaScript.

In order to have images vary by locale, it is necessary to add keys
javax.faces.resource.localePrefix into the the application's message bundle for
each locale. Once that has been done, the prefix is used for ALL resource lookups.

1) It forces unnecessary duplication of resources. (I now have to put the SAME
JavaScript libraries under the locale prefix for each locale)
2) The spec is not clear what happens when a resource is obtained from a
component library. If the locale prefix is also prepended in that case, it is
possible (even likely) that the library will break.

Suggested fix: Abolish the javax.faces.resource.localePrefix approach. Instead,
get the actual application locale, and look for resources at
language_country_variant, language_country, language, and no prefix, just like a
ResourceBundle does.

No work has yet been logged on this issue.