List of usage examples for java.util Locale GERMANY
Locale GERMANY
To view the source code for java.util Locale GERMANY.
Click Source Link
From source file:de.perdian.commons.i18n.polyglot.PolyglotImplTest.java
@Test public void testGetMetaWithConfiguration() { StaticMessageSource messageSource = new StaticMessageSource(); messageSource.addMessage("prefix.key1.postfix", Locale.GERMANY, "value1"); PolyglotImpl<ExamplePolyglotWithConfiguration> polyglotImpl = new PolyglotImpl<>(); polyglotImpl.setInstanceClass(ExamplePolyglotWithConfiguration.class); polyglotImpl.setMessageSource(messageSource); PolyglotMeta polyglotMeta = polyglotImpl.getMeta(Locale.GERMANY); Assert.assertEquals(Locale.GERMANY, polyglotMeta.getLocale()); Assert.assertEquals(1, polyglotMeta.getKeys().size()); Assert.assertEquals(0, polyglotMeta.getMissingValueKeys().size()); Assert.assertTrue(polyglotMeta.getKeys().containsAll(Arrays.asList("prefix.key1.postfix"))); }
From source file:de.awtools.lang.TranslatorTest.java
@Test public void testTransformationGermany() { TranslatorFactory tf = new TranslatorFactory(); translator = tf.getTranslator("de.awtools.lang.TestTranslator", Locale.GERMANY); assertThat(translator.getString("test.error.fatal")).isEqualTo("Systemfehler. Programm wird abgebrochen!"); assertThat(translator.getString("test.text.1", "Andre")).isEqualTo("Der Andre ist in Ordnung."); assertThat(translator.getString("test.text.1", "Lars")).isEqualTo("Der Lars ist in Ordnung."); assertThat(translator.getString("test.text.2", "Andre", "der Lars")) .isEqualTo("Der Andre und der Lars spinnen."); }
From source file:com.anevis.jfreechartsamplespring.chart.ChartServiceImpl.java
private JFreeChart createPieChart() { List<PieChartData> dataList = pieChartDataRepository.findAll(); DefaultPieDataset dataSet = new DefaultPieDataset(); dataList.forEach(data -> dataSet.setValue(data.getCountry(), data.getWeight())); JFreeChart chart = ChartFactory.createPieChart("Anteil am Fondsvermgen", dataSet, true, false, Locale.GERMANY); return chart; }
From source file:de.perdian.commons.lang.conversion.impl.converters.TestStringToNumberConverter.java
@Test public void testConvertWithPatternAndLocaleDE() { StringToNumberConverter converter = new StringToNumberConverter("0.0", new SimpleLocaleContext(Locale.GERMANY)); Assert.assertEquals(2.2d, converter.convert("2,2").doubleValue(), 0); }
From source file:org.polymap.rhei.field.DateTimeFormField.java
public void init(IFormFieldSite _site) { this.site = _site; // The DateTime field supports seconds only, so we need the current // time without the millis for the nullValue in order to make it // comparable to the result of the DateTime Calendar cal = Calendar.getInstance(Locale.GERMANY); cal.set(Calendar.MILLISECOND, 0); this.nullValue = cal.getTime(); }
From source file:com.mobileman.projecth.web.service.LocaleService.java
/** * @param gender/*from w ww .j av a 2s .c om*/ * @return age.group. */ public String getGenderMessage(Gender gender) { final String result; if (gender == null) { result = messageSource.getMessage("gender.unknown", null, Locale.GERMANY); } else { result = messageSource.getMessage("gender." + gender.name().toLowerCase(), null, Locale.GERMANY); } return result; }
From source file:com.mobileman.projecth.business.MedicationServiceTest.java
/** * //ww w . j a v a 2s.com * @throws Exception */ @Test public void findByPzn() throws Exception { Medication medication = medicationService.findByPzn("2758099", Locale.getDefault()); assertNull(medication); medication = medicationService.findByPzn("2758099", Locale.GERMANY); assertNotNull(medication); assertNotNull(medication.getId()); assertEquals("2758099", medication.getPzn().getNumber()); assertEquals("PZN-2758099", medication.getPzn().format()); }
From source file:de.chott.jfreechartsample.service.ChartService.java
/** * Diese Methode erstellt ein PieChart aus den PieChart-Daten. Die Daten werden dabei nicht bergeben, sondern direkt vm Service angefragt. * Fr sptere Ausbaufhigkeit knnte man die zu verarbeitenden Daten als bergabeparameter mitgeben, statt sie direkt auslesen zu lassen. * /*from w w w . j a va2s. c o m*/ * @return das fertige PieChart. */ private JFreeChart createPieChart() { DefaultPieDataset dataSet = new DefaultPieDataset(); for (PieChartData data : pieChartDataService.loadAll()) { dataSet.setValue(data.getCountry(), data.getWeight()); } JFreeChart chart = ChartFactory.createPieChart("Anteil am Fondsvermgen", dataSet, true, false, Locale.GERMANY); return chart; }
From source file:de.fau.amos4.configuration.WebConfiguration.java
@Bean public LocaleResolver localeResolver() { SessionLocaleResolver slr = new SessionLocaleResolver(); slr.setDefaultLocale(Locale.GERMANY); return slr; }