Java Code Examples for java.util.Locale#getDisplayScript()

The following examples show how to use java.util.Locale#getDisplayScript() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: LocaleCategory.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
static void testBug7079486() {
    Locale zh_Hans_CN = Locale.forLanguageTag("zh-Hans-CN");

    // make sure JRE has zh_Hans_CN localized string
    if (zh_Hans_CN.getDisplayScript(Locale.US).equals(zh_Hans_CN.getDisplayScript(zh_Hans_CN))) {
        return;
    }

    Locale.setDefault(Locale.US);
    String en_script = zh_Hans_CN.getDisplayScript();

    Locale.setDefault(Locale.Category.DISPLAY, zh_Hans_CN);
    String zh_script = zh_Hans_CN.getDisplayScript();

    if (en_script.equals(zh_script)) {
        throw new RuntimeException("Locale.getDisplayScript() (no args) does not honor default DISPLAY locale");
    }
}
 
Example 2
Source File: LocaleCategory.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
static void testBug7079486() {
    Locale zh_Hans_CN = Locale.forLanguageTag("zh-Hans-CN");

    // make sure JRE has zh_Hans_CN localized string
    if (zh_Hans_CN.getDisplayScript(Locale.US).equals(zh_Hans_CN.getDisplayScript(zh_Hans_CN))) {
        return;
    }

    Locale.setDefault(Locale.US);
    String en_script = zh_Hans_CN.getDisplayScript();

    Locale.setDefault(Locale.Category.DISPLAY, zh_Hans_CN);
    String zh_script = zh_Hans_CN.getDisplayScript();

    if (en_script.equals(zh_script)) {
        throw new RuntimeException("Locale.getDisplayScript() (no args) does not honor default DISPLAY locale");
    }
}
 
Example 3
Source File: LocaleCategory.java    From native-obfuscator with GNU General Public License v3.0 6 votes vote down vote up
static void testBug7079486() {
    Locale zh_Hans_CN = Locale.forLanguageTag("zh-Hans-CN");

    // make sure JRE has zh_Hans_CN localized string
    if (zh_Hans_CN.getDisplayScript(Locale.US).equals(zh_Hans_CN.getDisplayScript(zh_Hans_CN))) {
        return;
    }

    Locale.setDefault(Locale.US);
    String en_script = zh_Hans_CN.getDisplayScript();

    Locale.setDefault(Locale.Category.DISPLAY, zh_Hans_CN);
    String zh_script = zh_Hans_CN.getDisplayScript();

    if (en_script.equals(zh_script)) {
        throw new RuntimeException("Locale.getDisplayScript() (no args) does not honor default DISPLAY locale");
    }
}
 
Example 4
Source File: LocaleCategory.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
static void testBug7079486() {
    Locale zh_Hans_CN = Locale.forLanguageTag("zh-Hans-CN");

    // make sure JRE has zh_Hans_CN localized string
    if (zh_Hans_CN.getDisplayScript(Locale.US).equals(zh_Hans_CN.getDisplayScript(zh_Hans_CN))) {
        return;
    }

    Locale.setDefault(Locale.US);
    String en_script = zh_Hans_CN.getDisplayScript();

    Locale.setDefault(Locale.Category.DISPLAY, zh_Hans_CN);
    String zh_script = zh_Hans_CN.getDisplayScript();

    if (en_script.equals(zh_script)) {
        throw new RuntimeException("Locale.getDisplayScript() (no args) does not honor default DISPLAY locale");
    }
}
 
Example 5
Source File: LocaleCategory.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
static void testBug7079486() {
    Locale zh_Hans_CN = Locale.forLanguageTag("zh-Hans-CN");

    // make sure JRE has zh_Hans_CN localized string
    if (zh_Hans_CN.getDisplayScript(Locale.US).equals(zh_Hans_CN.getDisplayScript(zh_Hans_CN))) {
        return;
    }

    Locale.setDefault(Locale.US);
    String en_script = zh_Hans_CN.getDisplayScript();

    Locale.setDefault(Locale.Category.DISPLAY, zh_Hans_CN);
    String zh_script = zh_Hans_CN.getDisplayScript();

    if (en_script.equals(zh_script)) {
        throw new RuntimeException("Locale.getDisplayScript() (no args) does not honor default DISPLAY locale");
    }
}
 
Example 6
Source File: LocaleCategory.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
static void testBug7079486() {
    Locale zh_Hans_CN = Locale.forLanguageTag("zh-Hans-CN");

    // make sure JRE has zh_Hans_CN localized string
    if (zh_Hans_CN.getDisplayScript(Locale.US).equals(zh_Hans_CN.getDisplayScript(zh_Hans_CN))) {
        return;
    }

    Locale.setDefault(Locale.US);
    String en_script = zh_Hans_CN.getDisplayScript();

    Locale.setDefault(Locale.Category.DISPLAY, zh_Hans_CN);
    String zh_script = zh_Hans_CN.getDisplayScript();

    if (en_script.equals(zh_script)) {
        throw new RuntimeException("Locale.getDisplayScript() (no args) does not honor default DISPLAY locale");
    }
}
 
Example 7
Source File: LocaleCategory.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
static void testBug7079486() {
    Locale zh_Hans_CN = Locale.forLanguageTag("zh-Hans-CN");

    // make sure JRE has zh_Hans_CN localized string
    if (zh_Hans_CN.getDisplayScript(Locale.US).equals(zh_Hans_CN.getDisplayScript(zh_Hans_CN))) {
        return;
    }

    Locale.setDefault(Locale.US);
    String en_script = zh_Hans_CN.getDisplayScript();

    Locale.setDefault(Locale.Category.DISPLAY, zh_Hans_CN);
    String zh_script = zh_Hans_CN.getDisplayScript();

    if (en_script.equals(zh_script)) {
        throw new RuntimeException("Locale.getDisplayScript() (no args) does not honor default DISPLAY locale");
    }
}
 
Example 8
Source File: LocaleCategory.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
static void testBug7079486() {
    Locale zh_Hans_CN = Locale.forLanguageTag("zh-Hans-CN");

    // make sure JRE has zh_Hans_CN localized string
    if (zh_Hans_CN.getDisplayScript(Locale.US).equals(zh_Hans_CN.getDisplayScript(zh_Hans_CN))) {
        return;
    }

    Locale.setDefault(Locale.US);
    String en_script = zh_Hans_CN.getDisplayScript();

    Locale.setDefault(Locale.Category.DISPLAY, zh_Hans_CN);
    String zh_script = zh_Hans_CN.getDisplayScript();

    if (en_script.equals(zh_script)) {
        throw new RuntimeException("Locale.getDisplayScript() (no args) does not honor default DISPLAY locale");
    }
}
 
Example 9
Source File: LocaleCategory.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
static void testBug7079486() {
    Locale zh_Hans_CN = Locale.forLanguageTag("zh-Hans-CN");

    // make sure JRE has zh_Hans_CN localized string
    if (zh_Hans_CN.getDisplayScript(Locale.US).equals(zh_Hans_CN.getDisplayScript(zh_Hans_CN))) {
        return;
    }

    Locale.setDefault(Locale.US);
    String en_script = zh_Hans_CN.getDisplayScript();

    Locale.setDefault(Locale.Category.DISPLAY, zh_Hans_CN);
    String zh_script = zh_Hans_CN.getDisplayScript();

    if (en_script.equals(zh_script)) {
        throw new RuntimeException("Locale.getDisplayScript() (no args) does not honor default DISPLAY locale");
    }
}
 
Example 10
Source File: LocaleCategory.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
static void testBug7079486() {
    Locale zh_Hans_CN = Locale.forLanguageTag("zh-Hans-CN");

    // make sure JRE has zh_Hans_CN localized string
    if (zh_Hans_CN.getDisplayScript(Locale.US).equals(zh_Hans_CN.getDisplayScript(zh_Hans_CN))) {
        return;
    }

    Locale.setDefault(Locale.US);
    String en_script = zh_Hans_CN.getDisplayScript();

    Locale.setDefault(Locale.Category.DISPLAY, zh_Hans_CN);
    String zh_script = zh_Hans_CN.getDisplayScript();

    if (en_script.equals(zh_script)) {
        throw new RuntimeException("Locale.getDisplayScript() (no args) does not honor default DISPLAY locale");
    }
}
 
Example 11
Source File: LocaleCategory.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
static void testBug7079486() {
    Locale zh_Hans_CN = Locale.forLanguageTag("zh-Hans-CN");

    // make sure JRE has zh_Hans_CN localized string
    if (zh_Hans_CN.getDisplayScript(Locale.US).equals(zh_Hans_CN.getDisplayScript(zh_Hans_CN))) {
        return;
    }

    Locale.setDefault(Locale.US);
    String en_script = zh_Hans_CN.getDisplayScript();

    Locale.setDefault(Locale.Category.DISPLAY, zh_Hans_CN);
    String zh_script = zh_Hans_CN.getDisplayScript();

    if (en_script.equals(zh_script)) {
        throw new RuntimeException("Locale.getDisplayScript() (no args) does not honor default DISPLAY locale");
    }
}
 
Example 12
Source File: LocaleCategory.java    From jdk8u_jdk with GNU General Public License v2.0 6 votes vote down vote up
static void testBug7079486() {
    Locale zh_Hans_CN = Locale.forLanguageTag("zh-Hans-CN");

    // make sure JRE has zh_Hans_CN localized string
    if (zh_Hans_CN.getDisplayScript(Locale.US).equals(zh_Hans_CN.getDisplayScript(zh_Hans_CN))) {
        return;
    }

    Locale.setDefault(Locale.US);
    String en_script = zh_Hans_CN.getDisplayScript();

    Locale.setDefault(Locale.Category.DISPLAY, zh_Hans_CN);
    String zh_script = zh_Hans_CN.getDisplayScript();

    if (en_script.equals(zh_script)) {
        throw new RuntimeException("Locale.getDisplayScript() (no args) does not honor default DISPLAY locale");
    }
}
 
Example 13
Source File: LocaleCategory.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
static void testBug7079486() {
    Locale zh_Hans_CN = Locale.forLanguageTag("zh-Hans-CN");

    // make sure JRE has zh_Hans_CN localized string
    if (zh_Hans_CN.getDisplayScript(Locale.US).equals(zh_Hans_CN.getDisplayScript(zh_Hans_CN))) {
        return;
    }

    Locale.setDefault(Locale.US);
    String en_script = zh_Hans_CN.getDisplayScript();

    Locale.setDefault(Locale.Category.DISPLAY, zh_Hans_CN);
    String zh_script = zh_Hans_CN.getDisplayScript();

    if (en_script.equals(zh_script)) {
        throw new RuntimeException("Locale.getDisplayScript() (no args) does not honor default DISPLAY locale");
    }
}
 
Example 14
Source File: LocaleCategory.java    From jdk8u-dev-jdk with GNU General Public License v2.0 6 votes vote down vote up
static void testBug7079486() {
    Locale zh_Hans_CN = Locale.forLanguageTag("zh-Hans-CN");

    // make sure JRE has zh_Hans_CN localized string
    if (zh_Hans_CN.getDisplayScript(Locale.US).equals(zh_Hans_CN.getDisplayScript(zh_Hans_CN))) {
        return;
    }

    Locale.setDefault(Locale.US);
    String en_script = zh_Hans_CN.getDisplayScript();

    Locale.setDefault(Locale.Category.DISPLAY, zh_Hans_CN);
    String zh_script = zh_Hans_CN.getDisplayScript();

    if (en_script.equals(zh_script)) {
        throw new RuntimeException("Locale.getDisplayScript() (no args) does not honor default DISPLAY locale");
    }
}