public abstract class LocaleHelperUtils extends Object
| 构造器 | 说明 |
|---|---|
LocaleHelperUtils() |
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
static ArrayList<String> |
getBlockedCities(Context context) |
Obtains a list of city IDs that are inappropriate for display in the current
locale.
|
static ArrayList<Locale> |
getBlockedLangs(Context context) |
Obtains a list of languages that are inappropriate for display in the current
locale.
|
static ArrayList<String> |
getBlockedLangs2String(Context context) |
Obtains a list of
String objects representing languages that are
inappropriate for display in the current locale. |
static ArrayList<String> |
getBlockedRegions(Context context,
Locale locale) |
Obtains a list of regions that are inappropriate for display in a given
locale.
|
static String |
getCityName(String city,
Locale displayLocale) |
Obtains the name of a specified city for a given locale.
|
static String |
getCountryName(Locale locale,
Locale displayLocale) |
Obtains the region name localized for display in a given locale.
|
static String |
getCountryName(Locale locale,
Locale displayLocale,
boolean sentenceCase) |
Obtains the region name localized for display in a given locale.
|
static String |
getLanguageName(Locale locale,
Locale displayLocale) |
Obtains the language name localized for display in a given locale.
|
static String |
getLanguageName(Locale locale,
Locale displayLocale,
boolean sentenceCase) |
Obtains the language name localized for display in a given locale.
|
static String |
replaceCountryName(Locale locale,
Locale displayLocale,
String display) |
Checks and replaces the currently displayed country or region name based on the specific rules
for the locale whose country or region name is to be replaced and the locale for which the country
or region name is to be displayed.
|
public static ArrayList<Locale> getBlockedLangs(Context context)
context - Indicates the context to use.public static ArrayList<String> getBlockedLangs2String(Context context)
String objects representing languages that are
inappropriate for display in the current locale.context - Indicates the context to use.String objects representing languages
inappropriate to the current locale.public static ArrayList<String> getBlockedRegions(Context context, Locale locale)
context - Indicates the context to use.locale - Indicates the locale for which the regions are inappropriate.public static ArrayList<String> getBlockedCities(Context context)
context - Indicates the context to use.public static String getCityName(String city, Locale displayLocale)
city - Indicates the city ID.displayLocale - Indicates the locale for which to display the city name.public static String replaceCountryName(Locale locale, Locale displayLocale, String display)
locale - Indicates the locale whose country or region name is to be
replaced.displayLocale - Indicates the locale for which to the country or region
name is to be displayed.display - Indicates the currently displayed country or region
name.public static String getCountryName(Locale locale, Locale displayLocale, boolean sentenceCase)
locale - Indicates the locale whose region name will be
displayed.displayLocale - Indicates the locale for which to display the region
name.sentenceCase - Specifies whether the region name is displayed in
sentence case. The value true indicates the
sentence case, and false indicates another case
style.public static String getCountryName(Locale locale, Locale displayLocale)
locale - Indicates the locale whose region name will be
displayed.displayLocale - Indicates the locale for which to display the region
name.public static String getLanguageName(Locale locale, Locale displayLocale, boolean sentenceCase)
locale - Indicates the locale whose country name will be
displayed.displayLocale - Indicates the locale for which to display the country
name.sentenceCase - Specifies whether the language name is displayed in
sentence case. The value true indicates the
sentence case, and false indicates another case
style.public static String getLanguageName(Locale locale, Locale displayLocale)
locale - Indicates the locale whose language name will be
displayed.displayLocale - Indicates the locale for which to display the language
name.