ICU-6422 ignore tags in locales

X-SVN-Rev: 24440
This commit is contained in:
Doug Felt 2008-08-05 18:22:30 +00:00
parent 0c2a587a9c
commit bd5fddc33f
2 changed files with 10 additions and 0 deletions

View file

@ -236,4 +236,8 @@ public class ICUDurationTest extends TestFmwk {
}
}
public void TestResourceWithCalendar() {
DurationFormat df = DurationFormat.getInstance(new ULocale("th@calendar=buddhist"));
// should pass, but return a default formatter for th.
}
}

View file

@ -74,6 +74,12 @@ public class ResourceBasedPeriodFormatterDataService
}
public PeriodFormatterData get(String localeName) {
// remove tag info including calendar, we don't use the calendar
int x = localeName.indexOf('@');
if (x != -1) {
localeName = localeName.substring(0, x);
}
synchronized(this) {
if (lastLocale != null && lastLocale.equals(localeName)) {
return lastData;