Lines Matching refs:Locale
243 Locale testLocale("");
245 testLocale = Locale(rawData[LANG][i], rawData[SCRIPT][i], rawData[CTRY][i], rawData[VAR][i]);
248 testLocale = Locale(rawData[LANG][i], rawData[CTRY][i], rawData[VAR][i]);
265 errln(" Locale name mismatch: " + temp + " versus "
271 Locale testLocale("");
273 testLocale = Locale(rawData[LANG][i], rawData[SCRIPT][i], rawData[CTRY][i]);
276 testLocale = Locale(rawData[LANG][i], rawData[CTRY][i]);
294 Locale test8 = Locale::createFromName("x-klingon-latn-zx.utf32be@special");
315 if (Locale::getDefault() != Locale::createFromName(NULL))
316 errln("Locale::getDefault() == Locale::createFromName(NULL)");
319 // NOTE: There used to be a special test for locale names that had language or
320 // country codes that were longer than two letters. The new version of Locale
324 Locale bogusLang("THISISABOGUSLANGUAGE"); // Jitterbug 2864: language code too long
326 errln("Locale(\"THISISABOGUSLANGUAGE\").isBogus()==FALSE");
329 bogusLang=Locale("eo");
336 errln("assignment to bogus Locale does not unbogus it or sets bad data");
339 Locale a("eo_DE@currency=DEM");
340 Locale *pb=a.clone();
342 errln("Locale.clone() failed");
349 if (strcmp(Locale::getChinese().getName(), ULOC_CHINESE) != 0) {
350 errln("Differences for ULOC_CHINESE Locale");
352 if (strcmp(Locale::getEnglish().getName(), ULOC_ENGLISH) != 0) {
353 errln("Differences for ULOC_ENGLISH Locale");
355 if (strcmp(Locale::getFrench().getName(), ULOC_FRENCH) != 0) {
356 errln("Differences for ULOC_FRENCH Locale");
358 if (strcmp(Locale::getGerman().getName(), ULOC_GERMAN) != 0) {
359 errln("Differences for ULOC_GERMAN Locale");
361 if (strcmp(Locale::getItalian().getName(), ULOC_ITALIAN) != 0) {
362 errln("Differences for ULOC_ITALIAN Locale");
364 if (strcmp(Locale::getJapanese().getName(), ULOC_JAPANESE) != 0) {
365 errln("Differences for ULOC_JAPANESE Locale");
367 if (strcmp(Locale::getKorean().getName(), ULOC_KOREAN) != 0) {
368 errln("Differences for ULOC_KOREAN Locale");
370 if (strcmp(Locale::getSimplifiedChinese().getName(), ULOC_SIMPLIFIED_CHINESE) != 0) {
371 errln("Differences for ULOC_SIMPLIFIED_CHINESE Locale");
373 if (strcmp(Locale
374 errln("Differences for ULOC_TRADITIONAL_CHINESE Locale");
378 if (strcmp(Locale::getCanada().getName(), ULOC_CANADA) != 0) {
379 errln("Differences for ULOC_CANADA Locale");
381 if (strcmp(Locale::getCanadaFrench().getName(), ULOC_CANADA_FRENCH) != 0) {
382 errln("Differences for ULOC_CANADA_FRENCH Locale");
384 if (strcmp(Locale::getChina().getName(), ULOC_CHINA) != 0) {
385 errln("Differences for ULOC_CHINA Locale");
387 if (strcmp(Locale::getPRC().getName(), ULOC_PRC) != 0) {
388 errln("Differences for ULOC_PRC Locale");
390 if (strcmp(Locale::getFrance().getName(), ULOC_FRANCE) != 0) {
391 errln("Differences for ULOC_FRANCE Locale");
393 if (strcmp(Locale::getGermany().getName(), ULOC_GERMANY) != 0) {
394 errln("Differences for ULOC_GERMANY Locale");
396 if (strcmp(Locale::getItaly().getName(), ULOC_ITALY) != 0) {
397 errln("Differences for ULOC_ITALY Locale");
399 if (strcmp(Locale::getJapan().getName(), ULOC_JAPAN) != 0) {
400 errln("Differences for ULOC_JAPAN Locale");
402 if (strcmp(Locale::getKorea().getName(), ULOC_KOREA) != 0) {
403 errln("Differences for ULOC_KOREA Locale");
405 if (strcmp(Locale::getTaiwan().getName(), ULOC_TAIWAN) != 0) {
406 errln("Differences for ULOC_TAIWAN Locale");
408 if (strcmp(Locale::getUK().getName(), ULOC_UK) != 0) {
409 errln("Differences for ULOC_UK Locale");
411 if (strcmp(Locale::getUS().getName(), ULOC_US) != 0) {
412 errln("Differences for ULOC_US Locale");
424 Locale testLocale(rawData[LANG][i], rawData[CTRY][i], rawData[VAR][i]);
446 Locale locale("en");
447 if(strcmp(locale.getName(), "en") != 0||
448 strcmp(locale.getLanguage(), "en") != 0) {
449 errln("construction of Locale(en) failed\n");
459 * locale because that yields useless results.
464 Locale english("en", "US");
465 Locale french("fr", "FR");
466 Locale croatian("ca", "ES");
467 Locale greek("el", "GR");
469 logln(" In locale = en_US...");
471 logln(" In locale = fr_FR...");
473 logln(" In locale = ca_ES...");
475 logln(" In locale = el_GR...");
483 /* Check to see if ICU supports this locale */
484 if (symb.getLocale(ULOC_VALID_LOCALE, status) != Locale("root")) {
485 /* test that the default locale has a display name for its own language */
486 /* Currently, there is no language information in the "tl" data file so this test will fail if default locale is "tl" */
487 if (uprv_strcmp(Locale().getLanguage(), "tl") != 0) {
488 Locale().getDisplayLanguage(Locale(), s);
491 dataerrln("unable to get a display string for the language of the default locale: " + s);
496 * Locale::getDisplayLanguage(UnicodeString &) and
497 * Locale::getDisplayCountry(UnicodeString &)
500 Locale().getDisplayLanguage(s);
502 dataerrln("unable to get a display string for the language of the default locale [2]: " + s);
507 logln("Default locale %s is unsupported by ICU\n", Locale().getName());
514 errln("unable to get any default-locale display string for the country of fr_FR\n");
517 Locale("zh", "Hant").getDisplayScript(s);
519 errln("unable to get any default-locale display string for the country of zh_Hant\n");
524 Locale test1("aa", "AA");
525 Locale test2("aa", "AA");
526 Locale test3(test1);
527 Locale test4("zz", "ZZ");
528 Locale test5("aa", "AA", "");
529 Locale test6("aa", "AA", "ANTARES");
530 Locale test7("aa", "AA", "JUPITER");
531 Locale test8 = Locale::createFromName("aa-aa-jupiTER"); // was "aa-aa.utf8@jupiter" but in 3.0 getName won't normalize that
619 class POSIXLocale : public Locale
623 :Locale()
632 :Locale()
642 Locale test3("ab","AB");
646 Locale test6("ab", "AB", "Antares");
681 const Locale* locList = Locale::getAvailableLocales(locCount);
704 temp = Locale::getDataDirectory();
708 Locale test(Locale::US);
717 Locale::setDataDirectory( path );
725 Locale::setDataDirectory(oldDirectory);
735 void LocaleTest::doTestDisplayNames(Locale& displayLocale, int32_t compareIndex) {
739 Locale testLocale("");
741 testLocale = Locale(rawData[LANG][i], rawData[SCRIPT][i], rawData[CTRY][i], rawData[VAR][i]);
744 testLocale = Locale(rawData[LANG][i], rawData[CTRY][i], rawData[VAR][i]);
828 Locale test("xx", "YY");
860 const char * const * test = Locale::getISOLanguages();
894 test = Locale::getISOCountries();
933 Locale enLoc ("en");
934 const Locale *pLocales = Locale::getAvailableLocales(numOfLocales);
937 const Locale &loc(pLocales[i]);
958 // fallback behavior, combination of language and country names to form locale
967 Locale l(languageCodes[i], "", "");
968 l.getDisplayLanguage(Locale::getUS(), test);
994 Locale l(iso2Languages[i], "", "");
1008 Locale l("", iso2Countries[i], "");
1019 * big locale-data reorg of 10/28/97. The lookup logic for language and country
1025 Locale localesToTest [] = { Locale("de", "CA"),
1026 Locale("ja", "ZA"),
1027 Locale("ru", "MX"),
1028 Locale("en", "FR"),
1029 Locale("es", "DE"),
1030 Locale("", "HR"),
1031 Locale("", "SE"),
1032 Locale("", "DO"),
1033 Locale("", "BE") };
1077 Locale saveLocale;
1078 Locale::setDefault(Locale::getUS(), status);
1081 localesToTest[i].getDisplayName(Locale::getUS(), name);
1087 logln("Locale name was-> " + (name=localesToTest[i].getName()));
1093 localesToTest[i].getDisplayName(Locale("es", "ES"), name);
1102 localesToTest[i].getDisplayName(Locale::getFrance(), name);
1111 localesToTest[i].getDisplayName(Locale("inv", "IN"), name);
1112 logln(name + " Locale fallback to be, and data fallback to root");
1116 localesToTest[i].getDisplayName(Locale("inv", "BD"), name);
1122 Locale::setDefault(saveLocale, status);
1137 Locale("th", "TH"), status);
1203 Locale loc (*locales);
1225 "\n*** THIS FAILURE MAY ONLY MEAN THAT LOCALE DATA HAS CHANGED ***");
1274 Locale DATA [] = {
1275 Locale("xx", "", ""),
1276 Locale("", "YY", ""),
1277 Locale("", "", "ZZ"),
1278 Locale("xx", "YY", ""),
1279 Locale("xx", "", "ZZ"),
1280 Locale("", "YY", "ZZ"),
1281 Locale("xx", "YY", "ZZ"),
1300 errln("Fail: Locale.getName(), got:" + UnicodeString(name) + ", expected: " + DATA_S[i]);
1303 logln("Pass: Locale.getName(), got:" + UnicodeString(name) );
1319 * LocaleData? Well, I could see by inspection that the locale file had the
1328 Locale mylocale("hu", "", "");
1333 dataerrln(UnicodeString("Could not create SimpleDateFormat object for locale hu. Error: ") + UnicodeString(u_errorName(status)));
1344 /* If the default locale is "th" this test will fail because of the buddhist calendar. */
1345 if (strcmp(Locale::getDefault().getLanguage(), "th") != 0) {
1380 Calendar *cal = Calendar::createInstance(Locale("ru", "", ""), status);
1393 * java.util.Locale.getISO3Country() works wrong for non ISO-3166 codes.
1402 Locale locale("xxx", "CCC");
1404 const char *result = locale.getISO3Country();
1409 " for locale '" + (temp=locale.getName()) + "' rather than exception" );
1414 * java.util.Locale.getISO3Language() works wrong for non ISO-3166 codes.
1423 Locale locale("xxx", "CCC");
1425 const char *result = locale.getISO3Language();
1430 " for locale '" + (temp=locale.getName()) + "' rather than exception" );
1439 Locale locales [] = { Locale("no", "NO"),
1440 Locale("no", "NO", "B"),
1441 Locale("no", "NO", "NY")
1462 Locale saveLocale;
1463 Locale::setDefault(Locale::getEnglish(), status);
1465 Locale loc = locales[i];
1475 Locale::setDefault(saveLocale, status);
1481 Locale en_US_custom("en", "US", "De Anza_Cupertino_California_United States_Earth");
1488 en_US_custom.getDisplayVariant(Locale::getUS(), got);
1495 en_US_custom.getDisplayName(Locale::getUS(), got);
1502 Locale shortVariant("fr", "FR", "foo");
1511 Locale bogusVariant("fr", "FR", "_foo");
1520 Locale bogusVariant2("fr", "FR", "foo_");
1529 Locale bogusVariant3("fr", "FR", "_foo_");
1549 Locale LOC [] = { Locale::getChinese(), Locale("zh", "CN", ""),
1550 Locale("zh", "TW", ""), Locale("zh", "HK", "") };
1571 // Tests setBogus and isBogus APIs for Locale
1575 Locale l("en_US");
1629 Locale l(testCases[i].localeID);
1715 Locale l(testCases[i].localeID);
1741 Locale l(Locale::getGerman());
1746 err("FAIL: Locale::setKeywordValue failed - %s\n", u_errorName(status));
1772 Locale loc(testCases[i].localeID);
1774 errln("For locale \"%s\" expected baseName \"%s\", but got \"%s\"",
1782 * Compare two locale
1811 const Locale& validLoc,
1812 const Locale& actualLoc,
1838 Locale valid, actual, reqLoc;
1843 Calendar* cal = Calendar::createInstance(Locale::createFromName(req), ec);
1867 NumberFormat* nf = NumberFormat::createInstance(Locale::createFromName(req), ec);
1905 Locale::createFromName(req));
1941 reqLoc = Locale::createFromName(req);
2003 reqLoc = Locale::createFromName(req);
2065 Locale loc("en","","POSIX");
2069 Locale loc2("en","","FOUR");
2073 Locale loc3("en","Latn","","FOUR");
2077 Locale loc4("","Latn","","FOUR");
2081 Locale loc5("","Latn","US","FOUR");
2085 Locale loc6("de-1901");
2091 static Locale _canonicalize(int32_t selector, /* 0==createFromName, 1==createCanonical, 2==Locale ct */
2095 return Locale::createFromName(localeID);
2097 return Locale::createCanonical(localeID);
2099 return Locale(localeID);
2101 return Locale("");
2155 // NOTE: uloc_getName() works on en-BOONT, but Locale() parser considers it BOGUS
2196 static const char* label[] = { "createFromName", "createCanonical", "Locale" };
2203 Locale loc = _canonicalize(j, testCases[i].localeID);
2278 // Locale AD has multiple currencies at once
2367 // Locale UA has gap between years 1994 - 1996
2393 // Test for bogus locale
2536 Locale l("en_US_VALLEY@foo=value");