java.util.Locale.getDisplayVariant()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(5.7k)|赞(0)|评价(0)|浏览(149)

本文整理了Java中java.util.Locale.getDisplayVariant()方法的一些代码示例,展示了Locale.getDisplayVariant()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Locale.getDisplayVariant()方法的具体详情如下:
包路径:java.util.Locale
类名称:Locale
方法名:getDisplayVariant

Locale.getDisplayVariant介绍

[英]Returns the full variant name in the default Locale for the variant code of this Locale. If there is no matching variant name, the variant code is returned.
[中]返回此区域设置的变体代码的默认区域设置中的完整变体名称。如果没有匹配的变量名称,则返回变量代码。

代码示例

代码示例来源:origin: robovm/robovm

  1. /**
  2. * Returns the full variant name in the default {@code Locale} for the variant code of
  3. * this {@code Locale}. If there is no matching variant name, the variant code is
  4. * returned.
  5. */
  6. public final String getDisplayVariant() {
  7. return getDisplayVariant(getDefault());
  8. }

代码示例来源:origin: jphp-group/jphp

  1. @Signature(@Arg(value = "locale", nativeType = WrapLocale.class, optional = @Optional("null")))
  2. public Memory getDisplayVariant(Environment env, Memory... args) {
  3. return StringMemory.valueOf(args[0].isNull()
  4. ? locale.getDisplayVariant()
  5. : locale.getDisplayVariant(args[0].toObject(WrapLocale.class).locale)
  6. );
  7. }

代码示例来源:origin: robovm/robovm

  1. buffer.append(",");
  2. String displayVariant = getDisplayVariant(locale);
  3. buffer.append(displayVariant.isEmpty() ? variantCode : displayVariant);
  4. ++count;

代码示例来源:origin: stackoverflow.com

  1. "</td><td>" +
  2. prefix +
  3. locale.getDisplayVariant() +
  4. suffix));

代码示例来源:origin: openmrs/openmrs-core

  1. /**
  2. * @see LocaleUtility#fromSpecification(String)
  3. */
  4. @Test
  5. public void fromSpecification_shouldGetLocaleFromLanguageCodeCountryCodeAndVariant() {
  6. Locale locale = LocaleUtility.fromSpecification("en_US_Traditional_WIN");
  7. Assert.assertEquals(Locale.US.getLanguage(), locale.getLanguage());
  8. Assert.assertEquals(Locale.US.getCountry(), locale.getCountry());
  9. Assert.assertEquals("Traditional,WIN", locale.getDisplayVariant());
  10. }

代码示例来源:origin: com.anrisoftware.globalpom/globalpomutils-core

  1. /**
  2. * @see java.util.Locale#getDisplayVariant()
  3. */
  4. public final String getDisplayVariant() {
  5. return locale.getDisplayVariant();
  6. }

代码示例来源:origin: org.softsmithy.lib/lib-core

  1. @Override
  2. public String getDisplayString(Locale locale, Locale inLocale) {
  3. return locale.getDisplayVariant(inLocale);
  4. }
  5. };

代码示例来源:origin: com.anrisoftware.globalpom/globalpomutils-core

  1. /**
  2. * @see java.util.Locale#getDisplayVariant(java.util.Locale)
  3. */
  4. public String getDisplayVariant(Locale inLocale) {
  5. return locale.getDisplayVariant(inLocale);
  6. }

代码示例来源:origin: MobiVM/robovm

  1. /**
  2. * Returns the full variant name in the default {@code Locale} for the variant code of
  3. * this {@code Locale}. If there is no matching variant name, the variant code is
  4. * returned.
  5. */
  6. public final String getDisplayVariant() {
  7. return getDisplayVariant(getDefault());
  8. }

代码示例来源:origin: FlexoVM/flexovm

  1. /**
  2. * Returns the full variant name in the default {@code Locale} for the variant code of
  3. * this {@code Locale}. If there is no matching variant name, the variant code is
  4. * returned.
  5. */
  6. public final String getDisplayVariant() {
  7. return getDisplayVariant(getDefault());
  8. }

代码示例来源:origin: ibinti/bugvm

  1. /**
  2. * Returns the full variant name in the default {@code Locale} for the variant code of
  3. * this {@code Locale}. If there is no matching variant name, the variant code is
  4. * returned.
  5. */
  6. public final String getDisplayVariant() {
  7. return getDisplayVariant(getDefault());
  8. }

代码示例来源:origin: com.bugvm/bugvm-rt

  1. /**
  2. * Returns the full variant name in the default {@code Locale} for the variant code of
  3. * this {@code Locale}. If there is no matching variant name, the variant code is
  4. * returned.
  5. */
  6. public final String getDisplayVariant() {
  7. return getDisplayVariant(getDefault());
  8. }

代码示例来源:origin: com.mobidevelop.robovm/robovm-rt

  1. /**
  2. * Returns the full variant name in the default {@code Locale} for the variant code of
  3. * this {@code Locale}. If there is no matching variant name, the variant code is
  4. * returned.
  5. */
  6. public final String getDisplayVariant() {
  7. return getDisplayVariant(getDefault());
  8. }

代码示例来源:origin: com.gluonhq/robovm-rt

  1. /**
  2. * Returns the full variant name in the default {@code Locale} for the variant code of
  3. * this {@code Locale}. If there is no matching variant name, the variant code is
  4. * returned.
  5. */
  6. public final String getDisplayVariant() {
  7. return getDisplayVariant(getDefault());
  8. }

代码示例来源:origin: org.jasig.portal/uPortal-api-internal

  1. /**
  2. * Construct a new locale wrapper bean, using the default display values.
  3. *
  4. * @param locale
  5. */
  6. public LocaleBean(final Locale locale) {
  7. this.code = locale.toString();
  8. this.displayVariant = locale.getDisplayVariant();
  9. this.displayCountry = locale.getDisplayCountry();
  10. this.displayName = locale.getDisplayName();
  11. this.displayLanguage = locale.getDisplayLanguage();
  12. this.locale = locale;
  13. }

代码示例来源:origin: stackoverflow.com

  1. @TargetApi(Build.VERSION_CODES.LOLLIPOP)
  2. public int setVoice21(@NonNull final String language, @NonNull final String region) {
  3. try {
  4. // try some API 21 stuff
  5. new Locale.Builder().build().getDisplayVariant();
  6. } catch (final IllformedLocaleException ex) {
  7. ex.printStackTrace();
  8. }
  9. return 0;
  10. }

代码示例来源:origin: at.bestsolution.efxclipse.eclipse/com.ibm.icu.base

  1. private static String getDisplayVariantInternal(ULocale locale, ULocale displayLocale) {
  2. //#com.ibm.icu.base
  3. return locale.toLocale().getDisplayVariant(displayLocale.toLocale());
  4. }

代码示例来源:origin: at.bestsolution.eclipse/com.ibm.icu.base

  1. private static String getDisplayVariantInternal(ULocale locale, ULocale displayLocale) {
  2. //#com.ibm.icu.base
  3. return locale.toLocale().getDisplayVariant(displayLocale.toLocale());
  4. }

代码示例来源:origin: RPTools/maptool

  1. private void getLocaleInfo() {
  2. appendInfo("\n==== Locale Information ====");
  3. Locale loc = Locale.getDefault();
  4. appendInfo("Country.: " + loc.getDisplayCountry());
  5. appendInfo("Language: " + loc.getDisplayLanguage());
  6. appendInfo("Locale..: " + loc.getDisplayName());
  7. appendInfo("Variant.: " + loc.getDisplayVariant());
  8. appendInfo("");
  9. }

代码示例来源:origin: org.randombits.supplier/supplier-core

  1. @SupplierKey("variant")
  2. @API("1.0.0")
  3. public String getVariant(@KeyValue Locale locale, @KeyContext SupplierContext ctx) {
  4. return locale.getDisplayVariant(getUserLocale(ctx));
  5. }
  6. }

相关文章