mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-08 06:53:45 +00:00
ICU-5194 fallback to "root" instead of ""
X-SVN-Rev: 19607
This commit is contained in:
parent
d6d4d2f647
commit
696250f379
2 changed files with 10 additions and 5 deletions
|
@ -288,8 +288,8 @@ public class ICULocaleService extends ICUService {
|
|||
* otherwise return false.</p>
|
||||
*
|
||||
* <p>First falls back through the primary ID, then through
|
||||
* the fallbackID. The final fallback is the empty string,
|
||||
* unless the primary id was the empty string, in which case
|
||||
* the fallbackID. The final fallback is "root"
|
||||
* unless the primary id was "root", in which case
|
||||
* there is no fallback.
|
||||
*/
|
||||
public boolean fallback() {
|
||||
|
@ -301,8 +301,13 @@ public class ICULocaleService extends ICUService {
|
|||
return true;
|
||||
}
|
||||
if (fallbackID != null) {
|
||||
currentID = fallbackID;
|
||||
fallbackID = fallbackID.length() == 0 ? null : "";
|
||||
if (fallbackID.length() == 0) {
|
||||
currentID = "root";
|
||||
fallbackID = null;
|
||||
} else {
|
||||
currentID = fallbackID;
|
||||
fallbackID = "";
|
||||
}
|
||||
return true;
|
||||
}
|
||||
currentID = null;
|
||||
|
|
|
@ -229,7 +229,7 @@ public final class ULocale implements Serializable {
|
|||
* The root ULocale.
|
||||
* @stable ICU 2.8
|
||||
*/
|
||||
public static final ULocale ROOT = new ULocale(EMPTY_STRING, EMPTY_LOCALE);
|
||||
public static final ULocale ROOT = new ULocale("root", EMPTY_LOCALE);
|
||||
|
||||
private static final HashMap CACHE = new HashMap(20);
|
||||
static {
|
||||
|
|
Loading…
Add table
Reference in a new issue