Issue Details (XML | Word | Printable)

Key: TAPESTRY-1997
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Howard M. Lewis Ship
Reporter: Geoff Callender
Votes: 1
Watchers: 2
Operations

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

PersistentLocale is lower-casing locales

Created: 23/Dec/07 12:52 PM   Updated: 19/Jun/08 05:53 PM
Return to search
Component/s: tapestry-core
Affects Version/s: 5.0.6
Fix Version/s: 5.0.14

Time Tracking:
Not Specified

Resolution Date: 19/Jun/08 05:53 PM


 Description  « Hide
An issue affecting localization: PersistentLocale is converting locales from mixed case to all lower case, which is useless for formatting. For example, if page 1 sets the locale like this:

@Inject
private PersistentLocale _persistentLocaleService;

Locale locale = Locale.UK;
_persistentLocaleService.set(locale);
System.out.println("locale is " + locale + " - " + locale.getDisplayName());
 
then this is what prints:

locale is en_GB - English (United Kingdom)

But when I'm in page 2 I get the locale and find it has mutated...

Locale locale = _persistentLocaleService.get();
System.out.println("locale is " + locale + " - " + locale.getDisplayName());

...this is what prints:

locale is en_gb - en_gb

This mutated locale in page 2 is useless for formatting. Code like the following produces default-styling instead of the styling for en_GB:

_myDateFormat = DateFormat.getDateInstance(DateFormat.LONG, locale);
System.out.println(_myDateFormat.format(new Date()));

It seems this has also adversely affected how supported-locales are declared (maybe in previous releases only). See http://thread.gmane.org/gmane.comp.java.tapestry.user/56526/focus=56527

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
No work has yet been logged on this issue.