Java Code Examples for java.util.Locale.CHINESE

The following are Jave code examples for showing how to use CHINESE 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: alfresco-repository   File: ContentDataTest.java   View Source Code Vote up 6 votes
public void testEquals()
{
    ContentData contentData1 = new ContentData("abc://xxx", MimetypeMap.MIMETYPE_BINARY, 600L, "UTF-8", Locale.ENGLISH);
    ContentData contentData2 = new ContentData("abc://xxx", MimetypeMap.MIMETYPE_BINARY, 600L, "UTF-8", Locale.ENGLISH);
    ContentData contentData3 = new ContentData("abc://XXX", MimetypeMap.MIMETYPE_BINARY, 600L, "UTF-8", Locale.ENGLISH);
    ContentData contentData4 = new ContentData("abc://xxx", MimetypeMap.MIMETYPE_TEXT_PLAIN, 600L, "UTF-8", Locale.ENGLISH);
    ContentData contentData5 = new ContentData("abc://xxx", MimetypeMap.MIMETYPE_BINARY, 500L, "UTF-8", Locale.ENGLISH);
    ContentData contentData6 = new ContentData("abc://xxx", MimetypeMap.MIMETYPE_BINARY, 600L, "UTF-16", Locale.ENGLISH);
    ContentData contentData7 = new ContentData("abc://xxx", MimetypeMap.MIMETYPE_BINARY, 600L, "UTF-8", Locale.CHINESE);
    assertEquals(contentData1, contentData2);
    assertNotSame(contentData1, contentData3);
    assertNotSame(contentData1, contentData4);
    assertNotSame(contentData1, contentData5);
    assertNotSame(contentData1, contentData6);
    assertNotSame(contentData1, contentData7);
}
 
Example 2
Project: database-transform-tool   File: ResourceHolder.java   View Source Code Vote up 6 votes
/**
 * <pre>
 * 描述:获取本地语言
 * 作者:ZhangYi
 * 时间:2015年1月30日 下午1:24:06
 * 参数:(参数列表)
 * @param language
 * @return
 * </pre>
 */
public static Locale getLocale(String language) {
	Locale locale = Locale.CHINESE;
	if (!StringUtil.isEmpty(language)) {
		language = language.toLowerCase();
		if (language.indexOf("en") != -1) {
			locale = Locale.ENGLISH;
		}
		if (language.indexOf("zh_hk") != -1) {
			locale = Locale.TRADITIONAL_CHINESE;
		}
		if (language.indexOf("zh_cn") != -1) {
			locale = Locale.SIMPLIFIED_CHINESE;
		}
	}
	return locale;
}
 
Example 3
Project: Winter   File: InfoConsumer.java   View Source Code Vote up 6 votes
private File createFile() {
    String dir = Environment.getExternalStorageDirectory() + "/winter/monitor";
    File dirFile = new File(dir);
    if (!dirFile.exists()) {
        dirFile.mkdirs();
    }
    SimpleDateFormat dateformat1 = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss", Locale.CHINESE);
    String a1 = dateformat1.format(new Date());
    File file = new File(dir + "/" + a1 + ".log");
    if (!file.exists()) {
        try {
            file.createNewFile();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
    return file;
}
 
Example 4
Project: openjdk-jdk10   File: CalendarRegression.java   View Source Code Vote up 6 votes
public void Test4106136() {
    Locale saveLocale = Locale.getDefault();
    try {
        Locale[] locales = {Locale.CHINESE, Locale.CHINA};
        for (int i = 0; i < locales.length; ++i) {
            Locale.setDefault(locales[i]);
            int[] n = {
                getAvailableLocales().length,
                DateFormat.getAvailableLocales().length,
                NumberFormat.getAvailableLocales().length};
            for (int j = 0; j < n.length; ++j) {
                if (n[j] == 0) {
                    errln("Fail: No locales for " + locales[i]);
                }
            }
        }
    } finally {
        Locale.setDefault(saveLocale);
    }
}
 
Example 5
Project: alfresco-repository   File: RoutingContentServiceTest.java   View Source Code Vote up 5 votes
@Override
public void setUp() throws Exception
{
    ctx = ApplicationContextHelper.getApplicationContext();
    transactionService = (TransactionService) ctx.getBean("TransactionService");
    nodeService = (NodeService) ctx.getBean("NodeService");
    contentService = (ContentService) ctx.getBean(ServiceRegistry.CONTENT_SERVICE.getLocalName());
    this.policyComponent = (PolicyComponent) ctx.getBean("policyComponent");
    this.authenticationComponent = (AuthenticationComponent) ctx.getBean("authenticationComponent");
    
    // authenticate
    this.authenticationComponent.setSystemUserAsCurrentUser();
    
    // start the transaction
    txn = getUserTransaction();
    txn.begin();
    
    // create a store and get the root node
    StoreRef storeRef = new StoreRef(StoreRef.PROTOCOL_WORKSPACE, getName());
    if (!nodeService.exists(storeRef))
    {
        storeRef = nodeService.createStore(storeRef.getProtocol(), storeRef.getIdentifier());
    }
    rootNodeRef = nodeService.getRootNode(storeRef);
    // create a content node
    ContentData contentData = new ContentData(null, "text/plain", 0L, "UTF-16", Locale.CHINESE);
    
    PropertyMap properties = new PropertyMap();
    properties.put(ContentModel.PROP_CONTENT, contentData);
    
    ChildAssociationRef assocRef = nodeService.createNode(
            rootNodeRef,
            ContentModel.ASSOC_CHILDREN,
            QName.createQName(TEST_NAMESPACE, GUID.generate()),
            ContentModel.TYPE_CONTENT,
            properties);
    contentNodeRef = assocRef.getChildRef();
}
 
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: AutoInteraction-Library   File: SilenceLog.java   View Source Code Vote up 5 votes
private static void writeFile(String msg) {
    String sdStatus = Environment.getExternalStorageState();
    if (!sdStatus.equals(Environment.MEDIA_MOUNTED)) {
        Log.d("TestFile", "SD card is not avaiable/writeable right now.");
        return;
    }
    try {
        String pathName = Environment.getExternalStorageDirectory().getPath() + "/ForeSightLog/";
        String fileName = "runningLog.txt";
        File path = new File(pathName);
        File file = new File(pathName + fileName);
        if (!path.exists()) {
            Log.d("runningLog", "Create the path:" + pathName);
            path.mkdir();
        }
        if (!file.exists()) {
            Log.d("runningLog", "Create the file:" + fileName);
            file.createNewFile();
        }
        FileOutputStream stream = new FileOutputStream(file, true);
        SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.CHINESE);
        String s = "[" + dateFormat.format(new Date()) + "][thread:" + Thread.currentThread().getId() + "][" +
                msg + "]\r\n";
        byte[] buf = s.getBytes();
        stream.write(buf);
        stream.close();

    } catch (Exception e) {
        Log.e("TestFile", "Error on writeFilToSD.");
        e.printStackTrace();
    }
}
 
Example 8
Project: OpenJSharp   File: MessageCatalog.java   View Source Code Vote up 5 votes
private Locale getLocale(String localeName) {
    String language, country;
    int index;

    index = localeName.indexOf('_');
    if (index == -1) {
        //
        // Special case the builtin JDK languages
        //
        if (localeName.equals("de"))
            return Locale.GERMAN;
        if (localeName.equals("en"))
            return Locale.ENGLISH;
        if (localeName.equals("fr"))
            return Locale.FRENCH;
        if (localeName.equals("it"))
            return Locale.ITALIAN;
        if (localeName.equals("ja"))
            return Locale.JAPANESE;
        if (localeName.equals("ko"))
            return Locale.KOREAN;
        if (localeName.equals("zh"))
            return Locale.CHINESE;

        language = localeName;
        country = "";
    } else {
        if (localeName.equals("zh_CN"))
            return Locale.SIMPLIFIED_CHINESE;
        if (localeName.equals("zh_TW"))
            return Locale.TRADITIONAL_CHINESE;

        //
        // JDK also has constants for countries:  en_GB, en_US, en_CA,
        // fr_FR, fr_CA, de_DE, ja_JP, ko_KR.  We don't use those.
        //
        language = localeName.substring(0, index);
        country = localeName.substring(index + 1);
    }

    return new Locale(language, country);
}
 
Example 9
Project: jdk8u-jdk   File: LocaleTest.java   View Source Code Vote up 5 votes
/**
 * @bug 4105828
 * Currency symbol in zh is wrong.  We will test this at the NumberFormat
 * end to test the whole pipe.
 */
public void Test4105828() {
    Locale[] LOC = { Locale.CHINESE, new Locale("zh", "CN", ""),
                     new Locale("zh", "TW", ""), new Locale("zh", "HK", "") };
    for (int i=0; i<LOC.length; ++i) {
        NumberFormat fmt = NumberFormat.getPercentInstance(LOC[i]);
        String result = fmt.format(1);
        if (!result.equals("100%")) {
            errln("Percent for " + LOC[i] + " should be 100%, got " + result);
        }
    }
}
 
Example 10
Project: openjdk-jdk10   File: LocaleTest.java   View Source Code Vote up 5 votes
/**
 * @bug 4105828
 * Currency symbol in zh is wrong.  We will test this at the NumberFormat
 * end to test the whole pipe.
 */
public void Test4105828() {
    Locale[] LOC = {Locale.CHINESE, new Locale("zh", "CN", ""),
        new Locale("zh", "TW", ""), new Locale("zh", "HK", "")};
    for (int i = 0; i < LOC.length; ++i) {
        NumberFormat fmt = NumberFormat.getPercentInstance(LOC[i]);
        String result = fmt.format(1);
        if (!result.equals("100%")) {
            errln("Percent for " + LOC[i] + " should be 100%, got " + result);
        }
    }
}
 
Example 11
Project: NodeET   File: DateTimeFormatter.java   View Source Code Vote up 4 votes
public static String format(long millis){
    PrettyTime p = new PrettyTime(Locale.CHINESE);
    long milliseconds = new Date().getTime();
    milliseconds = milliseconds - millis/1000;
    return p.format(new Date(milliseconds));
}
 
Example 12
Project: dcs-sdk-java   File: CommonUtil.java   View Source Code Vote up 4 votes
public static String getCurrentTime() {
    SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss",
            Locale.CHINESE);
    return format.format(new Date());
}
 
Example 13
Project: OSchina_resources_android   File: UserSendMessageAdapter.java   View Source Code Vote up 4 votes
private String formatWeek(Date date) {
    SimpleDateFormat format = new SimpleDateFormat("EEEE", Locale.CHINESE);
    return format.format(date);
}
 
Example 14
Project: jdk8u-jdk   File: TestDateTimeFormatterBuilder.java   View Source Code Vote up 4 votes
@DataProvider(name="localePatterns")
Object[][] localizedDateTimePatterns() {
    return new Object[][] {
        {FormatStyle.FULL, FormatStyle.FULL, IsoChronology.INSTANCE, Locale.US, "EEEE, MMMM d, yyyy h:mm:ss a z"},
        {FormatStyle.LONG, FormatStyle.LONG, IsoChronology.INSTANCE, Locale.US, "MMMM d, yyyy h:mm:ss a z"},
        {FormatStyle.MEDIUM, FormatStyle.MEDIUM, IsoChronology.INSTANCE, Locale.US, "MMM d, yyyy h:mm:ss a"},
        {FormatStyle.SHORT, FormatStyle.SHORT, IsoChronology.INSTANCE, Locale.US, "M/d/yy h:mm a"},
        {FormatStyle.FULL, null, IsoChronology.INSTANCE, Locale.US, "EEEE, MMMM d, yyyy"},
        {FormatStyle.LONG, null, IsoChronology.INSTANCE, Locale.US, "MMMM d, yyyy"},
        {FormatStyle.MEDIUM, null, IsoChronology.INSTANCE, Locale.US, "MMM d, yyyy"},
        {FormatStyle.SHORT, null, IsoChronology.INSTANCE, Locale.US, "M/d/yy"},
        {null, FormatStyle.FULL, IsoChronology.INSTANCE, Locale.US, "h:mm:ss a z"},
        {null, FormatStyle.LONG, IsoChronology.INSTANCE, Locale.US, "h:mm:ss a z"},
        {null, FormatStyle.MEDIUM, IsoChronology.INSTANCE, Locale.US, "h:mm:ss a"},
        {null, FormatStyle.SHORT, IsoChronology.INSTANCE, Locale.US, "h:mm a"},

        // French Locale and ISO Chronology
        {FormatStyle.FULL, FormatStyle.FULL, IsoChronology.INSTANCE, Locale.FRENCH, "EEEE d MMMM yyyy HH' h 'mm z"},
        {FormatStyle.LONG, FormatStyle.LONG, IsoChronology.INSTANCE, Locale.FRENCH, "d MMMM yyyy HH:mm:ss z"},
        {FormatStyle.MEDIUM, FormatStyle.MEDIUM, IsoChronology.INSTANCE, Locale.FRENCH, "d MMM yyyy HH:mm:ss"},
        {FormatStyle.SHORT, FormatStyle.SHORT, IsoChronology.INSTANCE, Locale.FRENCH, "dd/MM/yy HH:mm"},
        {FormatStyle.FULL, null, IsoChronology.INSTANCE, Locale.FRENCH, "EEEE d MMMM yyyy"},
        {FormatStyle.LONG, null, IsoChronology.INSTANCE, Locale.FRENCH, "d MMMM yyyy"},
        {FormatStyle.MEDIUM, null, IsoChronology.INSTANCE, Locale.FRENCH, "d MMM yyyy"},
        {FormatStyle.SHORT, null, IsoChronology.INSTANCE, Locale.FRENCH, "dd/MM/yy"},
        {null, FormatStyle.FULL, IsoChronology.INSTANCE, Locale.FRENCH, "HH' h 'mm z"},
        {null, FormatStyle.LONG, IsoChronology.INSTANCE, Locale.FRENCH, "HH:mm:ss z"},
        {null, FormatStyle.MEDIUM, IsoChronology.INSTANCE, Locale.FRENCH, "HH:mm:ss"},
        {null, FormatStyle.SHORT, IsoChronology.INSTANCE, Locale.FRENCH, "HH:mm"},

        // Japanese Locale and JapaneseChronology
        {FormatStyle.FULL, FormatStyle.FULL, JapaneseChronology.INSTANCE, Locale.JAPANESE, "Gy'\u5e74'M'\u6708'd'\u65e5' H'\u6642'mm'\u5206'ss'\u79d2' z"},
        {FormatStyle.LONG, FormatStyle.LONG, JapaneseChronology.INSTANCE, Locale.JAPANESE, "GGGGGy.MM.dd H:mm:ss z"},
        {FormatStyle.MEDIUM, FormatStyle.MEDIUM, JapaneseChronology.INSTANCE, Locale.JAPANESE, "GGGGGy.MM.dd H:mm:ss"},
        {FormatStyle.SHORT, FormatStyle.SHORT, JapaneseChronology.INSTANCE, Locale.JAPANESE, "GGGGGy.MM.dd H:mm"},
        {FormatStyle.FULL, null, JapaneseChronology.INSTANCE, Locale.JAPANESE, "Gy'\u5e74'M'\u6708'd'\u65e5'"},
        {FormatStyle.LONG, null, JapaneseChronology.INSTANCE, Locale.JAPANESE, "GGGGGy.MM.dd"},
        {FormatStyle.MEDIUM, null, JapaneseChronology.INSTANCE, Locale.JAPANESE, "GGGGGy.MM.dd"},
        {FormatStyle.SHORT, null, JapaneseChronology.INSTANCE, Locale.JAPANESE, "GGGGGy.MM.dd"},
        {null, FormatStyle.FULL, JapaneseChronology.INSTANCE, Locale.JAPANESE, "H'\u6642'mm'\u5206'ss'\u79d2' z"},
        {null, FormatStyle.LONG, JapaneseChronology.INSTANCE, Locale.JAPANESE, "H:mm:ss z"},
        {null, FormatStyle.MEDIUM, JapaneseChronology.INSTANCE, Locale.JAPANESE, "H:mm:ss"},
        {null, FormatStyle.SHORT, JapaneseChronology.INSTANCE, Locale.JAPANESE, "H:mm"},

        // Chinese Local and Chronology
        {FormatStyle.FULL, FormatStyle.FULL, MinguoChronology.INSTANCE, Locale.CHINESE, "Gy\u5e74M\u6708d\u65e5EEEE ahh'\u65f6'mm'\u5206'ss'\u79d2' z"},
        {FormatStyle.LONG, FormatStyle.LONG, MinguoChronology.INSTANCE, Locale.CHINESE, "Gy\u5e74M\u6708d\u65e5 ahh'\u65f6'mm'\u5206'ss'\u79d2'"},
        {FormatStyle.MEDIUM, FormatStyle.MEDIUM, MinguoChronology.INSTANCE, Locale.CHINESE, "Gy-M-d H:mm:ss"},
        {FormatStyle.SHORT, FormatStyle.SHORT, MinguoChronology.INSTANCE, Locale.CHINESE, "Gy-M-d ah:mm"},
        {FormatStyle.FULL, null, MinguoChronology.INSTANCE, Locale.CHINESE, "Gy\u5e74M\u6708d\u65e5EEEE"},
        {FormatStyle.LONG, null, MinguoChronology.INSTANCE, Locale.CHINESE, "Gy\u5e74M\u6708d\u65e5"},
        {FormatStyle.MEDIUM, null, MinguoChronology.INSTANCE, Locale.CHINESE, "Gy-M-d"},
        {FormatStyle.SHORT, null, MinguoChronology.INSTANCE, Locale.CHINESE, "Gy-M-d"},
        {null, FormatStyle.FULL, MinguoChronology.INSTANCE, Locale.CHINESE, "ahh'\u65f6'mm'\u5206'ss'\u79d2' z"},
        {null, FormatStyle.LONG, MinguoChronology.INSTANCE, Locale.CHINESE, "ahh'\u65f6'mm'\u5206'ss'\u79d2'"},
        {null, FormatStyle.MEDIUM, MinguoChronology.INSTANCE, Locale.CHINESE, "H:mm:ss"},
        {null, FormatStyle.SHORT, MinguoChronology.INSTANCE, Locale.CHINESE, "ah:mm"},
    };
}
 
Example 15
Project: openjdk-jdk10   File: TestDateTimeFormatterBuilderWithLocale.java   View Source Code Vote up 4 votes
@DataProvider(name="localePatterns")
Object[][] localizedDateTimePatterns() {
    return new Object[][] {
        // French Locale and ISO Chronology
        {FormatStyle.FULL, FormatStyle.FULL, IsoChronology.INSTANCE, Locale.FRENCH, "EEEE d MMMM y '\u00e0' HH:mm:ss zzzz"},
        {FormatStyle.LONG, FormatStyle.LONG, IsoChronology.INSTANCE, Locale.FRENCH, "d MMMM y '\u00e0' HH:mm:ss z"},
        {FormatStyle.MEDIUM, FormatStyle.MEDIUM, IsoChronology.INSTANCE, Locale.FRENCH, "d MMM y '\u00e0' HH:mm:ss"},
        {FormatStyle.SHORT, FormatStyle.SHORT, IsoChronology.INSTANCE, Locale.FRENCH, "dd/MM/y HH:mm"},
        {FormatStyle.FULL, null, IsoChronology.INSTANCE, Locale.FRENCH, "EEEE d MMMM y"},
        {FormatStyle.LONG, null, IsoChronology.INSTANCE, Locale.FRENCH, "d MMMM y"},
        {FormatStyle.MEDIUM, null, IsoChronology.INSTANCE, Locale.FRENCH, "d MMM y"},
        {FormatStyle.SHORT, null, IsoChronology.INSTANCE, Locale.FRENCH, "dd/MM/y"},
        {null, FormatStyle.FULL, IsoChronology.INSTANCE, Locale.FRENCH, "HH:mm:ss zzzz"},
        {null, FormatStyle.LONG, IsoChronology.INSTANCE, Locale.FRENCH, "HH:mm:ss z"},
        {null, FormatStyle.MEDIUM, IsoChronology.INSTANCE, Locale.FRENCH, "HH:mm:ss"},
        {null, FormatStyle.SHORT, IsoChronology.INSTANCE, Locale.FRENCH, "HH:mm"},

        // Japanese Locale and JapaneseChronology
        {FormatStyle.FULL, FormatStyle.FULL, JapaneseChronology.INSTANCE, Locale.JAPANESE, "Gy\u5e74M\u6708d\u65e5EEEE H\u6642mm\u5206ss\u79d2 zzzz"},
        {FormatStyle.LONG, FormatStyle.LONG, JapaneseChronology.INSTANCE, Locale.JAPANESE, "Gy\u5e74M\u6708d\u65e5 H:mm:ss z"},
        {FormatStyle.MEDIUM, FormatStyle.MEDIUM, JapaneseChronology.INSTANCE, Locale.JAPANESE, "Gy\u5e74M\u6708d\u65e5 H:mm:ss"},
        {FormatStyle.SHORT, FormatStyle.SHORT, JapaneseChronology.INSTANCE, Locale.JAPANESE, "GGGGGy/M/d H:mm"},
        {FormatStyle.FULL, null, JapaneseChronology.INSTANCE, Locale.JAPANESE, "Gy\u5e74M\u6708d\u65e5EEEE"},
        {FormatStyle.LONG, null, JapaneseChronology.INSTANCE, Locale.JAPANESE, "Gy\u5e74M\u6708d\u65e5"},
        {FormatStyle.MEDIUM, null, JapaneseChronology.INSTANCE, Locale.JAPANESE, "Gy\u5e74M\u6708d\u65e5"},
        {FormatStyle.SHORT, null, JapaneseChronology.INSTANCE, Locale.JAPANESE, "GGGGGy/M/d"},
        {null, FormatStyle.FULL, JapaneseChronology.INSTANCE, Locale.JAPANESE, "H\u6642mm\u5206ss\u79d2 zzzz"},
        {null, FormatStyle.LONG, JapaneseChronology.INSTANCE, Locale.JAPANESE, "H:mm:ss z"},
        {null, FormatStyle.MEDIUM, JapaneseChronology.INSTANCE, Locale.JAPANESE, "H:mm:ss"},
        {null, FormatStyle.SHORT, JapaneseChronology.INSTANCE, Locale.JAPANESE, "H:mm"},

        // Chinese Local and Chronology
        {FormatStyle.FULL, FormatStyle.FULL, MinguoChronology.INSTANCE, Locale.CHINESE, "Gy\u5e74M\u6708d\u65e5EEEE zzzz ah:mm:ss"},
        {FormatStyle.LONG, FormatStyle.LONG, MinguoChronology.INSTANCE, Locale.CHINESE, "Gy\u5e74M\u6708d\u65e5 z ah:mm:ss"},
        {FormatStyle.MEDIUM, FormatStyle.MEDIUM, MinguoChronology.INSTANCE, Locale.CHINESE, "Gy\u5e74M\u6708d\u65e5 ah:mm:ss"},
        {FormatStyle.SHORT, FormatStyle.SHORT, MinguoChronology.INSTANCE, Locale.CHINESE, "Gyy/M/d ah:mm"},
        {FormatStyle.FULL, null, MinguoChronology.INSTANCE, Locale.CHINESE, "Gy\u5e74M\u6708d\u65e5EEEE"},
        {FormatStyle.LONG, null, MinguoChronology.INSTANCE, Locale.CHINESE, "Gy\u5e74M\u6708d\u65e5"},
        {FormatStyle.MEDIUM, null, MinguoChronology.INSTANCE, Locale.CHINESE, "Gy\u5e74M\u6708d\u65e5"},
        {FormatStyle.SHORT, null, MinguoChronology.INSTANCE, Locale.CHINESE, "Gyy/M/d"},
        {null, FormatStyle.FULL, MinguoChronology.INSTANCE, Locale.CHINESE, "zzzz ah:mm:ss"},
        {null, FormatStyle.LONG, MinguoChronology.INSTANCE, Locale.CHINESE, "z ah:mm:ss"},
        {null, FormatStyle.MEDIUM, MinguoChronology.INSTANCE, Locale.CHINESE, "ah:mm:ss"},
        {null, FormatStyle.SHORT, MinguoChronology.INSTANCE, Locale.CHINESE, "ah:mm"},
    };
}
 
Example 16
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 17
Project: openjdk-jdk10   File: MessageCatalog.java   View Source Code Vote up 4 votes
private Locale getLocale(String localeName) {
    String language, country;
    int index;

    index = localeName.indexOf('_');
    if (index == -1) {
        //
        // Special case the builtin JDK languages
        //
        if (localeName.equals("de"))
            return Locale.GERMAN;
        if (localeName.equals("en"))
            return Locale.ENGLISH;
        if (localeName.equals("fr"))
            return Locale.FRENCH;
        if (localeName.equals("it"))
            return Locale.ITALIAN;
        if (localeName.equals("ja"))
            return Locale.JAPANESE;
        if (localeName.equals("ko"))
            return Locale.KOREAN;
        if (localeName.equals("zh"))
            return Locale.CHINESE;

        language = localeName;
        country = "";
    } else {
        if (localeName.equals("zh_CN"))
            return Locale.SIMPLIFIED_CHINESE;
        if (localeName.equals("zh_TW"))
            return Locale.TRADITIONAL_CHINESE;

        //
        // JDK also has constants for countries:  en_GB, en_US, en_CA,
        // fr_FR, fr_CA, de_DE, ja_JP, ko_KR.  We don't use those.
        //
        language = localeName.substring(0, index);
        country = localeName.substring(index + 1);
    }

    return new Locale(language, country);
}
 
Example 18
Project: ElementVueSpringbootCodeTemplate   File: UserUtil.java   View Source Code Vote up 4 votes
protected Locale initialValue() {
	// 语言的默认值
	return Locale.CHINESE;
}