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:org.yccheok.jstock.gui.JStock.java
private void jRadioButtonMenuItem2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jRadioButtonMenuItem2ActionPerformed // Avoid from Confirm Dialog to pop up when user change to same language (i.e. simplified chinese) if (false == Utils.isSimplifiedChinese(this.jStockOptions.getLocale())) { // Do not suprise user with sudden restart. Ask for their permission to do so. final int result = JOptionPane.showConfirmDialog(this, MessagesBundle.getString("question_message_restart_now"), MessagesBundle.getString("question_title_restart_now"), JOptionPane.YES_NO_OPTION); if (result == JOptionPane.YES_OPTION) { String country = Locale.TRADITIONAL_CHINESE.getCountry().equals(Locale.getDefault().getCountry()) ? Locale.SIMPLIFIED_CHINESE.getCountry() : Locale.getDefault().getCountry(); final Locale locale = new Locale(Locale.SIMPLIFIED_CHINESE.getLanguage(), country, Locale.getDefault().getVariant()); this.jStockOptions.setLocale(locale); org.yccheok.jstock.gui.Utils.restartApplication(this); } // return to the previous selection if the user press "no" in the dialog else {//from w w w . ja v a 2 s . c o m if (this.jStockOptions.getLocale().getLanguage().compareTo(Locale.ENGLISH.getLanguage()) == 0) { this.jRadioButtonMenuItem1.setSelected(true); } else if (Utils.isTraditionalChinese(this.jStockOptions.getLocale())) { this.jRadioButtonMenuItem4.setSelected(true); } else if (this.jStockOptions.getLocale().getLanguage() .compareTo(Locale.GERMAN.getLanguage()) == 0) { this.jRadioButtonMenuItem3.setSelected(true); } else if (this.jStockOptions.getLocale().getLanguage() .compareTo(Locale.ITALIAN.getLanguage()) == 0) { this.jRadioButtonMenuItem5.setSelected(true); } else if (this.jStockOptions.getLocale().getLanguage() .compareTo(Locale.FRENCH.getLanguage()) == 0) { this.jRadioButtonMenuItem6.setSelected(true); } } } }
From source file:org.yccheok.jstock.gui.JStock.java
private void jRadioButtonMenuItem3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jRadioButtonMenuItem3ActionPerformed // Avoid from Confirm Dialog to pop up when user change to same language (i.e. german) if (false == this.jStockOptions.getLocale().getLanguage().equals(Locale.GERMAN.getLanguage())) { // Do not suprise user with sudden restart. Ask for their permission to do so. final int result = JOptionPane.showConfirmDialog(this, MessagesBundle.getString("question_message_restart_now"), MessagesBundle.getString("question_title_restart_now"), JOptionPane.YES_NO_OPTION); if (result == JOptionPane.YES_OPTION) { final Locale locale = new Locale(Locale.GERMAN.getLanguage(), Locale.getDefault().getCountry(), Locale.getDefault().getVariant()); this.jStockOptions.setLocale(locale); org.yccheok.jstock.gui.Utils.restartApplication(this); } // return to the previous selection if the user press "no" in the dialog else {//from www .j a v a2 s . c om if (this.jStockOptions.getLocale().getLanguage().compareTo(Locale.ENGLISH.getLanguage()) == 0) { this.jRadioButtonMenuItem1.setSelected(true); } else if (Utils.isTraditionalChinese(this.jStockOptions.getLocale())) { this.jRadioButtonMenuItem4.setSelected(true); } else if (Utils.isSimplifiedChinese(this.jStockOptions.getLocale())) { this.jRadioButtonMenuItem2.setSelected(true); } else if (this.jStockOptions.getLocale().getLanguage() .compareTo(Locale.ITALIAN.getLanguage()) == 0) { this.jRadioButtonMenuItem5.setSelected(true); } else if (this.jStockOptions.getLocale().getLanguage() .compareTo(Locale.FRENCH.getLanguage()) == 0) { this.jRadioButtonMenuItem6.setSelected(true); } } } }
From source file:org.openmrs.util.OpenmrsConstants.java
/** * @return Collection of locales available to openmrs * @deprecated//from w w w. ja va 2 s. c o m */ public static final Collection<Locale> OPENMRS_LOCALES() { List<Locale> languages = new Vector<Locale>(); languages.add(Locale.US); languages.add(Locale.UK); languages.add(Locale.FRENCH); languages.add(SPANISH_LANGUAGE); languages.add(PORTUGUESE_LANGUAGE); languages.add(ITALIAN_LANGUAGE); return languages; }
From source file:org.openmrs.util.OpenmrsConstants.java
/** * @return Collection of locales that the concept dictionary should be aware of * @see ConceptService#getLocalesOfConceptNames() * @deprecated//w ww. j a v a2 s. c om */ public static final Collection<Locale> OPENMRS_CONCEPT_LOCALES() { List<Locale> languages = new Vector<Locale>(); languages.add(Locale.ENGLISH); languages.add(Locale.FRENCH); languages.add(SPANISH_LANGUAGE); languages.add(PORTUGUESE_LANGUAGE); languages.add(ITALIAN_LANGUAGE); return languages; }
From source file:org.openmrs.util.OpenmrsConstants.java
/** * @return Mapping of Locales to locale specific date pattern * @deprecated use the {@link org.openmrs.api.context.Context#getDateFormat()} *//*from ww w . ja va2 s .c om*/ public static final Map<String, String> OPENMRS_LOCALE_DATE_PATTERNS() { if (OPENMRS_LOCALE_DATE_PATTERNS == null) { Map<String, String> patterns = new HashMap<String, String>(); patterns.put(Locale.US.toString().toLowerCase(), "MM/dd/yyyy"); patterns.put(Locale.UK.toString().toLowerCase(), "dd/MM/yyyy"); patterns.put(Locale.FRENCH.toString().toLowerCase(), "dd/MM/yyyy"); patterns.put(Locale.GERMAN.toString().toLowerCase(), "MM.dd.yyyy"); patterns.put(SPANISH_LANGUAGE.toString().toLowerCase(), "dd/MM/yyyy"); patterns.put(PORTUGUESE_LANGUAGE.toString().toLowerCase(), "dd/MM/yyyy"); patterns.put(ITALIAN_LANGUAGE.toString().toLowerCase(), "dd/MM/yyyy"); OPENMRS_LOCALE_DATE_PATTERNS = patterns; } return OPENMRS_LOCALE_DATE_PATTERNS; }
From source file:org.yccheok.jstock.gui.JStock.java
private void jRadioButtonMenuItem4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jRadioButtonMenuItem4ActionPerformed // Avoid from Confirm Dialog to pop up when user change to same language (i.e. german) if (false == Utils.isTraditionalChinese(this.jStockOptions.getLocale())) { // Do not suprise user with sudden restart. Ask for their permission to do so. final int result = JOptionPane.showConfirmDialog(this, MessagesBundle.getString("question_message_restart_now"), MessagesBundle.getString("question_title_restart_now"), JOptionPane.YES_NO_OPTION); if (result == JOptionPane.YES_OPTION) { // Unline simplified chinese, we will not use Locale.getDefault().getCountry(). // Instead, we will be using Locale.TRADITIONAL_CHINESE.getCountry(). final Locale locale = new Locale(Locale.TRADITIONAL_CHINESE.getLanguage(), Locale.TRADITIONAL_CHINESE.getCountry(), Locale.getDefault().getVariant()); this.jStockOptions.setLocale(locale); org.yccheok.jstock.gui.Utils.restartApplication(this); } // return to the previous selection if the user press "no" in the dialog else {/*from w w w . j a v a 2 s . c o m*/ if (this.jStockOptions.getLocale().getLanguage().compareTo(Locale.ENGLISH.getLanguage()) == 0) { this.jRadioButtonMenuItem1.setSelected(true); } else if (Utils.isSimplifiedChinese(this.jStockOptions.getLocale())) { this.jRadioButtonMenuItem2.setSelected(true); } else if (this.jStockOptions.getLocale().getLanguage() .compareTo(Locale.GERMAN.getLanguage()) == 0) { this.jRadioButtonMenuItem3.setSelected(true); } else if (this.jStockOptions.getLocale().getLanguage() .compareTo(Locale.ITALIAN.getLanguage()) == 0) { this.jRadioButtonMenuItem5.setSelected(true); } else if (this.jStockOptions.getLocale().getLanguage() .compareTo(Locale.FRENCH.getLanguage()) == 0) { this.jRadioButtonMenuItem6.setSelected(true); } } } }
From source file:org.yccheok.jstock.gui.JStock.java
private void jRadioButtonMenuItem5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jRadioButtonMenuItem5ActionPerformed // Avoid from Confirm Dialog to pop up when user change to same language (i.e. german) if (false == this.jStockOptions.getLocale().getLanguage().equals(Locale.ITALIAN.getLanguage())) { // Do not suprise user with sudden restart. Ask for their permission to do so. final int result = JOptionPane.showConfirmDialog(this, MessagesBundle.getString("question_message_restart_now"), MessagesBundle.getString("question_title_restart_now"), JOptionPane.YES_NO_OPTION); if (result == JOptionPane.YES_OPTION) { final Locale locale = new Locale(Locale.ITALIAN.getLanguage(), Locale.getDefault().getCountry(), Locale.getDefault().getVariant()); this.jStockOptions.setLocale(locale); org.yccheok.jstock.gui.Utils.restartApplication(this); } // return to the previous selection if the user press "no" in the dialog else {/* w ww .j a va2 s . c o m*/ if (this.jStockOptions.getLocale().getLanguage().compareTo(Locale.ENGLISH.getLanguage()) == 0) { this.jRadioButtonMenuItem1.setSelected(true); } else if (Utils.isTraditionalChinese(this.jStockOptions.getLocale())) { this.jRadioButtonMenuItem4.setSelected(true); } else if (Utils.isSimplifiedChinese(this.jStockOptions.getLocale())) { this.jRadioButtonMenuItem2.setSelected(true); } else if (this.jStockOptions.getLocale().getLanguage() .compareTo(Locale.GERMAN.getLanguage()) == 0) { this.jRadioButtonMenuItem3.setSelected(true); } else if (this.jStockOptions.getLocale().getLanguage() .compareTo(Locale.FRENCH.getLanguage()) == 0) { this.jRadioButtonMenuItem6.setSelected(true); } } } }
From source file:org.openmrs.api.ConceptServiceTest.java
/** * @see ConceptService#saveConcept(Concept) */// www .j a va2 s. c o m @Test @Verifies(value = "should set a preferred name for each locale if none is marked", method = "saveConcept(Concept)") public void saveConcept_shouldSetAPreferredNameForEachLocaleIfNoneIsMarked() throws Exception { //add some other locales to locale.allowed.list for testing purposes GlobalProperty gp = Context.getAdministrationService() .getGlobalPropertyObject(OpenmrsConstants.GLOBAL_PROPERTY_LOCALE_ALLOWED_LIST); gp.setPropertyValue(gp.getPropertyValue().concat(",fr,ja,en_GB")); Context.getAdministrationService().saveGlobalProperty(gp); Concept concept = new Concept(); concept.addName(new ConceptName("name1", Locale.ENGLISH)); concept.addName(new ConceptName("name2", Locale.ENGLISH)); concept.addName(new ConceptName("name3", Locale.FRENCH)); concept.addName(new ConceptName("name4", Locale.FRENCH)); concept.addName(new ConceptName("name5", Locale.JAPANESE)); concept.addName(new ConceptName("name6", Locale.JAPANESE)); concept = Context.getConceptService().saveConcept(concept); Assert.assertNotNull(concept.getPreferredName(Locale.ENGLISH)); Assert.assertNotNull(concept.getPreferredName(Locale.FRENCH)); Assert.assertNotNull(concept.getPreferredName(Locale.JAPANESE)); }
From source file:org.yccheok.jstock.gui.JStock.java
private void jRadioButtonMenuItem6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jRadioButtonMenuItem6ActionPerformed // Avoid from Confirm Dialog to pop up when user change to same language (i.e. german) if (false == this.jStockOptions.getLocale().getLanguage().equals(Locale.FRENCH.getLanguage())) { // Do not suprise user with sudden restart. Ask for their permission to do so. final int result = JOptionPane.showConfirmDialog(this, MessagesBundle.getString("question_message_restart_now"), MessagesBundle.getString("question_title_restart_now"), JOptionPane.YES_NO_OPTION); if (result == JOptionPane.YES_OPTION) { final Locale locale = new Locale(Locale.FRENCH.getLanguage(), Locale.getDefault().getCountry(), Locale.getDefault().getVariant()); this.jStockOptions.setLocale(locale); org.yccheok.jstock.gui.Utils.restartApplication(this); } // return to the previous selection if the user press "no" in the dialog else {/* w w w.j av a2s. co m*/ if (this.jStockOptions.getLocale().getLanguage().compareTo(Locale.ENGLISH.getLanguage()) == 0) { this.jRadioButtonMenuItem1.setSelected(true); } else if (Utils.isTraditionalChinese(this.jStockOptions.getLocale())) { this.jRadioButtonMenuItem4.setSelected(true); } else if (Utils.isSimplifiedChinese(this.jStockOptions.getLocale())) { this.jRadioButtonMenuItem2.setSelected(true); } else if (this.jStockOptions.getLocale().getLanguage() .compareTo(Locale.ITALIAN.getLanguage()) == 0) { this.jRadioButtonMenuItem5.setSelected(true); } else if (this.jStockOptions.getLocale().getLanguage() .compareTo(Locale.GERMAN.getLanguage()) == 0) { this.jRadioButtonMenuItem3.setSelected(true); } } } }
From source file:org.alfresco.filesys.repo.ContentDiskDriverTest.java
/** * Excel 2003 With Versionable file/* w w w . jav a 2s .c o m*/ * * CreateFile 5EE27100 * RenameFile oldPath:\Espaces Utilisateurs\System\Cherries.xls, * newPath:\Espaces Utilisateurs\System\Cherries.xls~RF172f241.TMP * RenameFile oldName=\Espaces Utilisateurs\System\5EE27100, * newName=\Espaces Utilisateurs\System\Cherries.xls, session:WNB0 * * Set Delete On Close for Cherries.xls~RF172f241.TMP */ public void testExcel2003SaveShuffle() throws Exception { //fail("not yet implemented"); logger.debug("testScenarioExcel2003SaveShuffle"); final String FILE_NAME = "Cherries.xls"; final String FILE_TITLE = "Cherries"; final String FILE_DESCRIPTION = "This is a test document to test CIFS shuffle"; final String FILE_OLD_TEMP = "Cherries.xls~RF172f241.TMP"; final String FILE_NEW_TEMP = "5EE27100"; final QName RESIDUAL_MTTEXT = QName.createQName("{gsxhjsx}", "whatever"); class TestContext { NetworkFile firstFileHandle; NetworkFile newFileHandle; NetworkFile oldFileHandle; NodeRef testNodeRef; // node ref of test.doc Serializable testCreatedDate; } ; final TestContext testContext = new TestContext(); final String TEST_DIR = TEST_ROOT_DOS_PATH + "\\testScenarioMSExcel2003SaveShuffle"; ServerConfiguration scfg = new ServerConfiguration("testServer"); TestServer testServer = new TestServer("testServer", scfg); final SrvSession testSession = new TestSrvSession(666, testServer, "test", "remoteName"); DiskSharedDevice share = getDiskSharedDevice(); final TreeConnection testConnection = testServer.getTreeConnection(share); final RetryingTransactionHelper tran = transactionService.getRetryingTransactionHelper(); /** * Clean up just in case garbage is left from a previous run */ RetryingTransactionCallback<Void> deleteGarbageFileCB = new RetryingTransactionCallback<Void>() { @Override public Void execute() throws Throwable { driver.deleteFile(testSession, testConnection, TEST_DIR + "\\" + FILE_NAME); return null; } }; /** * Create a file in the test directory */ try { tran.doInTransaction(deleteGarbageFileCB); } catch (Exception e) { // expect to go here } RetryingTransactionCallback<Void> createFileCB = new RetryingTransactionCallback<Void>() { @Override public Void execute() throws Throwable { /** * Create the test directory we are going to use */ FileOpenParams createRootDirParams = new FileOpenParams(TEST_ROOT_DOS_PATH, 0, AccessMode.ReadWrite, FileAttribute.NTNormal, 0); FileOpenParams createDirParams = new FileOpenParams(TEST_DIR, 0, AccessMode.ReadWrite, FileAttribute.NTNormal, 0); driver.createDirectory(testSession, testConnection, createRootDirParams); driver.createDirectory(testSession, testConnection, createDirParams); /** * Create the file we are going to use */ FileOpenParams createFileParams = new FileOpenParams(TEST_DIR + "\\" + FILE_NAME, 0, AccessMode.ReadWrite, FileAttribute.NTNormal, 0); testContext.firstFileHandle = driver.createFile(testSession, testConnection, createFileParams); assertNotNull(testContext.firstFileHandle); // now load up the node with lots of other stuff that we will test to see if it gets preserved during the // shuffle. testContext.testNodeRef = getNodeForPath(testConnection, TEST_DIR + "\\" + FILE_NAME); nodeService.addAspect(testContext.testNodeRef, ContentModel.ASPECT_VERSIONABLE, null); // test non CM namespace property nodeService.setProperty(testContext.testNodeRef, TransferModel.PROP_ENABLED, true); // test CM property not related to an aspect nodeService.setProperty(testContext.testNodeRef, ContentModel.PROP_ADDRESSEE, "Fred"); nodeService.setProperty(testContext.testNodeRef, ContentModel.PROP_TITLE, FILE_TITLE); nodeService.setProperty(testContext.testNodeRef, ContentModel.PROP_DESCRIPTION, FILE_DESCRIPTION); /** * MLText value - also a residual value in a non cm namespace */ MLText mltext = new MLText(); mltext.addValue(Locale.FRENCH, "Bonjour"); mltext.addValue(Locale.ENGLISH, "Hello"); mltext.addValue(Locale.ITALY, "Buongiorno"); mlAwareNodeService.setProperty(testContext.testNodeRef, RESIDUAL_MTTEXT, mltext); // classifiable chosen since its not related to any properties. nodeService.addAspect(testContext.testNodeRef, ContentModel.ASPECT_CLASSIFIABLE, null); //nodeService.createAssociation(testContext.testNodeRef, targetRef, assocTypeQName); return null; } }; tran.doInTransaction(createFileCB, false, true); /** * Write some content to the test file */ RetryingTransactionCallback<Void> writeFileCB = new RetryingTransactionCallback<Void>() { @Override public Void execute() throws Throwable { String testContent = "MS Excel 2003 shuffle test"; byte[] testContentBytes = testContent.getBytes(); testContext.firstFileHandle.writeFile(testContentBytes, testContentBytes.length, 0, 0); testContext.firstFileHandle.close(); testContext.testCreatedDate = nodeService.getProperty(testContext.testNodeRef, ContentModel.PROP_CREATED); MLText multi = (MLText) mlAwareNodeService.getProperty(testContext.testNodeRef, RESIDUAL_MTTEXT); multi.getValues(); return null; } }; tran.doInTransaction(writeFileCB, false, true); /** * b) Save the new file */ RetryingTransactionCallback<Void> saveNewFileCB = new RetryingTransactionCallback<Void>() { @Override public Void execute() throws Throwable { FileOpenParams createFileParams = new FileOpenParams(TEST_DIR + "\\" + FILE_NEW_TEMP, 0, AccessMode.ReadWrite, FileAttribute.NTNormal, 0); testContext.newFileHandle = driver.createFile(testSession, testConnection, createFileParams); assertNotNull(testContext.newFileHandle); String testContent = "MS Word 2003 shuffle test This is new content"; byte[] testContentBytes = testContent.getBytes(); testContext.newFileHandle.writeFile(testContentBytes, testContentBytes.length, 0, 0); testContext.newFileHandle.close(); return null; } }; tran.doInTransaction(saveNewFileCB, false, true); /** * rename the old file */ RetryingTransactionCallback<Void> renameOldFileCB = new RetryingTransactionCallback<Void>() { @Override public Void execute() throws Throwable { driver.renameFile(testSession, testConnection, TEST_DIR + "\\" + FILE_NAME, TEST_DIR + "\\" + FILE_OLD_TEMP); return null; } }; tran.doInTransaction(renameOldFileCB, false, true); RetryingTransactionCallback<Void> validateOldFileGoneCB = new RetryingTransactionCallback<Void>() { @Override public Void execute() throws Throwable { try { driver.deleteFile(testSession, testConnection, TEST_DIR + "\\" + FILE_NAME); } catch (IOException e) { // expect to go here since previous step renamed the file. } return null; } }; tran.doInTransaction(validateOldFileGoneCB, false, true); /** * Move the new file into place, stuff should get shuffled */ RetryingTransactionCallback<Void> moveNewFileCB = new RetryingTransactionCallback<Void>() { @Override public Void execute() throws Throwable { driver.renameFile(testSession, testConnection, TEST_DIR + "\\" + FILE_NEW_TEMP, TEST_DIR + "\\" + FILE_NAME); return null; } }; tran.doInTransaction(moveNewFileCB, false, true); RetryingTransactionCallback<Void> validateCB = new RetryingTransactionCallback<Void>() { @Override public Void execute() throws Throwable { NodeRef shuffledNodeRef = getNodeForPath(testConnection, TEST_DIR + "\\" + FILE_NAME); Map<QName, Serializable> props = nodeService.getProperties(shuffledNodeRef); // Check trx:enabled has been shuffled. assertTrue("node does not contain shuffled ENABLED property", props.containsKey(TransferModel.PROP_ENABLED)); // check my residual MLText has been transferred assertTrue(props.containsKey(RESIDUAL_MTTEXT)); // Check the titled aspect is correct assertEquals("name wrong", FILE_NAME, nodeService.getProperty(shuffledNodeRef, ContentModel.PROP_NAME)); assertEquals("title wrong", FILE_TITLE, nodeService.getProperty(shuffledNodeRef, ContentModel.PROP_TITLE)); assertEquals("description wrong", FILE_DESCRIPTION, nodeService.getProperty(shuffledNodeRef, ContentModel.PROP_DESCRIPTION)); // commented out due to ALF-7641 // CIFS shuffle, does not preseve MLText values. // Map<QName, Serializable> mlProps = mlAwareNodeService.getProperties(shuffledNodeRef); // MLText multi = (MLText)mlAwareNodeService.getProperty(shuffledNodeRef, RESIDUAL_MTTEXT) ; // multi.getValues(); // check auditable properties // commented out due to ALF-7635 // assertEquals("creation date not preserved", ((Date)testContext.testCreatedDate).getTime(), ((Date)nodeService.getProperty(shuffledNodeRef, ContentModel.PROP_CREATED)).getTime()); // commented out due to ALF-7628 // assertEquals("ADDRESSEE PROPERTY Not copied", "Fred", nodeService.getProperty(shuffledNodeRef, ContentModel.PROP_ADDRESSEE)); // assertTrue("CLASSIFIABLE aspect not present", nodeService.hasAspect(shuffledNodeRef, ContentModel.ASPECT_CLASSIFIABLE)); // commented out due to ALF-7584. // assertEquals("noderef changed", testContext.testNodeRef, shuffledNodeRef); return null; } }; tran.doInTransaction(validateCB, true, true); /** * Clean up just in case garbage is left from a previous run */ RetryingTransactionCallback<Void> deleteOldFileCB = new RetryingTransactionCallback<Void>() { @Override public Void execute() throws Throwable { driver.deleteFile(testSession, testConnection, TEST_DIR + "\\" + FILE_OLD_TEMP); return null; } }; tran.doInTransaction(deleteOldFileCB, false, true); }