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

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

本文整理了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

/**
 * 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());
}

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

@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)
  );
}

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

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

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

"</td><td>" +
prefix +
locale.getDisplayVariant() +
suffix));

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

/**
 * @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());
}

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

/**
 * @see java.util.Locale#getDisplayVariant()
 */
public final String getDisplayVariant() {
  return locale.getDisplayVariant();
}

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

@Override
  public String getDisplayString(Locale locale, Locale inLocale) {
    return locale.getDisplayVariant(inLocale);
  }
};

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

/**
 * @see java.util.Locale#getDisplayVariant(java.util.Locale)
 */
public String getDisplayVariant(Locale inLocale) {
  return locale.getDisplayVariant(inLocale);
}

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

/**
 * 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());
}

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

/**
 * 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());
}

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

/**
 * 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());
}

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

/**
 * 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());
}

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

/**
 * 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());
}

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

/**
 * 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());
}

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

/**
 * 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;
}

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

@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;
}

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

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

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

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

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

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("");
}

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

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

相关文章