List of usage examples for java.util Locale FRENCH
Locale FRENCH
To view the source code for java.util Locale FRENCH.
Click Source Link
From source file:test.unit.be.fedict.eid.applet.MessagesTest.java
@Test public void testFrenchMessages() throws Exception { Locale locale = Locale.FRENCH; Messages messages = new Messages(locale); String message = messages.getMessage(Messages.MESSAGE_ID.GENERIC_ERROR); LOG.debug("message: " + message); assertEquals("Erreur gnrale.", message); }
From source file:org.vaadin.viritin.it.aspect.MTableLazyLoadingWithEntityAspect.java
@Override public Component getTestComponent() { Random r = new Random(0); final List<User> listOfPersons = Service.getListOfPersons(1000).stream().map(person -> { User u = new User(person); u.setLocale(r.nextBoolean() ? Locale.ENGLISH : Locale.FRENCH); return u; }).collect(Collectors.toList()); MTable<User> table = new MTable<>((firstRow, sortAscending, property) -> { if (property != null) { if (property.equals("localizedSalutation")) { Collections.sort(listOfPersons, new Comparator<User>() { @Override/*from w ww . j a va 2 s .c o m*/ public int compare(User o1, User o2) { return localizedSalutation(o1).compareTo(localizedSalutation(o2)); } }); } else { Collections.sort(listOfPersons, new BeanComparator<>(property)); } if (!sortAscending) { Collections.reverse(listOfPersons); } } int last = firstRow + LazyList.DEFAULT_PAGE_SIZE; if (last > listOfPersons.size()) { last = listOfPersons.size(); } return new ArrayList<User>(listOfPersons.subList(firstRow, last)); }, () -> (int) Service.count()) .withProperties("localizedSalutation", "locale", "person.firstName", "person.lastName") .withColumnHeaders("Salutation", "Locale", "Forename", "Name").withFullWidth() .withGeneratedColumn("localizedSalutation", u -> localizedSalutation(u)); return table; }
From source file:org.jasig.cas.web.view.CasReloadableMessageBundleTests.java
@Test public void testGetMessageFromDefaultBundle() { final String msg = this.loader.getMessage("screen.other.message", null, Locale.FRENCH); assertEquals(msg, "another"); }
From source file:org.exoplatform.commons.notification.NotificationUtilsTest.java
public void testGetLocale() { String language = null;// w w w . ja v a2 s. c om Locale actual = NotificationUtils.getLocale(language); assertEquals(Locale.ENGLISH, actual); language = ""; actual = NotificationUtils.getLocale(language); assertEquals(Locale.ENGLISH, actual); language = "fr"; actual = NotificationUtils.getLocale(language); assertEquals(Locale.FRENCH, actual); language = "pt_BR"; actual = NotificationUtils.getLocale(language); assertEquals(new Locale("pt", "BR"), actual); language = "pt_BR_BR"; actual = NotificationUtils.getLocale(language); assertEquals(new Locale("pt", "BR", "BR"), actual); }
From source file:org.jasig.cas.web.view.CasReloadableMessageBundleTests.java
@Test public void testUseCodeAsMessageItself() { this.loader.setUseCodeAsDefaultMessage(true); final String msg = this.loader.getMessage("does.not.exist", null, Locale.FRENCH); assertEquals(msg, "does.not.exist"); }
From source file:fr.mycellar.interfaces.web.services.nav.NavigationWebService.java
@PostConstruct public void build() { ResourceBundle resourceBundle = ResourceBundle.getBundle("Menu", Locale.FRENCH); List<IDescriptor> descriptors = descriptorServiceFacade.getDescriptors(); SortedMap<Integer, NavDescriptor> menuPages = new TreeMap<Integer, NavDescriptor>(); for (IDescriptor descriptor : descriptors) { if (descriptor instanceof IMenuDescriptor) { IMenuDescriptor menuDescriptor = ((IMenuDescriptor) descriptor); if (menuDescriptor.getParentKey() != null) { NavHeaderDescriptor header = getHeader(resourceBundle.getString(menuDescriptor.getParentKey()), menuPages);/*from ww w. ja v a2 s . co m*/ if (header == null) { header = new NavHeaderDescriptor(resourceBundle.getString(menuDescriptor.getParentKey()), menuDescriptor.getIcon()); menuPages.put(menuDescriptor.getWeight(), header); } header.addPage(menuDescriptor.getWeight(), new NavPageDescriptor(menuDescriptor.getRoute(), resourceBundle.getString(menuDescriptor.getTitleKey()), menuDescriptor.getIcon())); } else { menuPages.put(menuDescriptor.getWeight(), new NavPageDescriptor(menuDescriptor.getRoute(), resourceBundle.getString(menuDescriptor.getTitleKey()), menuDescriptor.getIcon())); } } } menu = new ArrayList<NavDescriptor>(menuPages.values()); }
From source file:org.obiba.onyx.engine.StageTest.java
/** * Tests that the returned stage description is localized. */// w w w . j av a 2 s.c o m @Test public void testGetDescription() { Stage heightMeasurementStage = new Stage(); heightMeasurementStage.setName("Height_Measurement"); MessageSourceResolvable resolvableDescription = heightMeasurementStage.getDescription(); String expectedEnglishLocalizedStageDescription = "Height Measurement"; applicationContextMock.setMessage(expectedEnglishLocalizedStageDescription); String actualEnglishLocalizedStageDescription = applicationContextMock.getMessage(resolvableDescription, Locale.ENGLISH); Assert.assertEquals(expectedEnglishLocalizedStageDescription, actualEnglishLocalizedStageDescription); // TODO: Substitute true French translation when it is added to the resource bundle String expectedFrenchLocalizedStageDescription = "fr:Height Measurement"; applicationContextMock.setMessage(expectedFrenchLocalizedStageDescription); String actualFrenchLocalizedStageDescription = applicationContextMock.getMessage(resolvableDescription, Locale.FRENCH); Assert.assertEquals(expectedFrenchLocalizedStageDescription, actualFrenchLocalizedStageDescription); }
From source file:test.unit.be.fedict.eid.tsl.EtsiTslLifecycleTest.java
@Test public void testLC001() throws Exception { // setup//from ww w . j av a 2 s.co m TrustServiceList trustServiceList = TrustServiceListFactory.newInstance(); // scheme operator name trustServiceList.setSchemeOperatorName("EN:SchemeOperatorName", Locale.ENGLISH); trustServiceList.setSchemeOperatorName("NL:SchemeOperatorName", new Locale("nl")); trustServiceList.setSchemeOperatorName("FR:SchemeOperatorName", Locale.FRENCH); trustServiceList.setSchemeOperatorName("DE:SchemeOperatorName", Locale.GERMAN); // scheme operator postal address PostalAddressType schemeOperatorPostalAddress = new PostalAddressType(); schemeOperatorPostalAddress.setStreetAddress("Maria-Theresiastraat 1/3"); schemeOperatorPostalAddress.setLocality("Brussels"); schemeOperatorPostalAddress.setStateOrProvince("Brussels"); schemeOperatorPostalAddress.setPostalCode("1000"); schemeOperatorPostalAddress.setCountryName("Belgium"); trustServiceList.setSchemeOperatorPostalAddress(schemeOperatorPostalAddress, Locale.ENGLISH); schemeOperatorPostalAddress.setStreetAddress("Maria-Theresiastraat 1/3"); schemeOperatorPostalAddress.setLocality("Brussel"); schemeOperatorPostalAddress.setStateOrProvince("Brussel"); schemeOperatorPostalAddress.setPostalCode("1000"); schemeOperatorPostalAddress.setCountryName("Belgi"); trustServiceList.setSchemeOperatorPostalAddress(schemeOperatorPostalAddress, new Locale("nl")); // scheme operator electronic address /* List<String> electronicAddresses = new LinkedList<String>(); electronicAddresses.add("http://www.fedict.belgium.be/"); electronicAddresses.add("mailto://eid@belgium.be"); */ trustServiceList.setSchemeOperatorElectronicAddresses(Locale.ENGLISH, "http://www.fedict.belgium.be/"); trustServiceList.setSchemeOperatorElectronicAddresses(Locale.ENGLISH, "http://www.fedict.belgium.be/"); // scheme name trustServiceList.setSchemeName( "BE:Supervision/Accreditation Status List of certification services from Certification Service Providers, which are supervised/accredited by the referenced Scheme Operator Member State for compliance with the relevant provisions laid down in Directive 1999/93/EC of the European Parliament and of the Council of 13 December 1999 on a Community framework for electronic signatures", Locale.ENGLISH); // scheme information URIs trustServiceList.addSchemeInformationUri("https://www.e-contract.be/tsl/", Locale.ENGLISH); // status determination approach trustServiceList.setStatusDeterminationApproach(TrustServiceList.STATUS_DETERMINATION_APPROPRIATE); // scheme type /* * The Scheme Type URIs can actually be visited. We should provide some * information to ETSI for the BE schemerules. */ trustServiceList.addSchemeType(TrustServiceList.SCHEME_RULE_COMMON, Locale.ENGLISH); /* * The BE schemerules MUSH be provided. We can add extra paths for * language. For example: http:// * uri.etsi.org/TrstSvc/eSigDir-1999-93-EC-TrustedList/schemerules/BE/nl */ trustServiceList.addSchemeType("http://uri.etsi.org/TrstSvc/eSigDir-1999-93-EC-TrustedList/schemerules/BE", Locale.ENGLISH); // scheme territory trustServiceList.setSchemeTerritory("BE"); // legal notice trustServiceList.addLegalNotice( "The applicable legal framework for the present TSL implementation of the Trusted List of supervised/accredited Certification Service Providers for Belgium is the Directive 1999/93/EC of the European Parliament and of the Council of 13 December 1999 on a Community framework for electronic signatures and its implementation in Belgian laws.", Locale.ENGLISH); // historical information period /* * Volgens de wet van 9 JULI 2001. Wet houdende vaststelling van * bepaalde regels in verband met het juridisch kader voor elektronische * handtekeningen en certificatiediensten: Bijlage II - punt i) alle * relevante informatie over een gekwalificeerd certificaat te * registreren gedurende de nuttige termijn van dertig jaar, in het * bijzonder om een certificatiebewijs te kunnen voorleggen bij * gerechtelijke procedures. */ trustServiceList.setHistoricalInformationPeriod(3653 * 3); // list issue date time DateTime listIssueDateTime = new DateTime(); trustServiceList.setListIssueDateTime(listIssueDateTime); // next update DateTime nextUpdateDateTime = listIssueDateTime.plusMonths(6); trustServiceList.setNextUpdate(nextUpdateDateTime); // distribution point File tslFile = File.createTempFile("tsl-LC001-", ".xml"); trustServiceList.addDistributionPoint("https://www.e-contract.be/tsl/" + tslFile.getName()); // sign TSL KeyPair keyPair = TrustTestUtils.generateKeyPair(2048); PrivateKey privateKey = keyPair.getPrivate(); DateTime notBefore = new DateTime(); DateTime notAfter = notBefore.plusYears(1); X509Certificate certificate = TrustTestUtils.generateSelfSignedCertificate(keyPair, "C=BE, CN=Belgium Trust List Scheme Operator", notBefore, notAfter); trustServiceList.sign(privateKey, certificate); // save TSL trustServiceList.saveAs(tslFile); LOG.debug("TSL file: " + tslFile.getAbsolutePath()); }
From source file:caillou.company.clonemanager.gui.customComponent.settings.SettingsController.java
@Override public void initialize(URL location, ResourceBundle resources) { languageComboBoxId.setCellFactory(new Callback<ListView<Language>, ListCell<Language>>() { @Override/* www .j a v a 2s . c o m*/ public ListCell<Language> call(ListView<Language> language) { return new LanguageListCell(); } }); languageComboBoxId.setButtonCell(new LanguageListCell()); Language frenchLanguage = new Language(Locale.FRENCH); Language englishLanguage = new Language(Locale.ENGLISH); ObservableList<Language> languages = FXCollections.observableArrayList(); languages.add(englishLanguage); languages.add(frenchLanguage); languageComboBoxId.setItems(languages); Locale currentLocale = SpringFxmlLoader.getLocale(); if (currentLocale.equals(Locale.FRENCH)) { languageComboBoxId.setValue(frenchLanguage); } else { languageComboBoxId.setValue(englishLanguage); } languageComboBoxId.valueProperty().addListener(new ChangeListener<Language>() { @Override public void changed(ObservableValue<? extends Language> observable, Language oldValue, Language newValue) { SpringFxmlLoader.changeLocale(newValue.getLocale()); } }); }
From source file:net.sf.gazpachoquest.questionnaires.views.login.OldLoginView.java
private ComboBox createLanguageSelector() { ComboBox languageSelector = new ComboBox("com.vaadin.demo.dashboard.DashboardUI.Language"); languageSelector.setImmediate(true); languageSelector.setNullSelectionAllowed(false); addLocale(Locale.ENGLISH, languageSelector); addLocale(Locale.FRENCH, languageSelector); addLocale(new Locale("es"), languageSelector); // languageSelector.setValue(I18NStaticService.getI18NServive().getLocale()); /*-languageSelector.addValueChangeListener(new ValueChangeListener() { /*from ww w . j a v a 2s . c o m*/ private static final long serialVersionUID = 1L; @Override public void valueChange(ValueChangeEvent event) { Locale locale = (Locale) (event.getProperty().getValue()); I18NStaticService.getI18NServive().setLocale(locale); getUI().requestRepaintAll(); } });*/ return languageSelector; }