Home
last modified time | relevance | path

Searched refs:candidateLocales (Results 1 - 5 of 5) sorted by relevance

/base/global/i18n/frameworks/intl/src/
H A Dlocale_matcher.cpp30 const std::vector<LocaleInfo*>& candidateLocales) in GetBestMatchedLocale()
32 if (candidateLocales.size() == 0) { in GetBestMatchedLocale()
35 LocaleInfo* bestMatch = candidateLocales[0]; in GetBestMatchedLocale()
36 for (size_t i = 1; i < candidateLocales.size(); ++i) { in GetBestMatchedLocale()
37 if (IsMoreSuitable(bestMatch, candidateLocales[i], requestLocale) < 0) { in GetBestMatchedLocale()
38 bestMatch = candidateLocales[i]; in GetBestMatchedLocale()
29 GetBestMatchedLocale(const LocaleInfo* requestLocale, const std::vector<LocaleInfo*>& candidateLocales) GetBestMatchedLocale() argument
H A Dpreferred_language.cpp111 std::vector<LocaleInfo*> candidateLocales; in GetMatchedLanguage() local
124 candidateLocales.push_back(supportLocaleInfo); in GetMatchedLanguage()
129 std::string matchedLanguage = LocaleMatcher::GetBestMatchedLocale(requestLocale, candidateLocales); in GetMatchedLanguage()
130 for (LocaleInfo* supportLocaleInfo : candidateLocales) { in GetMatchedLanguage()
/base/global/i18n/interfaces/js/kits/src/
H A Di18n_addon.cpp317 bool ProcessJsParamLocaleList(napi_env env, napi_value argv, std::vector<LocaleInfo*> &candidateLocales, in ProcessJsParamLocaleList() argument
338 candidateLocales.push_back(temp); in ProcessJsParamLocaleList()
346 void ReleaseParam(LocaleInfo *locale, std::vector<LocaleInfo*> &candidateLocales) in ReleaseParam() argument
349 for (auto it = candidateLocales.begin(); it != candidateLocales.end(); ++it) { in ReleaseParam()
369 std::vector<LocaleInfo*> candidateLocales; in GetBestMatchLocale() local
370 bool isValidParam = ProcessJsParamLocaleList(env, argv[1], candidateLocales, requestLocale); in GetBestMatchLocale()
372 ReleaseParam(requestLocale, candidateLocales); in GetBestMatchLocale()
376 if (candidateLocales.size() > 0) { in GetBestMatchLocale()
377 LocaleInfo *bestMatch = candidateLocales[ in GetBestMatchLocale()
[all...]
/base/global/i18n/interfaces/native/inner_api/i18n/include/
H A Dlocale_matcher.h27 * @brief Obtain the best matching locale from candidateLocales for the requestLocale.
30 * @param candidateLocales Represents the list of locale to be matched.
34 const std::vector<LocaleInfo*>& candidateLocales);
/base/global/i18n/frameworks/intl/test/unittest/
H A Dintl_test_extent.cpp1433 std::vector<LocaleInfo*> candidateLocales; in HWTEST_F() local
1438 candidateLocales.push_back(locale0); in HWTEST_F()
1439 candidateLocales.push_back(locale1); in HWTEST_F()
1440 candidateLocales.push_back(locale2); in HWTEST_F()
1441 candidateLocales.push_back(locale3); in HWTEST_F()
1442 std::string bestMatch = LocaleMatcher::GetBestMatchedLocale(request.get(), candidateLocales); in HWTEST_F()

Completed in 9 milliseconds