ICU-4634 fallback parameter is backwards
X-SVN-Rev: 18179
This commit is contained in:
parent
681da53c75
commit
cecf675b8a
@ -1117,13 +1117,13 @@ public class ULocaleTest extends TestFmwk {
|
||||
private static Hashtable[] h = new Hashtable[2];
|
||||
|
||||
private static final String ACCEPT_LANGUAGE_TESTS[][] = {
|
||||
/*# result valid? */
|
||||
/*0*/ { "mt_MT", "true" },
|
||||
/*1*/ { "en", "true" },
|
||||
/*2*/ { "en", "false" }, // fell back from en-zzz to en
|
||||
/*3*/ { null, "false" },
|
||||
/*4*/ { "es", "true" },
|
||||
/*5*/ { "de", "true" }};
|
||||
/*# result fallback? */
|
||||
/*0*/ { "mt_MT", "false" },
|
||||
/*1*/ { "en", "false" },
|
||||
/*2*/ { "en", "true" }, // fell back from en-zzz to en
|
||||
/*3*/ { null, "true" },
|
||||
/*4*/ { "es", "false" },
|
||||
/*5*/ { "de", "false" }};
|
||||
|
||||
private static final String ACCEPT_LANGUAGE_HTTP[] = {
|
||||
/*0*/ "mt-mt, ja;q=0.76, en-us;q=0.95, en;q=0.92, en-gb;q=0.89, fr;q=0.87, iu-ca;q=0.84, iu;q=0.82, ja-jp;q=0.79, mt;q=0.97, de-de;q=0.74, de;q=0.71, es;q=0.68, it-it;q=0.66, it;q=0.63, vi-vn;q=0.61, vi;q=0.58, nl-nl;q=0.55, nl;q=0.53, th-th-traditional;q=.01",
|
||||
|
@ -2769,6 +2769,9 @@ public final class ULocale implements Serializable {
|
||||
availableLocales, boolean[] fallback) {
|
||||
// fallbacklist
|
||||
int i,j;
|
||||
if(fallback != null) {
|
||||
fallback[0]=true;
|
||||
}
|
||||
for(i=0;i<acceptLanguageList.length;i++) {
|
||||
ULocale aLocale = acceptLanguageList[i];
|
||||
boolean[] setFallback = fallback;
|
||||
@ -2776,7 +2779,7 @@ public final class ULocale implements Serializable {
|
||||
for(j=0;j<availableLocales.length;j++) {
|
||||
if(availableLocales[j].equals(aLocale)) {
|
||||
if(setFallback != null) {
|
||||
setFallback[0]=true;
|
||||
setFallback[0]=false; // first time with this locale - not a fallback.
|
||||
}
|
||||
return availableLocales[j];
|
||||
}
|
||||
@ -2788,7 +2791,7 @@ public final class ULocale implements Serializable {
|
||||
} else {
|
||||
aLocale = null;
|
||||
}
|
||||
setFallback = null; // don't set fallback[0] for fallbacks of the acceptList
|
||||
setFallback = null; // Do not set fallback in later iterations
|
||||
} while (aLocale != null);
|
||||
}
|
||||
return null;
|
||||
|
Loading…
Reference in New Issue
Block a user