/** * Returns the full variant name in the default {@code Locale} for the variant code of * this {@code Locale}. If there is no matching variant name, the variant code is * returned. */ public final String getDisplayVariant() { return getDisplayVariant(getDefault()); }
@Signature(@Arg(value = "locale", nativeType = WrapLocale.class, optional = @Optional("null"))) public Memory getDisplayVariant(Environment env, Memory... args) { return StringMemory.valueOf(args[0].isNull() ? locale.getDisplayVariant() : locale.getDisplayVariant(args[0].toObject(WrapLocale.class).locale) ); }
buffer.append(","); String displayVariant = getDisplayVariant(locale); buffer.append(displayVariant.isEmpty() ? variantCode : displayVariant); ++count;
"</td><td>" + prefix + locale.getDisplayVariant() + suffix));
/** * @see LocaleUtility#fromSpecification(String) */ @Test public void fromSpecification_shouldGetLocaleFromLanguageCodeCountryCodeAndVariant() { Locale locale = LocaleUtility.fromSpecification("en_US_Traditional_WIN"); Assert.assertEquals(Locale.US.getLanguage(), locale.getLanguage()); Assert.assertEquals(Locale.US.getCountry(), locale.getCountry()); Assert.assertEquals("Traditional,WIN", locale.getDisplayVariant()); }
/** * @see java.util.Locale#getDisplayVariant() */ public final String getDisplayVariant() { return locale.getDisplayVariant(); }
@Override public String getDisplayString(Locale locale, Locale inLocale) { return locale.getDisplayVariant(inLocale); } };
/** * @see java.util.Locale#getDisplayVariant(java.util.Locale) */ public String getDisplayVariant(Locale inLocale) { return locale.getDisplayVariant(inLocale); }
/** * Returns the full variant name in the default {@code Locale} for the variant code of * this {@code Locale}. If there is no matching variant name, the variant code is * returned. */ public final String getDisplayVariant() { return getDisplayVariant(getDefault()); }
/** * Returns the full variant name in the default {@code Locale} for the variant code of * this {@code Locale}. If there is no matching variant name, the variant code is * returned. */ public final String getDisplayVariant() { return getDisplayVariant(getDefault()); }
/** * Returns the full variant name in the default {@code Locale} for the variant code of * this {@code Locale}. If there is no matching variant name, the variant code is * returned. */ public final String getDisplayVariant() { return getDisplayVariant(getDefault()); }
/** * Returns the full variant name in the default {@code Locale} for the variant code of * this {@code Locale}. If there is no matching variant name, the variant code is * returned. */ public final String getDisplayVariant() { return getDisplayVariant(getDefault()); }
/** * Returns the full variant name in the default {@code Locale} for the variant code of * this {@code Locale}. If there is no matching variant name, the variant code is * returned. */ public final String getDisplayVariant() { return getDisplayVariant(getDefault()); }
/** * Returns the full variant name in the default {@code Locale} for the variant code of * this {@code Locale}. If there is no matching variant name, the variant code is * returned. */ public final String getDisplayVariant() { return getDisplayVariant(getDefault()); }
/** * Construct a new locale wrapper bean, using the default display values. * * @param locale */ public LocaleBean(final Locale locale) { this.code = locale.toString(); this.displayVariant = locale.getDisplayVariant(); this.displayCountry = locale.getDisplayCountry(); this.displayName = locale.getDisplayName(); this.displayLanguage = locale.getDisplayLanguage(); this.locale = locale; }
@TargetApi(Build.VERSION_CODES.LOLLIPOP) public int setVoice21(@NonNull final String language, @NonNull final String region) { try { // try some API 21 stuff new Locale.Builder().build().getDisplayVariant(); } catch (final IllformedLocaleException ex) { ex.printStackTrace(); } return 0; }
private static String getDisplayVariantInternal(ULocale locale, ULocale displayLocale) { //#com.ibm.icu.base return locale.toLocale().getDisplayVariant(displayLocale.toLocale()); }
private static String getDisplayVariantInternal(ULocale locale, ULocale displayLocale) { //#com.ibm.icu.base return locale.toLocale().getDisplayVariant(displayLocale.toLocale()); }
private void getLocaleInfo() { appendInfo("\n==== Locale Information ===="); Locale loc = Locale.getDefault(); appendInfo("Country.: " + loc.getDisplayCountry()); appendInfo("Language: " + loc.getDisplayLanguage()); appendInfo("Locale..: " + loc.getDisplayName()); appendInfo("Variant.: " + loc.getDisplayVariant()); appendInfo(""); }
@SupplierKey("variant") @API("1.0.0") public String getVariant(@KeyValue Locale locale, @KeyContext SupplierContext ctx) { return locale.getDisplayVariant(getUserLocale(ctx)); } }