Lines Matching refs:Locale
24 const char *locString(const Locale *loc) { in locString()
100 const Locale *best = matcher.getBestMatch(Locale::getFrench(), errorCode); in testEmpty()
126 Locale locales[] = { "fr", "en_GB", "en" }; in testBasics()
130 const Locale *best = matcher.getBestMatch("en_GB", errorCode); in testBasics()
141 std::vector<Locale> locales{ "fr", "en_GB", "en" }; in testBasics()
144 const Locale *best = matcher.getBestMatch("en_GB", errorCode); in testBasics()
154 Locale::RangeIterator<Locale *> iter(ARRAY_RANGE(locales)); in testBasics()
157 const Locale *best = matcher.getBestMatch("en_GB", errorCode); in testBasics()
167 Locale *pointers[] = { locales, locales + 1, locales + 2 }; in testBasics()
172 ARRAY_RANGE(pointers), [](const Locale *p) -> const Locale & { return *p; }). in testBasics()
174 const Locale *best = matcher.getBestMatch("en_GB", errorCode); in testBasics()
189 const Locale *best = matcher.getBestMatch("en_GB", errorCode); in testBasics()
203 const Locale *best = matcher.getBestMatchForListString("el, fr, fr;q=0, en-GB", errorCode); in testBasics()
218 addSupportedLocale(Locale::getEnglish()). in testBasics()
219 setDefaultLocale(&Locale::getGerman()). in testBasics()
221 const Locale *best = matcher.getBestMatch("en_GB", errorCode); in testBasics()
230 Locale desired("en_GB"); // distinct object from Locale.UK in testBasics()
246 desired = Locale("en", "US"); // distinct object from Locale.US in testBasics()
265 Locale locales[] = { "fr", "en_GB", "en" }; in testSupportedDefault()
270 const Locale *best = matcher.getBestMatch("en_GB", errorCode); in testSupportedDefault()
288 Locale locales[] = { "fr", "en_GB", "en" }; in testUnsupportedDefault()
289 Locale def("de"); in testUnsupportedDefault()
294 const Locale *best = matcher.getBestMatch("en_GB", errorCode); in testUnsupportedDefault()
312 Locale locales[] = { "fr", "en_GB", "en" }; in testNoDefault()
317 const Locale *best = matcher.getBestMatch("en_GB", errorCode); in testNoDefault()
334 Locale supported[] = { "fr", "de-CH", "it" }; in testDemotion()
335 Locale desired[] = { "fr-CH", "de-CH", "it" }; in testDemotion()
340 Locale::RangeIterator<Locale *> desiredIter(ARRAY_RANGE(desired)); in testDemotion()
349 Locale::RangeIterator<Locale *> desiredIter(ARRAY_RANGE(desired)); in testDemotion()
357 Locale supported[] = { "ar", "nn" }; in testDirection()
358 Locale desired[] = { "arz-EG", "nb-DK" }; in testDirection()
367 Locale::RangeIterator<Locale *> desiredIter(ARRAY_RANGE(desired)); in testDirection()
379 Locale::RangeIterator<Locale *> desiredIter(ARRAY_RANGE(desired)); in testDirection()
389 Locale germanLux("de-LU"); in testMaxDistanceAndIsMatch()
390 Locale germanPhoenician("de-Phnx-AT"); in testMaxDistanceAndIsMatch()
391 Locale greek("el"); in testMaxDistanceAndIsMatch()
392 assertTrue("standard de-LU / de", standard.isMatch(germanLux, Locale::getGerman(), errorCode)); in testMaxDistanceAndIsMatch()
394 standard.isMatch(germanPhoenician, Locale::getGerman(), errorCode)); in testMaxDistanceAndIsMatch()
398 builder.setMaxDistance(germanPhoenician, Locale::getGerman()).build(errorCode); in testMaxDistanceAndIsMatch()
399 assertTrue("loose de-LU / de", loose.isMatch(germanLux, Locale::getGerman(), errorCode)); in testMaxDistanceAndIsMatch()
401 loose.isMatch(germanPhoenician, Locale::getGerman(), errorCode)); in testMaxDistanceAndIsMatch()
402 assertFalse("loose el / de", loose.isMatch(greek, Locale::getGerman(), errorCode)); in testMaxDistanceAndIsMatch()
406 builder.setMaxDistance(Locale("de-AT"), Locale::getGerman()).build(errorCode); in testMaxDistanceAndIsMatch()
408 regional.isMatch(Locale("de-LU"), Locale::getGerman(), errorCode)); in testMaxDistanceAndIsMatch()
409 assertFalse("regional da / no", regional.isMatch(Locale("da"), Locale("no"), errorCode)); in testMaxDistanceAndIsMatch()
411 regional.isMatch(Locale::getChinese(), Locale::getTraditionalChinese(), errorCode)); in testMaxDistanceAndIsMatch()
420 Locale en_CA("en_CA"); in testMatch()
424 Locale ar_MK("ar_MK"); in testMatch()
429 Locale und_TW("und_TW"); in testMatch()
430 Locale zh("zh"); in testMatch()
431 Locale zh_Hant("zh_Hant"); in testMatch()
436 Locale en_Hant_TW("en_Hant_TW"); in testMatch()
449 Locale desired("ar-SA-u-nu-latn"); in testResolvedLocale()
452 Locale resolved = result.makeResolvedLocale(errorCode); in testResolvedLocale()
550 Locale *getLocaleOrNull(const CharString &s, Locale &locale) { in getLocaleOrNull()
554 return &(locale = Locale(s.data())); in getLocaleOrNull()
564 Locale defaultLocale(test.def.data()); in dataDriven()
591 Locale expMatchLocale(""); in dataDriven()
592 Locale *expMatch = getLocaleOrNull(test.expMatch, expMatchLocale); in dataDriven()
595 const Locale *bestSupported = matcher.getBestMatchForListString(desiredSP, errorCode); in dataDriven()
603 const Locale &desiredLocale = desiredIter.next(); in dataDriven()
623 Locale expDesiredLocale(""); in dataDriven()
624 Locale *expDesired = getLocaleOrNull(test.expDesired, expDesiredLocale); in dataDriven()
634 Locale expCombinedLocale(""); in dataDriven()
635 Locale *expCombined = getLocaleOrNull(test.expCombined, expCombinedLocale); in dataDriven()
636 Locale combined = result.makeResolvedLocale(errorCode); in dataDriven()