Issue Details (XML | Word | Printable)

Key: DISPL-564
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Reporter: Samppa Saarela
Votes: 0
Watchers: 1
Operations

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

Page numbers localized using wrong locale

Created: 22/Sep/08 07:48 AM   Updated: 20/Mar/09 07:34 AM   Resolved: 27/Dec/08 04:53 AM
Return to search
Component/s: I18N
Affects Version/s: 1.1.1
Fix Version/s: 1.2

Time Tracking:
Not Specified

File Attachments: None
Image Attachments:

1. pagination locale nl_BE.jpg
(18 kB)


 Description  « Hide
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().

fabrizio giustina added a comment - 27/Dec/08 04:53 AM
solved in 1.2

fabrizio giustina made changes - 27/Dec/08 04:53 AM
Field Original Value New Value
Resolution Fixed [ 1 ]
Fix Version/s 1.2 [ 13662 ]
Status Open [ 1 ] Resolved [ 5 ]
Hilde Meuris added a comment - 20/Mar/09 07:28 AM
This problem has only been solved partially: it is also needed to make similar changes in PaginatedListSmartListHelper.java (line 206) and in SmartListHelper.java (line 289).

Hilde Meuris added a comment - 20/Mar/09 07:34 AM
As you can see, the values between [Eerste/Vorige] and [Volgende/Laatste] are formatted correctly (locale nl_BE), but the other values are still in American formatting.

Hilde Meuris made changes - 20/Mar/09 07:34 AM
Attachment pagination locale nl_BE.jpg [ 40819 ]