Java Code Examples for java.util.Locale.TAIWAN

The following are Jave code examples for showing how to use TAIWAN of the java.util.Locale class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: SecuritySample   File: AttestationResult.java   View Source Code Vote up 6 votes
public String getFormattedString() {
    StringBuilder sb = new StringBuilder();
    if (getApkCertificateDigestSha256().length > 0) {
        sb.append("[");
        for (String s : getApkCertificateDigestSha256()) {
            sb.append(s);
            sb.append(", ");
        }
        sb.delete(sb.length() - 2, sb.length());
        sb.append("]");
    }
    SimpleDateFormat newFormat = new SimpleDateFormat(
            "yyyy/MM/dd hh:mm:ss", Locale.TAIWAN);
    String formattedTime = newFormat.format(getTimestampMs());
    return String
            .format("Request Time:\n%s\n\nNonce:\n%s\n\nPackageName:\n%s\n\nextension:\n%s\n\nApkCertificateDigestSha256:\n%s\n\nApkDigestSha256:\n%s\n\nctsProfileMatch:\n%s\n\nbasicIntegrity:\n%s",
                    formattedTime, getNonce(), getApkPackageName(),
                    getExtension(), sb.toString(), getApkDigestSha256(),
                    isCtsProfileMatch(), isBasicIntegrity());
}
 
Example 2
Project: jdk8u-jdk   File: TestNonIsoFormatter.java   View Source Code Vote up 6 votes
@DataProvider(name="format_data")
Object[][] formatData() {
    return new Object[][] {
        // Chronology, Format Locale, Numbering Locale, ChronoLocalDate, expected string
        { JAPANESE, Locale.JAPANESE, Locale.JAPANESE, JAPANESE.date(IsoDate),
          "\u5e73\u621025\u5e742\u670811\u65e5" }, // Japanese Heisei 25-02-11
        { HIJRAH, ARABIC, ARABIC, HIJRAH.date(IsoDate),
          "\u0627\u0644\u0627\u062b\u0646\u064a\u0646\u060c 1 \u0631\u0628\u064a\u0639 "
          + "\u0627\u0644\u0622\u062e\u0631 1434" }, // Hijrah AH 1434-04-01 (Mon)
        { MINGUO, Locale.TAIWAN, Locale.TAIWAN, MINGUO.date(IsoDate),
          "\u6c11\u570b102\u5e742\u670811\u65e5\u661f\u671f\u4e00" }, // Minguo ROC 102-02-11 (Mon)
        { BUDDHIST, thTH, thTH, BUDDHIST.date(IsoDate),
          "\u0e27\u0e31\u0e19\u0e08\u0e31\u0e19\u0e17\u0e23\u0e4c\u0e17\u0e35\u0e48"
          + " 11 \u0e01\u0e38\u0e21\u0e20\u0e32\u0e1e\u0e31\u0e19\u0e18\u0e4c"
          + " \u0e1e.\u0e28. 2556" }, // ThaiBuddhist BE 2556-02-11
        { BUDDHIST, thTH, thTHTH, BUDDHIST.date(IsoDate),
          "\u0e27\u0e31\u0e19\u0e08\u0e31\u0e19\u0e17\u0e23\u0e4c\u0e17\u0e35\u0e48 \u0e51\u0e51 "
          + "\u0e01\u0e38\u0e21\u0e20\u0e32\u0e1e\u0e31\u0e19\u0e18\u0e4c \u0e1e.\u0e28. "
          + "\u0e52\u0e55\u0e55\u0e56" }, // ThaiBuddhist BE 2556-02-11 (with Thai digits)
    };
}
 
Example 3
Project: openjdk-jdk10   File: TestNonIsoFormatter.java   View Source Code Vote up 6 votes
@DataProvider(name="format_data")
Object[][] formatData() {
    return new Object[][] {
        // Chronology, Format Locale, Numbering Locale, ChronoLocalDate, expected string
        { JAPANESE, Locale.JAPANESE, Locale.JAPANESE, JAPANESE.date(IsoDate),
          "\u5e73\u621025\u5e742\u670811\u65e5\u6708\u66dc\u65e5" }, // Japanese Heisei 25-02-11
        { HIJRAH, ARABIC, ARABIC, HIJRAH.date(IsoDate),
          "\u0627\u0644\u0627\u062b\u0646\u064a\u0646\u060c \u0661 \u0631\u0628\u064a\u0639 "
          + "\u0627\u0644\u0622\u062e\u0631\u060c \u0661\u0664\u0663\u0664 \u0647\u0640" }, // Hijrah AH 1434-04-01 (Mon)
        { MINGUO, Locale.TAIWAN, Locale.TAIWAN, MINGUO.date(IsoDate),
          "\u6c11\u570b102\u5e742\u670811\u65e5 \u661f\u671f\u4e00" }, // Minguo ROC 102-02-11 (Mon)
        { BUDDHIST, thTH, thTH, BUDDHIST.date(IsoDate),
          "\u0e27\u0e31\u0e19\u0e08\u0e31\u0e19\u0e17\u0e23\u0e4c\u0e17\u0e35\u0e48"
          + " 11 \u0e01\u0e38\u0e21\u0e20\u0e32\u0e1e\u0e31\u0e19\u0e18\u0e4c"
          + " \u0e1e.\u0e28. 2556" }, // ThaiBuddhist BE 2556-02-11
        { BUDDHIST, thTH, thTHTH, BUDDHIST.date(IsoDate),
          "\u0e27\u0e31\u0e19\u0e08\u0e31\u0e19\u0e17\u0e23\u0e4c\u0e17\u0e35\u0e48 \u0e51\u0e51 "
          + "\u0e01\u0e38\u0e21\u0e20\u0e32\u0e1e\u0e31\u0e19\u0e18\u0e4c \u0e1e.\u0e28. "
          + "\u0e52\u0e55\u0e55\u0e56" }, // ThaiBuddhist BE 2556-02-11 (with Thai digits)
    };
}
 
Example 4
Project: TaipeiTechRefined   File: MainActivity.java   View Source Code Vote up 6 votes
protected void switchLanguage(String lang) {
    Resources resources = getResources();
    Configuration configuration = resources.getConfiguration();
    DisplayMetrics displayMetrics = resources.getDisplayMetrics();
    switch (lang) {
        case "zh":
            configuration.locale = Locale.TAIWAN;
            break;
        case "ja":
            configuration.locale = Locale.JAPAN;
            break;
        default:
            configuration.locale = Locale.ENGLISH;
            break;
    }

    resources.updateConfiguration(configuration, displayMetrics);
    /*  避免重複寫入
    MainApplication.writeSetting("uiLang", lang);
    //*/
}
 
Example 5
Project: TaipeiTechRefined   File: EtcFragment.java   View Source Code Vote up 6 votes
protected void switchLanguage(String lang) {
    Resources resources = getResources();
    Configuration configuration = resources.getConfiguration();
    DisplayMetrics displayMetrics = resources.getDisplayMetrics();
    switch (lang) {
        case "zh":
            configuration.locale = Locale.TAIWAN;
            break;
        case "ja":
            configuration.locale = Locale.JAPAN;
            break;
        default:
            configuration.locale = Locale.ENGLISH;
            break;
    }

    resources.updateConfiguration(configuration, displayMetrics);
    MainApplication.writeSetting("uiLang", lang);
    //*
    getActivity().finish();
    getActivity().startActivity(getActivity().getIntent());
    //*/
}
 
Example 6
Project: otter-G   File: ObjectProfiler.java   View Source Code Vote up 5 votes
private static boolean isSharedFlyweight(Object obj) {
    if (obj == null) {
        return true;
    }
    if (obj == Boolean.TRUE || obj == Boolean.FALSE) {
        return true;
    }
    if (/* obj == Locale.ROOT || *//* Java 6 */
    obj == Locale.ENGLISH || obj == Locale.FRENCH || obj == Locale.GERMAN || obj == Locale.ITALIAN
            || obj == Locale.JAPANESE || obj == Locale.KOREAN || obj == Locale.CHINESE
            || obj == Locale.SIMPLIFIED_CHINESE || obj == Locale.TRADITIONAL_CHINESE || obj == Locale.FRANCE
            || obj == Locale.GERMANY || obj == Locale.ITALY || obj == Locale.JAPAN || obj == Locale.KOREA
            || obj == Locale.CHINA || obj == Locale.PRC || obj == Locale.TAIWAN || obj == Locale.UK
            || obj == Locale.US || obj == Locale.CANADA || obj == Locale.CANADA_FRENCH) {
        return true;
    }
    if (obj == Collections.EMPTY_SET || obj == Collections.EMPTY_LIST || obj == Collections.EMPTY_MAP) {
        return true;
    }
    if (obj == BigInteger.ZERO || obj == BigInteger.ONE) {
        return true;
    }
    if (obj == System.in || obj == System.out || obj == System.err) {
        return true;
    }
    if (obj == String.CASE_INSENSITIVE_ORDER) {
        return true;
    }
    if (obj == JarFile.MANIFEST_NAME) {
        return true;
    }
    return false;
}
 
Example 7
Project: TaipeiTechRefined   File: Utility.java   View Source Code Vote up 5 votes
public static String getDateString(String format, Date date, Context context) {
    SimpleDateFormat sdf = new SimpleDateFormat(format, Locale.TAIWAN);
    DateFormatSymbols dfs = new DateFormatSymbols();
    dfs.setShortWeekdays(new String[]{"", context.getString(R.string.Su), context.getString(R.string.Mo), context.getString(R.string.Tu), context.getString(R.string.We), context.getString(R.string.Th), context.getString(R.string.Fr),
            context.getString(R.string.Sa)});
    sdf.setDateFormatSymbols(dfs);
    return sdf.format(date);
}
 
Example 8
Project: openjdk-jdk10   File: MyResourcesAsia.java   View Source Code Vote up 4 votes
public MyResourcesAsia() {
    super("java.properties", "asia",
          Locale.JAPANESE, Locale.JAPAN, Locale.CHINESE, Locale.TAIWAN,
          new Locale("vi"));
}
 
Example 9
Project: TaipeiTechRefined   File: YearCalendar.java   View Source Code Vote up 4 votes
public static Date getDate(String date_string) throws ParseException {
    SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd", Locale.TAIWAN);
    Date date = sdf.parse(date_string);
    return date;
}