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:com.mobileman.projecth.web.service.LocaleService.java
public String getReportCustonQuestions() { return messageSource.getMessage("report.custom.questions", null, Locale.GERMANY); }
From source file:de.perdian.commons.i18n.polyglot.PolyglotImplTest.java
@Test public void testGetMetaWithConfigurationAndNoValues() { PolyglotImpl<ExamplePolyglotWithConfiguration> polyglotImpl = new PolyglotImpl<>(); polyglotImpl.setInstanceClass(ExamplePolyglotWithConfiguration.class); polyglotImpl.setMessageSource(new StaticMessageSource()); PolyglotMeta polyglotMeta = polyglotImpl.getMeta(Locale.GERMANY); Assert.assertEquals(Locale.GERMANY, polyglotMeta.getLocale()); Assert.assertEquals(1, polyglotMeta.getKeys().size()); Assert.assertEquals(1, polyglotMeta.getMissingValueKeys().size()); Assert.assertTrue(polyglotMeta.getKeys().containsAll(Arrays.asList("prefix.key1.postfix"))); Assert.assertTrue(polyglotMeta.getMissingValueKeys().containsAll(Arrays.asList("prefix.key1.postfix"))); }
From source file:com.example.phonetic.KoelnerPhonetik.java
public double getRelativeValue(Object o1, Object o2) { String[] kopho1 = code(expandUmlauts(o1.toString().toUpperCase(Locale.GERMANY))); String[] kopho2 = code(expandUmlauts(o2.toString().toUpperCase(Locale.GERMANY))); for (int i = 0; i < kopho1.length; i++) { for (int ii = 0; ii < kopho2.length; ii++) { if (kopho1[i].equals(kopho2[ii])) { return 1; }/*www .j a va 2s . c om*/ } } return 0; }
From source file:org.mt4jx.components.visibleComponents.widgets.jfreechart.examples.MTJFreeChartExampleScene.java
public MTJFreeChartExampleScene(MTApplication mtApplication, String name) { super(mtApplication, name); this.setClearColor(new MTColor(0, 0, 96, 255)); //Show touches this.registerGlobalInputProcessor(new CursorTracer(mtApplication, this)); // Create Example Data DefaultCategoryDataset dataset = new DefaultCategoryDataset(); for (int i = 0; i < 10; i++) { dataset.addValue(10 * Math.random(), "MySeries", "T" + i); }/* www . j av a 2 s.c om*/ // Create a JFreeChart JFreeChart chart1 = ChartFactory.createLineChart("Line Chart", "x axis", "y axis", dataset, PlotOrientation.VERTICAL, true, true, false); // Put the JFreeChart into a MTJFreeChart wrapper MTJFreeChart mtChart1 = new MTJFreeChart(800, 600, mtApplication, chart1); // Create another chart DefaultPieDataset pds = new DefaultPieDataset(); pds.setValue("Java", new Double(17.773)); pds.setValue("C", new Double(15.822)); pds.setValue("C++", new Double(8.783)); pds.setValue("PHP", new Double(7.835)); pds.setValue("Python", new Double(6.265)); pds.setValue("C#", new Double(6.226)); pds.setValue("(Visual) Basic", new Double(5.867)); pds.setValue("Objective-C", new Double(3.011)); pds.setValue("Perl", new Double(2.857)); JFreeChart chart2 = ChartFactory.createPieChart3D( "Top 10: TIOBE Programming Community Index\nfor January 2011 (www.tiobe.com)", pds, true, true, Locale.GERMANY); PiePlot3D plot = (PiePlot3D) chart2.getPlot(); plot.setStartAngle(290); MTJFreeChart mtChart2 = new MTJFreeChart(800, 600, mtApplication, chart2); // enable redraw of the chart when it's scaled by the user mtChart2.setRedrawWhenScaled(true); this.getCanvas().addChild(mtChart1); this.getCanvas().addChild(mtChart2); mtChart1.setPositionGlobal(new Vector3D(mtApplication.width / 2f, mtApplication.height / 2f)); mtChart2.setPositionGlobal(new Vector3D(150 + mtApplication.width / 2f, 150 + mtApplication.height / 2f)); }
From source file:com.mobileman.projecth.web.service.LocaleService.java
/** * @return/*from w ww . j ava2s . c om*/ */ public String getMedicationFrequencyBiWeekly() { return messageSource.getMessage("medication.frequeency.bi-weekly", null, Locale.GERMANY); }
From source file:org.opendatakit.common.android.utilities.ODKDataUtilsTest.java
@Test public void testNormalizeDisplayName() throws JsonProcessingException { Map<String, Object> langMap = new TreeMap<String, Object>(); langMap.put("en_US", "This is a test"); langMap.put("en_GB", "Test is This"); langMap.put("en", "Huh Test"); langMap.put("fr", "Je suis"); langMap.put("default", "No way!"); String value = ODKFileUtils.mapper.writeValueAsString(langMap); String match;/*www .j av a2 s . c om*/ Locale.setDefault(Locale.US); match = ODKDataUtils.getLocalizedDisplayName(value); assertEquals("This is a test", match); Locale.setDefault(Locale.UK); match = ODKDataUtils.getLocalizedDisplayName(value); assertEquals("Test is This", match); Locale.setDefault(Locale.CANADA); match = ODKDataUtils.getLocalizedDisplayName(value); assertEquals("Huh Test", match); Locale.setDefault(Locale.CANADA_FRENCH); match = ODKDataUtils.getLocalizedDisplayName(value); assertEquals("Je suis", match); Locale.setDefault(Locale.GERMANY); match = ODKDataUtils.getLocalizedDisplayName(value); assertEquals("No way!", match); Locale.setDefault(Locale.US); }
From source file:com.mobileman.projecth.business.MedicationServiceTest.java
/** * // www . jav a 2 s.c om * @throws Exception */ @Test public void findByName() throws Exception { List<Medication> medications = medicationService.findByName("Kort 1", Locale.getDefault()); assertTrue(medications.isEmpty()); medications = medicationService.findByName("Kort 1", Locale.GERMANY); assertEquals(1, medications.size()); assertEquals("Kort 1", medications.get(0).getName()); medications = medicationService.findByName("Kort", Locale.GERMANY); assertEquals(4, medications.size()); }
From source file:com.mobileman.projecth.web.service.LocaleService.java
/** * @return// ww w . java 2 s . c om */ public String getMedicationFrequencyWeekly() { return messageSource.getMessage("medication.frequeency.weekly", null, Locale.GERMANY); }
From source file:de.awtools.lang.TranslatorTest.java
@Test public void testFailTransformation() { TranslatorFactory tf = new TranslatorFactory(); translator = tf.getTranslator("de.awtools.lang.TestTranslator", Locale.GERMANY); boolean b = StringUtils.equals("Das alles alles Unsinn", (translator.getString("test.text.3", "alles"))); assertThat(b).isFalse();// w w w . j a v a 2 s . c o m }
From source file:de.kletterfreak98.xmass.ui.WeightChart.java
public WeightChart(String title, TimeSeries values) { super(title); setIconImage(//from w w w .java 2 s .co m new ImageIcon(getClass().getClassLoader().getResource("de/kletterfreak98/xmass/resources/fav.png")) .getImage()); final String chartTitle = strings.getString("weightcourse"); final XYDataset dataset = new TimeSeriesCollection(values); final JFreeChart chart = ChartFactory.createTimeSeriesChart(chartTitle, strings.getString("date"), strings.getString("weightinkg"), dataset, false, true, false); final XYPlot plot = chart.getXYPlot(); plot.setDataset(1, new TimeSeriesCollection(values)); plot.mapDatasetToRangeAxis(1, 1); final XYItemRenderer renderer = plot.getRenderer(); renderer.setToolTipGenerator(StandardXYToolTipGenerator.getTimeSeriesInstance()); if (renderer instanceof StandardXYItemRenderer) { final StandardXYItemRenderer rr = (StandardXYItemRenderer) renderer; rr.setShapesFilled(true); } final StandardXYItemRenderer renderer2 = new StandardXYItemRenderer(); renderer2.setSeriesPaint(0, Color.black); renderer.setToolTipGenerator(StandardXYToolTipGenerator.getTimeSeriesInstance()); plot.setRenderer(1, renderer2); final DateAxis axis = (DateAxis) plot.getDomainAxis(); SimpleDateFormat sdf; if (Main.settings.getLang().equals(Locale.GERMANY)) { sdf = new SimpleDateFormat("dd.MM.yyyy"); axis.setDateFormatOverride(sdf); } else { sdf = new SimpleDateFormat("MM/dd/yyyy"); axis.setDateFormatOverride(sdf); } final ChartPanel chartPanel = new ChartPanel(chart); chartPanel.setPreferredSize(new java.awt.Dimension(500, 270)); JPanel panel = new JPanel(); JButton close = new JButton(strings.getString("close")); close.setPreferredSize(new Dimension(close.getWidth(), 30)); close.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { dispose(); } }); panel.setLayout(new BorderLayout()); panel.add(chartPanel, BorderLayout.CENTER); panel.add(close, BorderLayout.SOUTH); panel.setPreferredSize(new java.awt.Dimension(500, 270)); setContentPane(panel); setUndecorated(true); }