/** * Returns the string representation of this {@code Locale}. It consists of the * language code, country code and variant separated by underscores. * If the language is missing the string begins * with an underscore. If the country is missing there are 2 underscores * between the language and the variant. The variant cannot stand alone * without a language and/or country code: in this case this method would * return the empty string. * * <p>Examples: "en", "en_US", "_US", "en__POSIX", "en_US_POSIX" */ @Override public final String toString() { String result = cachedToStringResult; if (result == null) { result = cachedToStringResult = toNewString(languageCode, countryCode, variantCode); } return result; }
/** * Returns the string representation of this {@code Locale}. It consists of the * language code, country code and variant separated by underscores. * If the language is missing the string begins * with an underscore. If the country is missing there are 2 underscores * between the language and the variant. The variant cannot stand alone * without a language and/or country code: in this case this method would * return the empty string. * * <p>Examples: "en", "en_US", "_US", "en__POSIX", "en_US_POSIX" */ @Override public final String toString() { String result = cachedToStringResult; if (result == null) { result = cachedToStringResult = toNewString(languageCode, countryCode, variantCode); } return result; }
/** * Returns the string representation of this {@code Locale}. It consists of the * language code, country code and variant separated by underscores. * If the language is missing the string begins * with an underscore. If the country is missing there are 2 underscores * between the language and the variant. The variant cannot stand alone * without a language and/or country code: in this case this method would * return the empty string. * * <p>Examples: "en", "en_US", "_US", "en__POSIX", "en_US_POSIX" */ @Override public final String toString() { String result = cachedToStringResult; if (result == null) { result = cachedToStringResult = toNewString(languageCode, countryCode, variantCode); } return result; }
/** * Returns the name of this locale's language, localized to {@code locale}. * If the language name is unknown, the language code is returned. */ public String getDisplayLanguage(Locale locale) { if (languageCode.isEmpty()) { return ""; } // http://b/8049507 --- frameworks/base should use fil_PH instead of tl_PH. // Until then, we're stuck covering their tracks, making it look like they're // using "fil" when they're not. String localeString = toString(); if (languageCode.equals("tl")) { localeString = toNewString("fil", countryCode, variantCode); } String result = ICU.getDisplayLanguageNative(localeString, locale.toString()); if (result == null) { // TODO: do we need to do this, or does ICU do it for us? result = ICU.getDisplayLanguageNative(localeString, Locale.getDefault().toString()); } return result; }
@Override public final String toString() { String result = cachedToStringResult; if (result == null) result = cachedToStringResult = toNewString(languageCode, countryCode, variantCode); return result; }
/** * Returns the string representation of this {@code Locale}. It consists of the * language code, country code and variant separated by underscores. * If the language is missing the string begins * with an underscore. If the country is missing there are 2 underscores * between the language and the variant. The variant cannot stand alone * without a language and/or country code: in this case this method would * return the empty string. * * <p>Examples: "en", "en_US", "_US", "en__POSIX", "en_US_POSIX" */ @Override public final String toString() { String result = cachedToStringResult; if (result == null) { result = cachedToStringResult = toNewString(languageCode, countryCode, variantCode); } return result; }
/** * Returns the string representation of this {@code Locale}. It consists of the * language code, country code and variant separated by underscores. * If the language is missing the string begins * with an underscore. If the country is missing there are 2 underscores * between the language and the variant. The variant cannot stand alone * without a language and/or country code: in this case this method would * return the empty string. * * <p>Examples: "en", "en_US", "_US", "en__POSIX", "en_US_POSIX" */ @Override public final String toString() { String result = cachedToStringResult; if (result == null) { result = cachedToStringResult = toNewString(languageCode, countryCode, variantCode); } return result; }
/** * Returns the string representation of this {@code Locale}. It consists of the * language code, country code and variant separated by underscores. * If the language is missing the string begins * with an underscore. If the country is missing there are 2 underscores * between the language and the variant. The variant cannot stand alone * without a language and/or country code: in this case this method would * return the empty string. * * <p>Examples: "en", "en_US", "_US", "en__POSIX", "en_US_POSIX" */ @Override public final String toString() { String result = cachedToStringResult; if (result == null) { result = cachedToStringResult = toNewString(languageCode, countryCode, variantCode); } return result; }
/** * Returns the string representation of this {@code Locale}. It consists of the * language code, country code and variant separated by underscores. * If the language is missing the string begins * with an underscore. If the country is missing there are 2 underscores * between the language and the variant. The variant cannot stand alone * without a language and/or country code: in this case this method would * return the empty string. * * <p>Examples: "en", "en_US", "_US", "en__POSIX", "en_US_POSIX" */ @Override public final String toString() { String result = cachedToStringResult; if (result == null) { result = cachedToStringResult = toNewString(languageCode, countryCode, variantCode); } return result; }
/** * Returns the string representation of this {@code Locale}. It consists of the * language code, country code and variant separated by underscores. * If the language is missing the string begins * with an underscore. If the country is missing there are 2 underscores * between the language and the variant. The variant cannot stand alone * without a language and/or country code: in this case this method would * return the empty string. * * <p>Examples: "en", "en_US", "_US", "en__POSIX", "en_US_POSIX" */ @Override public final String toString() { String result = cachedToStringResult; if (result == null) { result = cachedToStringResult = toNewString(languageCode, countryCode, variantCode); } return result; }
/** * Returns the string representation of this {@code Locale}. It consists of the * language code, country code and variant separated by underscores. * If the language is missing the string begins * with an underscore. If the country is missing there are 2 underscores * between the language and the variant. The variant cannot stand alone * without a language and/or country code: in this case this method would * return the empty string. * * <p>Examples: "en", "en_US", "_US", "en__POSIX", "en_US_POSIX" */ @Override public final String toString() { String result = cachedToStringResult; if (result == null) { result = cachedToStringResult = toNewString(languageCode, countryCode, variantCode); } return result; }
/** * Returns the string representation of this {@code Locale}. It consists of the * language code, country code and variant separated by underscores. * If the language is missing the string begins * with an underscore. If the country is missing there are 2 underscores * between the language and the variant. The variant cannot stand alone * without a language and/or country code: in this case this method would * return the empty string. * * <p>Examples: "en", "en_US", "_US", "en__POSIX", "en_US_POSIX" */ @Override public final String toString() { String result = cachedToStringResult; if (result == null) { result = cachedToStringResult = toNewString(languageCode, countryCode, variantCode); } return result; }
/** * Returns the string representation of this {@code Locale}. It consists of the * language code, country code and variant separated by underscores. * If the language is missing the string begins * with an underscore. If the country is missing there are 2 underscores * between the language and the variant. The variant cannot stand alone * without a language and/or country code: in this case this method would * return the empty string. * * <p>Examples: "en", "en_US", "_US", "en__POSIX", "en_US_POSIX" */ @Override public final String toString() { String result = cachedToStringResult; if (result == null) { result = cachedToStringResult = toNewString(languageCode, countryCode, variantCode); } return result; }
public String getDisplayLanguage(Locale locale) { if (languageCode.isEmpty()) return ""; // http://b/8049507 --- frameworks/base should use fil_PH instead of tl_PH. // Until then, we're stuck covering their tracks, making it look like they're // using "fil" when they're not. String localeString = toString(); if (languageCode.equals("tl")) { localeString = toNewString("fil", countryCode, variantCode); } //String result = ICU.getDisplayLanguageNative(localeString, locale.toString()); //if (result == null) { // TODO: do we need to do this, or does ICU do it for us? // result = ICU.getDisplayLanguageNative(localeString, Locale.getDefault().toString()); //} //return result; return languageCode; }
/** * Returns the name of this locale's language, localized to {@code locale}. * If the language name is unknown, the language code is returned. */ public String getDisplayLanguage(Locale locale) { if (languageCode.isEmpty()) { return ""; } // http://b/8049507 --- frameworks/base should use fil_PH instead of tl_PH. // Until then, we're stuck covering their tracks, making it look like they're // using "fil" when they're not. String localeString = toString(); if (languageCode.equals("tl")) { localeString = toNewString("fil", countryCode, variantCode); } String result = ICU.getDisplayLanguageNative(localeString, locale.toString()); if (result == null) { // TODO: do we need to do this, or does ICU do it for us? result = ICU.getDisplayLanguageNative(localeString, Locale.getDefault().toString()); } return result; }
/** * Returns the name of this locale's language, localized to {@code locale}. * If the language name is unknown, the language code is returned. */ public String getDisplayLanguage(Locale locale) { if (languageCode.isEmpty()) { return ""; } // http://b/8049507 --- frameworks/base should use fil_PH instead of tl_PH. // Until then, we're stuck covering their tracks, making it look like they're // using "fil" when they're not. String localeString = toString(); if (languageCode.equals("tl")) { localeString = toNewString("fil", countryCode, variantCode); } String result = ICU.getDisplayLanguageNative(localeString, locale.toString()); if (result == null) { // TODO: do we need to do this, or does ICU do it for us? result = ICU.getDisplayLanguageNative(localeString, Locale.getDefault().toString()); } return result; }
/** * Returns the name of this locale's language, localized to {@code locale}. * If the language name is unknown, the language code is returned. */ public String getDisplayLanguage(Locale locale) { if (languageCode.isEmpty()) { return ""; } // http://b/8049507 --- frameworks/base should use fil_PH instead of tl_PH. // Until then, we're stuck covering their tracks, making it look like they're // using "fil" when they're not. String localeString = toString(); if (languageCode.equals("tl")) { localeString = toNewString("fil", countryCode, variantCode); } String result = ICU.getDisplayLanguageNative(localeString, locale.toString()); if (result == null) { // TODO: do we need to do this, or does ICU do it for us? result = ICU.getDisplayLanguageNative(localeString, Locale.getDefault().toString()); } return result; }
/** * Returns the name of this locale's language, localized to {@code locale}. * If the language name is unknown, the language code is returned. */ public String getDisplayLanguage(Locale locale) { if (languageCode.isEmpty()) { return ""; } // http://b/8049507 --- frameworks/base should use fil_PH instead of tl_PH. // Until then, we're stuck covering their tracks, making it look like they're // using "fil" when they're not. String localeString = toString(); if (languageCode.equals("tl")) { localeString = toNewString("fil", countryCode, variantCode); } String result = ICU.getDisplayLanguageNative(localeString, locale.toString()); if (result == null) { // TODO: do we need to do this, or does ICU do it for us? result = ICU.getDisplayLanguageNative(localeString, Locale.getDefault().toString()); } return result; }
/** * Returns the name of this locale's language, localized to {@code locale}. * If the language name is unknown, the language code is returned. */ public String getDisplayLanguage(Locale locale) { if (languageCode.isEmpty()) { return ""; } // http://b/8049507 --- frameworks/base should use fil_PH instead of tl_PH. // Until then, we're stuck covering their tracks, making it look like they're // using "fil" when they're not. String localeString = toString(); if (languageCode.equals("tl")) { localeString = toNewString("fil", countryCode, variantCode); } String result = ICU.getDisplayLanguageNative(localeString, locale.toString()); if (result == null) { // TODO: do we need to do this, or does ICU do it for us? result = ICU.getDisplayLanguageNative(localeString, Locale.getDefault().toString()); } return result; }
/** * Returns the name of this locale's language, localized to {@code locale}. * If the language name is unknown, the language code is returned. */ public String getDisplayLanguage(Locale locale) { if (languageCode.isEmpty()) { return ""; } // http://b/8049507 --- frameworks/base should use fil_PH instead of tl_PH. // Until then, we're stuck covering their tracks, making it look like they're // using "fil" when they're not. String localeString = toString(); if (languageCode.equals("tl")) { localeString = toNewString("fil", countryCode, variantCode); } String result = ICU.getDisplayLanguageNative(localeString, locale.toString()); if (result == null) { // TODO: do we need to do this, or does ICU do it for us? result = ICU.getDisplayLanguageNative(localeString, Locale.getDefault().toString()); } return result; }