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

The following examples show how to use java.util.Locale#getDisplayScript() . These examples are extracted from open source projects. 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
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
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
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
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
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
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
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
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
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
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
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
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
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
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");
    }
}