Java Code Examples for java.util.Locale#FRENCH

The following examples show how to use java.util.Locale#FRENCH . 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: BatchSeniorityLeaveManagement.java    From axelor-open-suite with GNU Affero General Public License v3.0 7 votes vote down vote up
@Override
protected void start() throws IllegalAccessException {

  super.start();

  if (batch.getHrBatch().getDayNumber() == null
      || batch.getHrBatch().getDayNumber() == BigDecimal.ZERO
      || batch.getHrBatch().getLeaveReason() == null)
    TraceBackService.trace(
        new AxelorException(
            TraceBackRepository.CATEGORY_CONFIGURATION_ERROR,
            I18n.get(IExceptionMessage.BATCH_MISSING_FIELD)),
        ExceptionOriginRepository.LEAVE_MANAGEMENT,
        batch.getId());
  total = 0;
  noValueAnomaly = 0;
  confAnomaly = 0;
  this.maker = new TemplateMaker(Locale.FRENCH, TEMPLATE_DELIMITER, TEMPLATE_DELIMITER);
  hrConfig =
      Beans.get(HRConfigRepository.class)
          .all()
          .filter("self.company.id = ?1 ", batch.getHrBatch().getCompany().getId())
          .fetchOne();
  checkPoint();
}
 
Example 2
Source File: MessageTagTest.java    From dss with GNU Lesser General Public License v2.1 6 votes vote down vote up
@Test
public void allFRMessagesPresent() {
	MessageTag[] values = MessageTag.values();
	assertNotNull(values);
	assertTrue(values.length > 0);
	
	// all messages that are not defined in the language-related messages_*.properties
	// will be overridden by default values
	I18nProvider i18nFRProvider = new I18nProvider(Locale.FRENCH);
	for (MessageTag messageTag : values) {
		String message = i18nFRProvider.getMessage(messageTag);
		assertNotNull(message, "A message property for a MessageTag with id [" + messageTag.getId() + "] is not defined!");
	}
}
 
Example 3
Source File: CustomPortletMode168ImplTest.java    From portals-pluto with Apache License 2.0 6 votes vote down vote up
/**
 * Test method for {@link org.apache.pluto.container.om.portlet.impl.jsr168.CustomPortletModeImpl#addDescription(org.apache.pluto.container.om.portlet.Description)}.
 */
@Test
public void testAddDescription() {
   assertEquals(1, pad.getCustomPortletModes().size());
   CustomPortletMode cpm = 
         new CustomPortletModeImpl(pad.getCustomPortletModes().get(0));
   assertEquals(1, cpm.getDescriptions().size());
   Locale loc = Locale.FRENCH;
   String text = "Some description";
   Description d = new DescriptionImpl(loc, text);
   cpm.addDescription(d);
   
   List<Description> list = cpm.getDescriptions();
   assertNotNull(list);
   assertEquals(2, list.size());
   for (Description desc : list) {
      if (desc.getLocale().equals(loc)) {
         assertEquals(text, desc.getText());
      } else {
         assertEquals("description", desc.getText());
      }
   }

}
 
Example 4
Source File: UserDataConstraint286ImplTest.java    From portals-pluto with Apache License 2.0 6 votes vote down vote up
/**
 * Test method for {@link org.apache.pluto.container.om.portlet.impl.jsr168.UserDataConstraintImpl#addDescription(org.apache.pluto.container.om.portlet.Description)}.
 */
@Test
public void testAddDescription() {
   Locale loc = Locale.FRENCH;
   String text = "Some description";
   Description d = new DescriptionImpl(loc, text);
   udc.addDescription(d);

   List<Description> list = udc.getDescriptions();
   assertNotNull(list);
   assertEquals(2, list.size());
   for (Description desc : list) {
      if (desc.getLocale().equals(loc)) {
         assertEquals(text, desc.getText());
      } else {
         assertEquals("description", desc.getText());
      }
   }
}
 
Example 5
Source File: ServerSideLessThanTestUnitTest.java    From lightning with MIT License 5 votes vote down vote up
@DataProvider(name = "locale")
private Object[][] locale() {
    return new Object[][]{
            {Locale.ENGLISH},
            {Locale.FRENCH},
    };
}
 
Example 6
Source File: TestZoneTextPrinterParser.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
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);
    }
}
 
Example 7
Source File: LanguageTest.java    From document-management-software with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Test
public void testLoadStopwords() throws IOException {
	Language language = new Language(Locale.FRENCH);
	Set<String> swords = language.getStopWords();
	assertNotNull(swords);
	assertEquals(126, swords.size());
}
 
Example 8
Source File: I18nProviderTest.java    From dss with GNU Lesser General Public License v2.1 5 votes vote down vote up
@Test
public void nestedMessageTagTest() {
	Locale systemLocale = Locale.getDefault();
	try {
		Locale.setDefault(Locale.ENGLISH);
		
		MessageTag validationTime = MessageTag.VT_VALIDATION_TIME;
		MessageTag messageTag = MessageTag.CERT_QUALIFICATION_AT_TIME.setArgs(validationTime);
	
		final I18nProvider i18nProvider = new I18nProvider(Locale.ENGLISH);
		String message = i18nProvider.getMessage(messageTag);
		assertNotNull(message);
		assertEquals("Certificate Qualification at validation time", message);
		
		final I18nProvider i18nFrenchProvider = new I18nProvider(Locale.FRENCH);
		message = i18nFrenchProvider.getMessage(messageTag);
		assertNotNull(message);
		assertEquals("Qualification du certificat au moment de la validation", message);

		final I18nProvider i18nGermanProvider = new I18nProvider(Locale.GERMAN);
		message = i18nGermanProvider.getMessage(messageTag);
		assertNotNull(message);
		assertEquals("Certificate Qualification at validation time", message);
	} finally {
		Locale.setDefault(systemLocale); // restore default
	}
}
 
Example 9
Source File: DateParserTest.java    From apollo with Apache License 2.0 5 votes vote down vote up
@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);
}
 
Example 10
Source File: FrenchComplexFormatTest.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
@Override
protected Locale getLocale() {
    return Locale.FRENCH;
}
 
Example 11
Source File: FrenchRealVectorFormatTest.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
@Override
protected Locale getLocale() {
    return Locale.FRENCH;
}
 
Example 12
Source File: MessageCatalog.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
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 13
Source File: FrenchVector3DFormatTest.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
@Override
protected Locale getLocale() {
    return Locale.FRENCH;
}
 
Example 14
Source File: FrenchVector3DFormatTest.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
@Override
protected Locale getLocale() {
    return Locale.FRENCH;
}
 
Example 15
Source File: MessageCatalog.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
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 16
Source File: FrenchKeyboard.java    From FirefoxReality with Mozilla Public License 2.0 4 votes vote down vote up
@Override
public Locale getLocale() {
    return Locale.FRENCH;
}
 
Example 17
Source File: FrenchRealVectorFormatTest.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
@Override
protected Locale getLocale() {
    return Locale.FRENCH;
}
 
Example 18
Source File: FrenchComplexFormatTest.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
@Override
protected Locale getLocale() {
    return Locale.FRENCH;
}
 
Example 19
Source File: FrenchComplexFormatTest.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
protected Locale getLocale() {
    return Locale.FRENCH;
}
 
Example 20
Source File: FrenchComplexFormatTest.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
@Override
protected Locale getLocale() {
    return Locale.FRENCH;
}