ICU-8031 Support for parent locales

X-SVN-Rev: 29443
This commit is contained in:
John Emmons 2011-02-16 13:46:19 +00:00
parent 395a1c7d15
commit 4b8773457a
41 changed files with 152 additions and 96 deletions

View File

@ -1,6 +1,6 @@
/*
******************************************************************************
* Copyright (C) 1997-2010, International Business Machines Corporation and *
* Copyright (C) 1997-2011, International Business Machines Corporation and *
* others. All Rights Reserved. *
******************************************************************************
*
@ -571,6 +571,17 @@ static UResourceDataEntry *entryOpen(const char* path, const char* localeID, UEr
}
}
while (hasChopped && !isRoot && t1->fParent == NULL && !t1->fData.noFallback) {
if ( res_getResource(&t1->fData,"%%Parent") != RES_BOGUS) { /* An explicit parent was found */
int32_t parentLocaleLen = 0;
const UChar *parentLocaleName = res_getString(&(t1->fData), res_getResource(&t1->fData,"%%Parent") , &parentLocaleLen);
if(parentLocaleName != NULL && parentLocaleLen > 0) {
u_UCharsToChars(parentLocaleName, name, parentLocaleLen+1);
if ( !uprv_strcmp(name,"root") ) { /* If parent is root, we just terminate the loop */
hasChopped = FALSE;
continue;
}
}
}
/* insert regular parents */
t2 = init_entry(name, t1->fPath, &parentStatus);
if ( usingUSRData ) { /* This code inserts user override data into the inheritance chain */
@ -583,28 +594,17 @@ static UResourceDataEntry *entryOpen(const char* path, const char* localeID, UEr
goto finishUnlock;
}
if ( res_getResource(&t1->fData,"%%ParentIsRoot") == RES_BOGUS) {
if ( usingUSRData && u2->fBogus == U_ZERO_ERROR ) {
t1->fParent = u2;
u2->fParent = t2;
} else {
t1->fParent = t2;
if(usingUSRData) {
/* the USR override data wasn't found, set it to be deleted */
u2->fCountExisting = 0;
}
}
t1 = t2;
if ( usingUSRData && u2->fBogus == U_ZERO_ERROR ) {
t1->fParent = u2;
u2->fParent = t2;
} else {
if (usingUSRData) {
t1->fParent = t2;
if(usingUSRData) {
/* the USR override data wasn't found, set it to be deleted */
u2->fCountExisting = 0;
}
/* t2->fCountExisting have to be decremented since the call to init_entry increments
* it and if we hit this code, that means it is not set as the parent.
*/
t2->fCountExisting--;
}
t1 = t2;
hasChopped = chopLocale(name);
}
}
@ -621,6 +621,17 @@ static UResourceDataEntry *entryOpen(const char* path, const char* localeID, UEr
hasRealData = TRUE;
isDefault = TRUE;
while (hasChopped && t1->fParent == NULL) {
if ( res_getResource(&t1->fData,"%%Parent") != RES_BOGUS) { /* An explicit parent was found */
int32_t parentLocaleLen = 0;
const UChar *parentLocaleName = res_getString(&(t1->fData), res_getResource(&t1->fData,"%%Parent") , &parentLocaleLen);
if(parentLocaleName != NULL && parentLocaleLen > 0) {
u_UCharsToChars(parentLocaleName, name, parentLocaleLen+1);
if ( !uprv_strcmp(name,"root") ) { /* If parent is root, we just terminate the loop */
hasChopped = FALSE;
continue;
}
}
}
/* insert chopped defaults */
t2 = init_entry(name, t1->fPath, &parentStatus);
/* Check for null pointer. */

View File

@ -1,6 +1,6 @@
// ***************************************************************************
// *
// * Copyright (C) 2010 International Business Machines
// * Copyright (C) 2011 International Business Machines
// * Corporation and others. All Rights Reserved.
// * Tool: com.ibm.icu.dev.tool.cldr.LDML2ICUConverter.java
// * Source File:<path>/common/main/az_Cyrl.xml
@ -10,7 +10,7 @@
* ICU <specials> source: <path>/xml/main/az_Cyrl.xml
*/
az_Cyrl{
%%ParentIsRoot:int{1}
%%Parent{"root"}
Currencies{
AZN{
"ман.",

View File

@ -1,6 +1,6 @@
// ***************************************************************************
// *
// * Copyright (C) 2010 International Business Machines
// * Copyright (C) 2011 International Business Machines
// * Corporation and others. All Rights Reserved.
// * Tool: com.ibm.icu.dev.tool.cldr.LDML2ICUConverter.java
// * Source File:<path>/common/main/pa_Arab.xml
@ -10,7 +10,7 @@
* ICU <specials> source: <path>/xml/main/pa_Arab.xml
*/
pa_Arab{
%%ParentIsRoot:int{1}
%%Parent{"root"}
Currencies{
EUR{
"€",

View File

@ -1,6 +1,6 @@
// ***************************************************************************
// *
// * Copyright (C) 2010 International Business Machines
// * Copyright (C) 2011 International Business Machines
// * Corporation and others. All Rights Reserved.
// * Tool: com.ibm.icu.dev.tool.cldr.LDML2ICUConverter.java
// * Source File:<path>/common/main/shi_Tfng.xml
@ -10,7 +10,7 @@
* ICU <specials> source: <path>/xml/main/shi_Tfng.xml
*/
shi_Tfng{
%%ParentIsRoot:int{1}
%%Parent{"root"}
Currencies{
AED{
"AED",

View File

@ -1,6 +1,6 @@
// ***************************************************************************
// *
// * Copyright (C) 2010 International Business Machines
// * Copyright (C) 2011 International Business Machines
// * Corporation and others. All Rights Reserved.
// * Tool: com.ibm.icu.dev.tool.cldr.LDML2ICUConverter.java
// * Source File:<path>/common/main/sr_Latn.xml
@ -10,7 +10,7 @@
* ICU <specials> source: <path>/xml/main/sr_Latn.xml
*/
sr_Latn{
%%ParentIsRoot:int{1}
%%Parent{"root"}
Currencies{
ADP{
"ADP" /** === */,

View File

@ -1,6 +1,6 @@
// ***************************************************************************
// *
// * Copyright (C) 2010 International Business Machines
// * Copyright (C) 2011 International Business Machines
// * Corporation and others. All Rights Reserved.
// * Tool: com.ibm.icu.dev.tool.cldr.LDML2ICUConverter.java
// * Source File:<path>/common/main/uz_Arab.xml
@ -10,7 +10,7 @@
* ICU <specials> source: <path>/xml/main/uz_Arab.xml
*/
uz_Arab{
%%ParentIsRoot:int{1}
%%Parent{"root"}
Currencies{
AFN{
"Af",

View File

@ -1,6 +1,6 @@
// ***************************************************************************
// *
// * Copyright (C) 2010 International Business Machines
// * Copyright (C) 2011 International Business Machines
// * Corporation and others. All Rights Reserved.
// * Tool: com.ibm.icu.dev.tool.cldr.LDML2ICUConverter.java
// * Source File:<path>/common/main/uz_Latn.xml
@ -10,7 +10,7 @@
* ICU <specials> source: <path>/xml/main/uz_Latn.xml
*/
uz_Latn{
%%ParentIsRoot:int{1}
%%Parent{"root"}
Currencies{
BRL{
"R$",

View File

@ -1,6 +1,6 @@
// ***************************************************************************
// *
// * Copyright (C) 2010 International Business Machines
// * Copyright (C) 2011 International Business Machines
// * Corporation and others. All Rights Reserved.
// * Tool: com.ibm.icu.dev.tool.cldr.LDML2ICUConverter.java
// * Source File:<path>/common/main/zh_Hant.xml
@ -10,7 +10,7 @@
* ICU <specials> source: <path>/xml/main/zh_Hant.xml
*/
zh_Hant{
%%ParentIsRoot:int{1}
%%Parent{"root"}
Currencies{
ADP{
"ADP" /** === */,

View File

@ -1,6 +1,6 @@
// ***************************************************************************
// *
// * Copyright (C) 2010 International Business Machines
// * Copyright (C) 2011 International Business Machines
// * Corporation and others. All Rights Reserved.
// * Tool: com.ibm.icu.dev.tool.cldr.LDML2ICUConverter.java
// * Source File:<path>/common/main/az_Cyrl.xml
@ -10,7 +10,7 @@
* ICU <specials> source: <path>/xml/main/az_Cyrl.xml
*/
az_Cyrl{
%%ParentIsRoot:int{1}
%%Parent{"root"}
Languages{
az{"Азәрбајҹан"}
de{"алманҹа"}

View File

@ -1,6 +1,6 @@
// ***************************************************************************
// *
// * Copyright (C) 2010 International Business Machines
// * Copyright (C) 2011 International Business Machines
// * Corporation and others. All Rights Reserved.
// * Tool: com.ibm.icu.dev.tool.cldr.LDML2ICUConverter.java
// * Source File:<path>/common/main/pa_Arab.xml
@ -10,7 +10,7 @@
* ICU <specials> source: <path>/xml/main/pa_Arab.xml
*/
pa_Arab{
%%ParentIsRoot:int{1}
%%Parent{"root"}
Languages{
pa{"پنجاب"}
}

View File

@ -1,6 +1,6 @@
// ***************************************************************************
// *
// * Copyright (C) 2010 International Business Machines
// * Copyright (C) 2011 International Business Machines
// * Corporation and others. All Rights Reserved.
// * Tool: com.ibm.icu.dev.tool.cldr.LDML2ICUConverter.java
// * Source File:<path>/common/main/shi_Tfng.xml
@ -10,7 +10,7 @@
* ICU <specials> source: <path>/xml/main/shi_Tfng.xml
*/
shi_Tfng{
%%ParentIsRoot:int{1}
%%Parent{"root"}
Languages{
ak{"ⵜⴰⴽⴰⵏⵜ"}
am{"ⵜⴰⵎⵀⴰⵔⵉⵜ"}

View File

@ -1,6 +1,6 @@
// ***************************************************************************
// *
// * Copyright (C) 2010 International Business Machines
// * Copyright (C) 2011 International Business Machines
// * Corporation and others. All Rights Reserved.
// * Tool: com.ibm.icu.dev.tool.cldr.LDML2ICUConverter.java
// * Source File:<path>/common/main/sr_Latn.xml
@ -10,7 +10,7 @@
* ICU <specials> source: <path>/xml/main/sr_Latn.xml
*/
sr_Latn{
%%ParentIsRoot:int{1}
%%Parent{"root"}
Keys{
calendar{"Kalendar"}
collation{"Sortiranje"}

View File

@ -1,6 +1,6 @@
// ***************************************************************************
// *
// * Copyright (C) 2010 International Business Machines
// * Copyright (C) 2011 International Business Machines
// * Corporation and others. All Rights Reserved.
// * Tool: com.ibm.icu.dev.tool.cldr.LDML2ICUConverter.java
// * Source File:<path>/common/main/uz_Arab.xml
@ -10,7 +10,7 @@
* ICU <specials> source: <path>/xml/main/uz_Arab.xml
*/
uz_Arab{
%%ParentIsRoot:int{1}
%%Parent{"root"}
Languages{
fa{"دری"}
ps{"پشتو"}

View File

@ -1,6 +1,6 @@
// ***************************************************************************
// *
// * Copyright (C) 2010 International Business Machines
// * Copyright (C) 2011 International Business Machines
// * Corporation and others. All Rights Reserved.
// * Tool: com.ibm.icu.dev.tool.cldr.LDML2ICUConverter.java
// * Source File:<path>/common/main/uz_Latn.xml
@ -10,7 +10,7 @@
* ICU <specials> source: <path>/xml/main/uz_Latn.xml
*/
uz_Latn{
%%ParentIsRoot:int{1}
%%Parent{"root"}
Languages{
ar{"arabcha"}
de{"olmoncha"}

View File

@ -1,6 +1,6 @@
// ***************************************************************************
// *
// * Copyright (C) 2010 International Business Machines
// * Copyright (C) 2011 International Business Machines
// * Corporation and others. All Rights Reserved.
// * Tool: com.ibm.icu.dev.tool.cldr.LDML2ICUConverter.java
// * Source File:<path>/common/main/zh_Hant.xml
@ -10,7 +10,7 @@
* ICU <specials> source: <path>/xml/main/zh_Hant.xml
*/
zh_Hant{
%%ParentIsRoot:int{1}
%%Parent{"root"}
Keys{
calendar{"日曆"}
collation{"校對"}

View File

@ -1,6 +1,6 @@
// ***************************************************************************
// *
// * Copyright (C) 2010 International Business Machines
// * Copyright (C) 2011 International Business Machines
// * Corporation and others. All Rights Reserved.
// * Tool: com.ibm.icu.dev.tool.cldr.LDML2ICUConverter.java
// * Source File:<path>/common/main/az_Cyrl.xml
@ -10,7 +10,7 @@
* ICU <specials> source: <path>/xml/main/az_Cyrl.xml
*/
az_Cyrl{
%%ParentIsRoot:int{1}
%%Parent{"root"}
AuxExemplarCharacters{"[ц щ ъ ь э ю я]"}
ExemplarCharacters{"[а ә б в г ғ д е ж з и й ј к ҝ л м н о ө п р с т у ү ф х һ ч ҹ ш ы]"}
LocaleScript{

View File

@ -1,6 +1,6 @@
// ***************************************************************************
// *
// * Copyright (C) 2010 International Business Machines
// * Copyright (C) 2011 International Business Machines
// * Corporation and others. All Rights Reserved.
// * Tool: com.ibm.icu.dev.tool.cldr.LDML2ICUConverter.java
// * Source File:<path>/common/main/pa_Arab.xml
@ -10,7 +10,7 @@
* ICU <specials> source: <path>/xml/main/pa_Arab.xml
*/
pa_Arab{
%%ParentIsRoot:int{1}
%%Parent{"root"}
AuxExemplarCharacters{"[أ ٻ ة ٺ ټ ٽ]"}
ExemplarCharacters{
"[\u064F ء آ ؤ ئ ا ب پ ت ث ٹ ج چ ح خ د ذ ڈ ر ز ڑ ژ س ش ص ض ط ظ ع غ ف ق ک گ ل "

View File

@ -1,6 +1,6 @@
// ***************************************************************************
// *
// * Copyright (C) 2010 International Business Machines
// * Copyright (C) 2011 International Business Machines
// * Corporation and others. All Rights Reserved.
// * Tool: com.ibm.icu.dev.tool.cldr.LDML2ICUConverter.java
// * Source File:<path>/common/main/shi_Tfng.xml
@ -10,7 +10,7 @@
* ICU <specials> source: <path>/xml/main/shi_Tfng.xml
*/
shi_Tfng{
%%ParentIsRoot:int{1}
%%Parent{"root"}
ExemplarCharacters{"[ⴰ ⴱ ⴳ {ⴳⵯ} ⴷ ⴻ ⴼ ⴽ {ⴽⵯ} ⵀ ⵃ ⵄ ⵅ ⵇ ⵉ ⵊ ⵍ ⵎ ⵖ ⵙ ⵚ ⵛ ⵜ ⵟ ⵡ ⵢ ⵣ ⵥ]"}
ExemplarCharactersIndex{"[ⴰ ⴱ ⴳ ⴷ ⴻ ⴼ ⴽ ⵀ ⵃ ⵄ ⵅ ⵇ ⵉ ⵊ ⵍ ⵎ ⵖ ⵙ ⵚ ⵛ ⵜ ⵟ ⵡ ⵢ ⵣ ⵥ]"}
LocaleScript{

View File

@ -1,6 +1,6 @@
// ***************************************************************************
// *
// * Copyright (C) 2010 International Business Machines
// * Copyright (C) 2011 International Business Machines
// * Corporation and others. All Rights Reserved.
// * Tool: com.ibm.icu.dev.tool.cldr.LDML2ICUConverter.java
// * Source File:<path>/common/main/sr_Latn.xml
@ -10,7 +10,7 @@
* ICU <specials> source: <path>/xml/main/sr_Latn.xml
*/
sr_Latn{
%%ParentIsRoot:int{1}
%%Parent{"root"}
AuxExemplarCharacters{"[q w x y]"}
ExemplarCharacters{"[a b c č ć d đ {dž} e f g h i j k l {lj} m n {nj} o p r s š t u v z ž]"}
LocaleScript{

View File

@ -1,6 +1,6 @@
// ***************************************************************************
// *
// * Copyright (C) 2010 International Business Machines
// * Copyright (C) 2011 International Business Machines
// * Corporation and others. All Rights Reserved.
// * Tool: com.ibm.icu.dev.tool.cldr.LDML2ICUConverter.java
// * Source File:<path>/common/main/uz_Arab.xml
@ -10,7 +10,7 @@
* ICU <specials> source: <path>/xml/main/uz_Arab.xml
*/
uz_Arab{
%%ParentIsRoot:int{1}
%%Parent{"root"}
AuxExemplarCharacters{"[\u200C \u200D]"}
ExemplarCharacters{
"[\u064B \u064C \u064D \u064E \u064F \u0650 \u0651 \u0652 \u0654 \u0670 ء آ أ"

View File

@ -1,6 +1,6 @@
// ***************************************************************************
// *
// * Copyright (C) 2010 International Business Machines
// * Copyright (C) 2011 International Business Machines
// * Corporation and others. All Rights Reserved.
// * Tool: com.ibm.icu.dev.tool.cldr.LDML2ICUConverter.java
// * Source File:<path>/common/main/uz_Latn.xml
@ -10,7 +10,7 @@
* ICU <specials> source: <path>/xml/main/uz_Latn.xml
*/
uz_Latn{
%%ParentIsRoot:int{1}
%%Parent{"root"}
ExemplarCharacters{"[a b c d e f g h i j k l m n o p q r s t u v x y z ʿ]"}
ExemplarCharactersIndex{"[A B C D E F G H I J K L M N O P Q R S T U V W X Y Z ʿ]"}
LocaleScript{

View File

@ -1,6 +1,6 @@
// ***************************************************************************
// *
// * Copyright (C) 2010 International Business Machines
// * Copyright (C) 2011 International Business Machines
// * Corporation and others. All Rights Reserved.
// * Tool: com.ibm.icu.dev.tool.cldr.LDML2ICUConverter.java
// * Source File:<path>/common/main/zh_Hant.xml
@ -10,7 +10,7 @@
* ICU <specials> source: <path>/xml/main/zh_Hant.xml
*/
zh_Hant{
%%ParentIsRoot:int{1}
%%Parent{"root"}
AuxExemplarCharacters{"[伏 侶 兌 兹 别 勳 卑 占 叶 堤 墎 奥 孜 峇 巽 彝 楔 渾 燦 狄 琳 瑚 甫 礁 芒 苗 茨 蚩 蜀 隴]"}
ExemplarCharacters{
"[一 丁 七 丈-不 且 世 丘 丙 丟 並 中 串 丸 丹 主 乃 久 么 之 乎 乏 乖 乘 乙 九 也 乾 亂 了 予 事 二 于 云 互 五 井"

View File

@ -1,6 +1,6 @@
// ***************************************************************************
// *
// * Copyright (C) 2010 International Business Machines
// * Copyright (C) 2011 International Business Machines
// * Corporation and others. All Rights Reserved.
// * Tool: com.ibm.icu.dev.tool.cldr.LDML2ICUConverter.java
// * Source File:<path>/common/rbnf/sr_Latn.xml
@ -10,7 +10,7 @@
* ICU <specials> source: <path>/xml/rbnf/sr_Latn.xml
*/
sr_Latn{
%%ParentIsRoot:int{1}
%%Parent{"root"}
RBNFRules{
SpelloutRules{
"%spellout-numbering-year:",

View File

@ -1,6 +1,6 @@
// ***************************************************************************
// *
// * Copyright (C) 2010 International Business Machines
// * Copyright (C) 2011 International Business Machines
// * Corporation and others. All Rights Reserved.
// * Tool: com.ibm.icu.dev.tool.cldr.LDML2ICUConverter.java
// * Source File:<path>/common/rbnf/zh_Hant.xml
@ -10,7 +10,7 @@
* ICU <specials> source: <path>/xml/rbnf/zh_Hant.xml
*/
zh_Hant{
%%ParentIsRoot:int{1}
%%Parent{"root"}
RBNFRules{
OrdinalRules{
"%digits-ordinal:",

View File

@ -1,6 +1,6 @@
// ***************************************************************************
// *
// * Copyright (C) 2010 International Business Machines
// * Copyright (C) 2011 International Business Machines
// * Corporation and others. All Rights Reserved.
// * Tool: com.ibm.icu.dev.tool.cldr.LDML2ICUConverter.java
// * Source File:<path>/common/main/az_Cyrl.xml
@ -10,7 +10,7 @@
* ICU <specials> source: <path>/xml/main/az_Cyrl.xml
*/
az_Cyrl{
%%ParentIsRoot:int{1}
%%Parent{"root"}
Countries{
AZ{"Азәрбајҹан"}
BR{"Бразилија"}

View File

@ -1,6 +1,6 @@
// ***************************************************************************
// *
// * Copyright (C) 2010 International Business Machines
// * Copyright (C) 2011 International Business Machines
// * Corporation and others. All Rights Reserved.
// * Tool: com.ibm.icu.dev.tool.cldr.LDML2ICUConverter.java
// * Source File:<path>/common/main/pa_Arab.xml
@ -10,7 +10,7 @@
* ICU <specials> source: <path>/xml/main/pa_Arab.xml
*/
pa_Arab{
%%ParentIsRoot:int{1}
%%Parent{"root"}
Countries{
PK{"پکستان"}
}

View File

@ -1,6 +1,6 @@
// ***************************************************************************
// *
// * Copyright (C) 2010 International Business Machines
// * Copyright (C) 2011 International Business Machines
// * Corporation and others. All Rights Reserved.
// * Tool: com.ibm.icu.dev.tool.cldr.LDML2ICUConverter.java
// * Source File:<path>/common/main/shi_Tfng.xml
@ -10,7 +10,7 @@
* ICU <specials> source: <path>/xml/main/shi_Tfng.xml
*/
shi_Tfng{
%%ParentIsRoot:int{1}
%%Parent{"root"}
Countries{
AD{"ⴰⵏⴷⵓⵔⴰ"}
AE{"ⵍⵉⵎⴰⵔⴰⵜ"}

View File

@ -1,6 +1,6 @@
// ***************************************************************************
// *
// * Copyright (C) 2010 International Business Machines
// * Copyright (C) 2011 International Business Machines
// * Corporation and others. All Rights Reserved.
// * Tool: com.ibm.icu.dev.tool.cldr.LDML2ICUConverter.java
// * Source File:<path>/common/main/sr_Latn.xml
@ -10,7 +10,7 @@
* ICU <specials> source: <path>/xml/main/sr_Latn.xml
*/
sr_Latn{
%%ParentIsRoot:int{1}
%%Parent{"root"}
Countries{
001{"Svet"}
002{"Afrika"}

View File

@ -1,6 +1,6 @@
// ***************************************************************************
// *
// * Copyright (C) 2010 International Business Machines
// * Copyright (C) 2011 International Business Machines
// * Corporation and others. All Rights Reserved.
// * Tool: com.ibm.icu.dev.tool.cldr.LDML2ICUConverter.java
// * Source File:<path>/common/main/uz_Arab.xml
@ -10,7 +10,7 @@
* ICU <specials> source: <path>/xml/main/uz_Arab.xml
*/
uz_Arab{
%%ParentIsRoot:int{1}
%%Parent{"root"}
Countries{
AF{"افغانستان"}
}

View File

@ -1,6 +1,6 @@
// ***************************************************************************
// *
// * Copyright (C) 2010 International Business Machines
// * Copyright (C) 2011 International Business Machines
// * Corporation and others. All Rights Reserved.
// * Tool: com.ibm.icu.dev.tool.cldr.LDML2ICUConverter.java
// * Source File:<path>/common/main/uz_Latn.xml
@ -10,7 +10,7 @@
* ICU <specials> source: <path>/xml/main/uz_Latn.xml
*/
uz_Latn{
%%ParentIsRoot:int{1}
%%Parent{"root"}
Countries{
AF{"Afgʿoniston"}
BR{"Braziliya"}

View File

@ -1,6 +1,6 @@
// ***************************************************************************
// *
// * Copyright (C) 2010 International Business Machines
// * Copyright (C) 2011 International Business Machines
// * Corporation and others. All Rights Reserved.
// * Tool: com.ibm.icu.dev.tool.cldr.LDML2ICUConverter.java
// * Source File:<path>/common/main/zh_Hant.xml
@ -10,7 +10,7 @@
* ICU <specials> source: <path>/xml/main/zh_Hant.xml
*/
zh_Hant{
%%ParentIsRoot:int{1}
%%Parent{"root"}
Countries{
014{"東非"}
018{"非洲南部"}

View File

@ -1,6 +1,6 @@
// ***************************************************************************
// *
// * Copyright (C) 2010 International Business Machines
// * Copyright (C) 2011 International Business Machines
// * Corporation and others. All Rights Reserved.
// * Tool: com.ibm.icu.dev.tool.cldr.LDML2ICUConverter.java
// * Source File:<path>/common/main/az_Cyrl.xml
@ -10,6 +10,6 @@
* ICU <specials> source: <path>/xml/main/az_Cyrl.xml
*/
az_Cyrl{
%%ParentIsRoot:int{1}
%%Parent{"root"}
Version{"2.0.47.53"}
}

View File

@ -1,6 +1,6 @@
// ***************************************************************************
// *
// * Copyright (C) 2010 International Business Machines
// * Copyright (C) 2011 International Business Machines
// * Corporation and others. All Rights Reserved.
// * Tool: com.ibm.icu.dev.tool.cldr.LDML2ICUConverter.java
// * Source File:<path>/common/main/pa_Arab.xml
@ -10,6 +10,6 @@
* ICU <specials> source: <path>/xml/main/pa_Arab.xml
*/
pa_Arab{
%%ParentIsRoot:int{1}
%%Parent{"root"}
Version{"2.0.50.30"}
}

View File

@ -1,6 +1,6 @@
// ***************************************************************************
// *
// * Copyright (C) 2010 International Business Machines
// * Copyright (C) 2011 International Business Machines
// * Corporation and others. All Rights Reserved.
// * Tool: com.ibm.icu.dev.tool.cldr.LDML2ICUConverter.java
// * Source File:<path>/common/main/shi_Tfng.xml
@ -10,6 +10,6 @@
* ICU <specials> source: <path>/xml/main/shi_Tfng.xml
*/
shi_Tfng{
%%ParentIsRoot:int{1}
%%Parent{"root"}
Version{"2.0.46.25"}
}

View File

@ -1,6 +1,6 @@
// ***************************************************************************
// *
// * Copyright (C) 2010 International Business Machines
// * Copyright (C) 2011 International Business Machines
// * Corporation and others. All Rights Reserved.
// * Tool: com.ibm.icu.dev.tool.cldr.LDML2ICUConverter.java
// * Source File:<path>/common/main/sr_Latn.xml
@ -10,7 +10,7 @@
* ICU <specials> source: <path>/xml/main/sr_Latn.xml
*/
sr_Latn{
%%ParentIsRoot:int{1}
%%Parent{"root"}
Version{"2.0.50.94"}
zoneStrings{
"Africa:Abidjan"{

View File

@ -1,6 +1,6 @@
// ***************************************************************************
// *
// * Copyright (C) 2010 International Business Machines
// * Copyright (C) 2011 International Business Machines
// * Corporation and others. All Rights Reserved.
// * Tool: com.ibm.icu.dev.tool.cldr.LDML2ICUConverter.java
// * Source File:<path>/common/main/uz_Arab.xml
@ -10,6 +10,6 @@
* ICU <specials> source: <path>/xml/main/uz_Arab.xml
*/
uz_Arab{
%%ParentIsRoot:int{1}
%%Parent{"root"}
Version{"2.0.50.30"}
}

View File

@ -1,6 +1,6 @@
// ***************************************************************************
// *
// * Copyright (C) 2010 International Business Machines
// * Copyright (C) 2011 International Business Machines
// * Corporation and others. All Rights Reserved.
// * Tool: com.ibm.icu.dev.tool.cldr.LDML2ICUConverter.java
// * Source File:<path>/common/main/uz_Latn.xml
@ -10,6 +10,6 @@
* ICU <specials> source: <path>/xml/main/uz_Latn.xml
*/
uz_Latn{
%%ParentIsRoot:int{1}
%%Parent{"root"}
Version{"2.0.47.68"}
}

View File

@ -1,6 +1,6 @@
// ***************************************************************************
// *
// * Copyright (C) 2010 International Business Machines
// * Copyright (C) 2011 International Business Machines
// * Corporation and others. All Rights Reserved.
// * Tool: com.ibm.icu.dev.tool.cldr.LDML2ICUConverter.java
// * Source File:<path>/common/main/zh_Hant.xml
@ -10,7 +10,7 @@
* ICU <specials> source: <path>/xml/main/zh_Hant.xml
*/
zh_Hant{
%%ParentIsRoot:int{1}
%%Parent{"root"}
Version{"2.0.50.94"}
zoneStrings{
"Africa:Accra"{

View File

@ -1,6 +1,6 @@
/********************************************************************
* COPYRIGHT:
* Copyright (c) 1997-2010, International Business Machines Corporation and
* Copyright (c) 1997-2011, International Business Machines Corporation and
* others. All Rights Reserved.
********************************************************************/
/* Modification History:
@ -111,6 +111,7 @@ void NumberFormatTest::runIndexedTest( int32_t index, UBool exec, const char* &n
CASE(47,TestDecimal);
CASE(48,TestCurrencyFractionDigits);
CASE(49,TestExponentParse);
CASE(50,TestExplicitParents);
default: name = ""; break;
}
}
@ -6223,4 +6224,47 @@ void NumberFormatTest::TestExponentParse() {
}
}
void NumberFormatTest::TestExplicitParents() {
/* Test that number formats are properly inherited from es_419 */
/* These could be subject to change if the CLDR data changes */
static const char* parentLocaleTests[][2]= {
/* locale ID */ /* expected */
{"es_CO", "1.250,75" },
{"es_CR", "1.250,75" },
{"es_ES", "1.250,75" },
{"es_GQ", "1.250,75" },
{"es_MX", "1,250.75" },
{"es_US", "1,250.75" },
{"es_VE", "1.250,75" },
};
UnicodeString s;
for(int i=0; i < (int)(sizeof(parentLocaleTests)/sizeof(parentLocaleTests[i])); i++){
UErrorCode status = U_ZERO_ERROR;
const char *localeID = parentLocaleTests[i][0];
UnicodeString expected(parentLocaleTests[i][1], -1, US_INV);
expected = expected.unescape();
char loc[256]={0};
uloc_canonicalize(localeID, loc, 256, &status);
NumberFormat *fmt= NumberFormat::createInstance(Locale(loc), status);
if(U_FAILURE(status)){
errln("Could not create number formatter for locale %s",localeID);
continue;
}
s.remove();
fmt->format(1250.75, s);
if(s!=expected){
errln(UnicodeString("FAIL: Expected: ")+expected
+ UnicodeString(" Got: ") + s
+ UnicodeString( " for locale: ")+ UnicodeString(localeID) );
}
if (U_FAILURE(status)){
errln((UnicodeString)"FAIL: Status " + (int32_t)status);
}
delete fmt;
}
}
#endif /* #if !UCONFIG_NO_FORMATTING */

View File

@ -1,6 +1,6 @@
/************************************************************************
* COPYRIGHT:
* Copyright (c) 1997-2010, International Business Machines Corporation
* Copyright (c) 1997-2011, International Business Machines Corporation
* and others. All Rights Reserved.
************************************************************************/
@ -149,6 +149,7 @@ class NumberFormatTest: public CalendarTimeZoneTest {
void TestCurrencyFractionDigits();
void TestExponentParse();
void TestExplicitParents();
private:

View File

@ -1,6 +1,6 @@
// ***************************************************************************
// *
// * Copyright (C) 2004-2010 International Business Machines
// * Copyright (C) 2004-2011 International Business Machines
// * Corporation and others. All Rights Reserved.
// *
// ***************************************************************************
@ -10,7 +10,7 @@
// root can't be used to validate the structure.
// This file was generated from en.txt, and all ".*" were replaced with "".
structLocale:table(nofallback){
%%ParentIsRoot:int{0}
%%Parent{""}
BreakDictionaryData:bin {00}
Countries{
001{""}