Page numbers localized using wrong locale
-----------------------------------------

                 Key: DISPL-564
                 URL: http://jira.codehaus.org/browse/DISPL-564
             Project: DisplayTag
          Issue Type: Bug
          Components: I18N
    Affects Versions: 1.1.1
            Reporter: Samppa Saarela


Localization fails on page numbers because MessageFormating uses default locale 
of the system instead of user's locale. This leads to quite confucing resuilts, 
as 1,456 (over thousand rows) means actually 1.456 in Finnish.

Fixing this comes down to 

org.displaytag.pagination.Pagination#243:

if (page.getSelected())
{
        buffer.append(MessageFormat.format(numberedPageSelectedFormat, 
pageObjects));
}
else
{
        buffer.append(MessageFormat.format(numberedPageFormat, pageObjects));
}

which should be something like:

if (page.getSelected())
{
        buffer.append(new MessageFormat(numberedPageSelectedFormat, 
getUserLocale()).format(pageObjects));
}
else
{
        buffer.append(new MessageFormat(numberedPageFormat, 
getUserLocale()).format(pageObjects));
}

In which getUserLocale() returns the same locale that 
TableProperties.getLocale().

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
displaytag-devel mailing list
displaytag-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/displaytag-devel

Reply via email to