ICU-3936 ULocale swat - need internal resource names

X-SVN-Rev: 16199
This commit is contained in:
Doug Felt 2004-08-27 17:37:24 +00:00
parent e303299efa
commit 660e7d9374
5 changed files with 13 additions and 23 deletions

View file

@ -264,7 +264,7 @@ public class ICULocaleData {
if(k==j && j!=-1){
String locName = name.substring(j+1,name.length());
String defaultName = Locale.getDefault().toString();
String defaultName = ULocale.getDefault().toString();
if(!locName.equals(rootLocale.toString()) &&
defaultName.indexOf(locName)==-1){

View file

@ -42,7 +42,7 @@ final class BreakTransliterator extends Transliterator {
public BreakIterator getBreakIterator() {
// Defer initialization of BreakIterator because it is slow,
// typically over 2000 ms.
if (bi == null) bi = (BreakIterator) BreakIterator.getWordInstance(new Locale("th", "TH"));
if (bi == null) bi = (BreakIterator) BreakIterator.getWordInstance(new ULocale("th_TH"));
return bi;
}

View file

@ -51,10 +51,7 @@ final class CollatorServiceShim extends Collator.ServiceShim {
CollatorFactory delegate;
CFactory(CollatorFactory f) {
super(f.visible()
? LocaleKeyFactory.VISIBLE
: LocaleKeyFactory.INVISIBLE,
"CFactory");
super(f.visible());
this.delegate = f;
}
@ -105,16 +102,12 @@ final class CollatorServiceShim extends Collator.ServiceShim {
super("Collator");
class CollatorFactory extends ICUResourceBundleFactory {
protected Object handleCreate(ULocale uloc, int kind, ICUService service) {
return new RuleBasedCollator(uloc);
CollatorFactory() {
super(ICUResourceBundle.ICU_COLLATION_BASE_NAME);
}
protected boolean supportsULocale() {
return true;
}
protected Set getSupportedIDs() {
return ICUResourceBundle.getAvailableLocaleNameSet(ICUResourceBundle.ICU_COLLATION_BASE_NAME);
protected Object handleCreate(ULocale uloc, int kind, ICUService service) {
return new RuleBasedCollator(uloc);
}
}

View file

@ -622,7 +622,7 @@ public class DecimalFormat extends NumberFormat {
*/
public DecimalFormat() {
// [NEW]
Locale def = Locale.getDefault();
Locale def = ULocale.getDefault();
String pattern = getPattern(def, 0);
// Always applyPattern after the symbols are set
this.symbols = new DecimalFormatSymbols(def);
@ -650,7 +650,7 @@ public class DecimalFormat extends NumberFormat {
*/
public DecimalFormat(String pattern) {
// Always applyPattern after the symbols are set
Locale def = Locale.getDefault();
Locale def = ULocale.getDefault();
this.symbols = new DecimalFormatSymbols(def);
setCurrency(Currency.getInstance(def));
applyPattern( pattern, false );
@ -2691,7 +2691,6 @@ public class DecimalFormat extends NumberFormat {
}
// protected void handleToString(StringBuffer buf) {
// super.handleToString(buf);
// buf.append("\nposPrefixPattern: '" + posPrefixPattern + "'\n");
// buf.append("positivePrefix: '" + positivePrefix + "'\n");
// buf.append("posSuffixPattern: '" + posSuffixPattern + "'\n");
@ -3849,8 +3848,8 @@ public class DecimalFormat extends NumberFormat {
String s = theCurrency.getName(symbols.getULocale(),
Currency.SYMBOL_NAME,
isChoiceFormat);
symbols.setCurrencySymbol(s);
symbols.setInternationalCurrencySymbol(theCurrency.getCurrencyCode());
symbols.setCurrencySymbol(s);
symbols.setInternationalCurrencySymbol(theCurrency.getCurrencyCode());
}
if (isCurrencyFormat) {

View file

@ -1742,9 +1742,7 @@ public abstract class Calendar implements Serializable, Cloneable {
throw new IllegalArgumentException("calendar must not be null");
}
registerFactory(factory);
return getService().registerObject(factory, locale, visible
? LocaleKeyFactory.VISIBLE
: LocaleKeyFactory.INVISIBLE);
return getService().registerObject(factory, locale, visible);
}
/**
@ -2917,7 +2915,7 @@ public abstract class Calendar implements Serializable, Cloneable {
* @stable ICU 2.0
*/
protected DateFormat handleGetDateFormat(String pattern, Locale locale) {
return handleGetDateFormat(pattern, ULocale.forLocale(locale));
return handleGetDateFormat(pattern, ULocale.forLocale(locale));
}
/**