本文整理匯總了Java中java.util.Locale.FRENCH屬性的典型用法代碼示例。如果您正苦於以下問題:Java Locale.FRENCH屬性的具體用法?Java Locale.FRENCH怎麽用?Java Locale.FRENCH使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類java.util.Locale
的用法示例。
在下文中一共展示了Locale.FRENCH屬性的14個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getContentData
private ContentData getContentData()
{
ContentContext contentCtx = new ContentContext(null, null);
String contentUrl = contentStore.getWriter(contentCtx).getContentUrl();
ContentData contentData = new ContentData(
contentUrl,
MimetypeMap.MIMETYPE_TEXT_PLAIN,
12335L,
"UTF-8",
Locale.FRENCH);
return contentData;
}
示例2: formatDateLong
static String formatDateLong(final int jour){
GregorianCalendar cal = new GregorianCalendar();
cal.add(Calendar.DAY_OF_MONTH, jour);
Date date = cal.getTime();
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd", Locale.FRENCH);
return simpleDateFormat.format(date);
}
示例3: isStandardLanguage_FR
@Test
public void isStandardLanguage_FR() {
// given
Locale locale = Locale.FRENCH;
// when
boolean result = LocaleHandler.isStandardLanguage(locale);
// then
assertEquals(Boolean.FALSE, Boolean.valueOf(result));
}
示例4: getLocale
public static Locale getLocale(String isoCountryCode){
Locale locale = Locale.FRENCH;
Locale[] locales = Locale.getAvailableLocales();
for (int i = 0; i < locales.length; i++){
locale = locales[i];
//System.out.println(i + ": " + locale.getLanguage() + ", " + locale.getCountry() + ", " + locale.getDisplayName());
if (isoCountryCode.equals(locale.getCountry()))
return locale;
}
return locale;
}
示例5: isSharedFlyweight
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;
}
示例6: getDates
public LinkedHashMap<String, String> getDates(){
LinkedHashMap<String, String> mapDates = new LinkedHashMap<String, String>();
DateFormat dateFormat = new SimpleDateFormat("EEEEEEE dd MMMM yyyy", Locale.FRENCH);
DateFormat dateFormat1 = new SimpleDateFormat("/MM/yyyy", Locale.FRENCH);
DateFormat dateFormat2 = new SimpleDateFormat("yyyy-MM-", Locale.FRENCH);
Calendar cal = Calendar.getInstance();
String isMonday = "false";
int day = cal.get(Calendar.DAY_OF_WEEK);
if(day==2){
isMonday="true";
cal.add(Calendar.DATE, -3);
}else{
cal.add(Calendar.DATE, -1);
}
String yesterday = dateFormat.format(cal.getTime());
String month = "01".concat(dateFormat1.format(cal.getTime()));
String likeMonth = dateFormat2.format(cal.getTime()).concat("%");
String splitYear []= getCurrentAnneUniv().split("-");
String formatYear = splitYear[2].concat("-").concat(splitYear[1]).concat("-").concat(splitYear[0]);
mapDates.put("isMonday", isMonday);
mapDates.put("yesterday", yesterday);
mapDates.put("month", month);
mapDates.put("likeMonth", likeMonth);
mapDates.put("year", getCurrentAnneUniv());
mapDates.put("formatYear", formatYear);
return mapDates;
}
示例7: getLocale
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);
}
示例8: test_ParseText
public void test_ParseText() {
Locale[] locales = new Locale[] { Locale.ENGLISH, Locale.JAPANESE, Locale.FRENCH };
Set<String> zids = ZoneRulesProvider.getAvailableZoneIds();
for (Locale locale : locales) {
parseText(zids, locale, TextStyle.FULL, false);
parseText(zids, locale, TextStyle.FULL, true);
parseText(zids, locale, TextStyle.SHORT, false);
parseText(zids, locale, TextStyle.SHORT, true);
}
}
示例9: testSetters
@Test
public void testSetters() throws Exception
{
WithResponse callBack = new WithResponse(Status.STATUS_OK, ResponseWriter.DEFAULT_JSON_CONTENT, ResponseWriter.CACHE_NEVER);
callBack.setStatus(Status.STATUS_GONE);
Cache myCache = new Cache(new Description.RequiredCache()
{
@Override
public boolean getNeverCache()
{
return false;
}
@Override
public boolean getIsPublic()
{
return true;
}
@Override
public boolean getMustRevalidate()
{
return true;
}
});
callBack.setCache(myCache);
ContentInfo myContent = new ContentInfoImpl(Format.HTML.mimetype(),"UTF-16", 12, Locale.FRENCH);
callBack.setContentInfo(myContent);
assertEquals(Status.STATUS_GONE, callBack.getStatus());
assertEquals(myCache, callBack.getCache());
assertEquals(myContent, callBack.getContentInfo());
}
示例10: testParseWithFormatAndLocale
@Test
public void testParseWithFormatAndLocale() throws Exception {
Date someDate = assembleDate(2016, 9, 28, 15, 10, 10, 123);
Locale someLocale = Locale.FRENCH;
String someFormat = "EEE, d MMM yyyy HH:mm:ss.SSS Z";
SimpleDateFormat someDateFormat = new SimpleDateFormat(someFormat, someLocale);
String dateText = someDateFormat.format(someDate);
checkWithFormatAndLocale(someDate, dateText, someFormat, someLocale);
}
示例11: DbMessages_fr
public DbMessages_fr() throws IOException {
super(Locale.FRENCH);
}
示例12: localizedDateTimePatterns
@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"},
};
}
示例13: localizedDateTimePatterns
@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"},
};
}
示例14: MyResourcesEU
public MyResourcesEU() {
super("java.class", "eu",
Locale.GERMAN, Locale.FRENCH, new Locale("es"));
}