List of usage examples for java.util Locale KOREAN
Locale KOREAN
To view the source code for java.util Locale KOREAN.
Click Source Link
From source file:hk.idv.kenson.jrconsole.Console.java
/** * /*from w w w . ja v a 2 s . c o m*/ * @param localeString * @return */ private static Locale getLocale(String localeString) { if ("default".equals(localeString)) return Locale.getDefault(); if ("canada".equals(localeString)) return Locale.CANADA; if ("canada_french".equals(localeString)) return Locale.CANADA_FRENCH; if ("china".equals(localeString)) return Locale.CHINA; if ("chinese".equals(localeString)) return Locale.CHINESE; if ("english".equals(localeString)) return Locale.ENGLISH; if ("franch".equals(localeString)) return Locale.FRANCE; if ("german".equals(localeString)) return Locale.GERMAN; if ("germany".equals(localeString)) return Locale.GERMANY; if ("italian".equals(localeString)) return Locale.ITALIAN; if ("italy".equals(localeString)) return Locale.ITALY; if ("japan".equals(localeString)) return Locale.JAPAN; if ("japanese".equals(localeString)) return Locale.JAPANESE; if ("korea".equals(localeString)) return Locale.KOREA; if ("korean".equals(localeString)) return Locale.KOREAN; if ("prc".equals(localeString)) return Locale.PRC; if ("simplified_chinese".equals(localeString)) return Locale.SIMPLIFIED_CHINESE; if ("taiwan".equals(localeString)) return Locale.TAIWAN; if ("traditional_chinese".equals(localeString)) return Locale.TRADITIONAL_CHINESE; if ("uk".equals(localeString)) return Locale.UK; if ("us".equals(localeString)) return Locale.US; String parts[] = localeString.split("_", -1); if (parts.length == 1) return new Locale(parts[0]); else if (parts.length == 2) return new Locale(parts[0], parts[1]); else return new Locale(parts[0], parts[1], parts[2]); }
From source file:divya.myvision.TessActivity.java
public void setLang(String lang) { Locale locale;/*from w w w . j av a 2 s . c o m*/ if (lang.equals("Spanish")) { // Set up the Text To Speech engine. TextToSpeech.OnInitListener listener = new TextToSpeech.OnInitListener() { @Override public void onInit(final int status) { Locale locSpanish = new Locale("spa", "MEX"); tts.setLanguage(locSpanish); } }; tts = new TextToSpeech(this.getApplicationContext(), listener); locale = new Locale("spa", "MEX"); } else if (lang.equals("French")) { // Set up the Text To Speech engine. TextToSpeech.OnInitListener listener = new TextToSpeech.OnInitListener() { @Override public void onInit(final int status) { tts.setLanguage(Locale.FRENCH); } }; tts = new TextToSpeech(this.getApplicationContext(), listener); locale = new Locale("fr"); } else if (lang.equals("Japanese")) { // Set up the Text To Speech engine. TextToSpeech.OnInitListener listener = new TextToSpeech.OnInitListener() { @Override public void onInit(final int status) { tts.setLanguage(Locale.JAPANESE); } }; tts = new TextToSpeech(this.getApplicationContext(), listener); locale = new Locale("ja"); } else if (lang.equals("Chinese")) { // Set up the Text To Speech engine. TextToSpeech.OnInitListener listener = new TextToSpeech.OnInitListener() { @Override public void onInit(final int status) { tts.setLanguage(Locale.CHINESE); } }; tts = new TextToSpeech(this.getApplicationContext(), listener); locale = new Locale("zh"); } else if (lang.equals("German")) { // Set up the Text To Speech engine. TextToSpeech.OnInitListener listener = new TextToSpeech.OnInitListener() { @Override public void onInit(final int status) { tts.setLanguage(Locale.GERMAN); } }; tts = new TextToSpeech(this.getApplicationContext(), listener); locale = new Locale("de"); } else if (lang.equals("Italian")) { // Set up the Text To Speech engine. TextToSpeech.OnInitListener listener = new TextToSpeech.OnInitListener() { @Override public void onInit(final int status) { tts.setLanguage(Locale.ITALIAN); } }; tts = new TextToSpeech(this.getApplicationContext(), listener); locale = new Locale("it"); } else if (lang.equals("Korean")) { // Set up the Text To Speech engine. TextToSpeech.OnInitListener listener = new TextToSpeech.OnInitListener() { @Override public void onInit(final int status) { tts.setLanguage(Locale.KOREAN); } }; tts = new TextToSpeech(this.getApplicationContext(), listener); locale = new Locale("ko"); } else if (lang.equals("Hindi")) { // Set up the Text To Speech engine. TextToSpeech.OnInitListener listener = new TextToSpeech.OnInitListener() { @Override public void onInit(final int status) { Locale locHindhi = new Locale("hi"); tts.setLanguage(locHindhi); } }; tts = new TextToSpeech(this.getApplicationContext(), listener); locale = new Locale("hi"); } else if (lang.equals("Russian")) { // Set up the Text To Speech engine. TextToSpeech.OnInitListener listener = new TextToSpeech.OnInitListener() { @Override public void onInit(final int status) { Locale locHindhi = new Locale("ru"); tts.setLanguage(locHindhi); } }; tts = new TextToSpeech(this.getApplicationContext(), listener); locale = new Locale("ru"); } else { TextToSpeech.OnInitListener listener = new TextToSpeech.OnInitListener() { @Override public void onInit(final int status) { tts.setLanguage(Locale.US); } }; tts = new TextToSpeech(this.getApplicationContext(), listener); locale = new Locale("en"); } Locale.setDefault(locale); Configuration config = new Configuration(); config.setLocale(locale); this.getApplicationContext().getResources().updateConfiguration(config, null); }
From source file:com.hangum.tadpole.application.start.dialog.login.LoginDialog.java
/** * Create contents of the dialog.//from w w w . j a v a 2 s . com * @param parent */ @Override protected Control createDialogArea(Composite parent) { Composite container = (Composite) super.createDialogArea(parent); GridLayout gridLayout = (GridLayout) container.getLayout(); gridLayout.numColumns = 2; gridLayout.verticalSpacing = 5; gridLayout.horizontalSpacing = 5; gridLayout.marginHeight = 5; gridLayout.marginWidth = 5; compositeHead = new Composite(container, SWT.NONE); compositeHead.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1)); compositeHead.setLayout(new GridLayout(1, false)); lblLoginForm = new Label(compositeHead, SWT.NONE); lblLoginForm.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1)); lblLoginForm.setFont(SWTResourceManager.getFont(".SF NS Text", 15, SWT.NONE)); lblLoginForm.setText(Messages.get().LoginDialog_WelcomeMsg); lblLabelLblhangum = new Label(compositeHead, SWT.NONE); lblLabelLblhangum.setText(String.format(Messages.get().LoginDialog_ProjectRelease, SystemDefine.MAJOR_VERSION, SystemDefine.SUB_VERSION, SystemDefine.RELEASE_DATE)); Composite compositeLeftBtn = new Composite(container, SWT.NONE); compositeLeftBtn.setLayout(new GridLayout(1, false)); Button button = new Button(compositeLeftBtn, SWT.NONE); button.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1)); button.setImage(ResourceManager.getPluginImage(BrowserActivator.ID, "resources/TDB_64.png")); //$NON-NLS-1$ compositeLogin = new Composite(container, SWT.NONE); compositeLogin.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1)); compositeLogin.setLayout(new GridLayout(3, false)); lblEmail = new Label(compositeLogin, SWT.NONE); lblEmail.setText(Messages.get().LoginDialog_1); textEMail = new Text(compositeLogin, SWT.BORDER); textEMail.addKeyListener(new KeyAdapter() { @Override public void keyReleased(KeyEvent e) { if (e.keyCode == SWT.Selection) { if (!"".equals(textPasswd.getText())) //$NON-NLS-1$ okPressed(); else textPasswd.setFocus(); } } }); textEMail.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1)); btnCheckButton = new Button(compositeLogin, SWT.CHECK); btnCheckButton.setText(Messages.get().LoginDialog_9); //$NON-NLS-1$ lblPassword = new Label(compositeLogin, SWT.NONE); lblPassword.setText(Messages.get().LoginDialog_4); textPasswd = new Text(compositeLogin, SWT.BORDER | SWT.PASSWORD); textPasswd.addKeyListener(new KeyAdapter() { @Override public void keyReleased(KeyEvent e) { if (e.keyCode == SWT.Selection) { okPressed(); } } }); textPasswd.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1)); btnLogin = new Button(compositeLogin, SWT.NONE); btnLogin.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, true, 1, 2)); btnLogin.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { okPressed(); } }); btnLogin.setText(Messages.get().LoginDialog_15); lblLanguage = new Label(compositeLogin, SWT.NONE); lblLanguage.setText(Messages.get().LoginDialog_lblLanguage_text); comboLanguage = new Combo(compositeLogin, SWT.READ_ONLY); comboLanguage.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { changeUILocale(comboLanguage.getText()); } }); comboLanguage.add(Locale.ENGLISH.getDisplayLanguage(Locale.ENGLISH)); comboLanguage.add(Locale.KOREAN.getDisplayLanguage(Locale.ENGLISH)); comboLanguage.setData(Locale.ENGLISH.getDisplayLanguage(Locale.ENGLISH), Locale.ENGLISH); comboLanguage.setData(Locale.KOREAN.getDisplayLanguage(Locale.ENGLISH), Locale.KOREAN); comboLanguage.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1)); compositeTail = new Composite(container, SWT.NONE); compositeTail.setLayout(new GridLayout(3, false)); compositeTail.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1)); Label lblHangum = new Label(compositeTail, SWT.NONE); lblHangum.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1)); lblHangum.setText("License is GNU Lesser General Public License v.3"); Label lblHome = new Label(compositeTail, SWT.NONE); lblHome.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1)); lblHome.setText("<a href='" + Messages.get().LoginDialog_lblNewLabel_text_1 + "' target='_blank'>Home</a>"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ lblHome.setData(RWT.MARKUP_ENABLED, Boolean.TRUE); Label lblIssue = new Label(compositeTail, SWT.NONE); lblIssue.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1)); lblIssue.setText( "<a href='https://github.com/hangum/TadpoleForDBTools/issues' target='_blank'>Feedback</a>"); //$NON-NLS-1$ //$NON-NLS-2$ lblIssue.setData(RWT.MARKUP_ENABLED, Boolean.TRUE); AnalyticCaller.track("login"); //$NON-NLS-1$ initUI(); return compositeLogin; }
From source file:org.openflamingo.uploader.util.DateUtils.java
/** * java.util.Date java.util.GregorianCalendar . * * @param date //from ww w . ja v a 2 s. c om * @return GregorianCalendar */ public static java.util.GregorianCalendar dateToGregorianCalendar(Date date) { if (date == null) return null; GregorianCalendar cal = new GregorianCalendar(TimeZone.getTimeZone("GMT+09:00"), Locale.KOREAN); cal.setTime(date); return cal; }
From source file:io.uengine.util.DateUtils.java
/** * java.util.Date java.util.GregorianCalendar . * * @param date //from w w w. j a v a 2 s . c o m * @return GregorianCalendar */ public static GregorianCalendar dateToGregorianCalendar(Date date) { if (date == null) return null; GregorianCalendar cal = new GregorianCalendar(TimeZone.getTimeZone("GMT+09:00"), Locale.KOREAN); cal.setTime(date); return cal; }
From source file:com.team.formal.eyeshopping.MainActivity.java
private String convertResponseToString(BatchAnnotateImagesResponse response) { String message = "I found these things!!!!!!!!:\n\n"; WebDetection annotation = response.getResponses().get(0).getWebDetection(); if (annotation != null) { System.out.println("Entity:Score"); System.out.println("==============="); // for (WebEntity entity : annotation.getWebEntities()) { // message += String.format(Locale.KOREAN, "%.3f: %s", entity.getScore(), entity.getDescription()); // message += "\n"; // System.out.println(entity.getDescription() + " : " + entity.getScore()); // } // if(!annotation.getPagesWithMatchingImages().isEmpty()) { // System.out.println("\nPages with matching images: Score\n=="); // for (WebPage page : annotation.getPagesWithMatchingImages()) { // System.out.println(page.getUrl() + " : " + page.getScore()); // message += String.format(Locale.KOREAN, "%s: %s", page.getUrl(), page.getScore()); // message += "\n"; // } // } // if(!annotation.getPartialMatchingImages().isEmpty()) { // System.out.println("\nPages with partially matching images: Score\n=="); // for (WebImage image : annotation.getPartialMatchingImages()) { // System.out.println(image.getUrl() + " : " + image.getScore()); // } // } // if(!annotation.getFullMatchingImages().isEmpty()) { // System.out.println("\nPages with fully matching images: Score\n=="); // for (WebImage image : annotation.getFullMatchingImages()) { ////from w w w. j a v a2 s. c o m // System.out.println(image.getUrl() + " : " + image.getScore()); // } // } for (WebImage image : annotation.getVisuallySimilarImages()) { System.out.println(image.getUrl() + " : " + image.getScore()); message += String.format(Locale.KOREAN, "%s: %s", image.getUrl(), image.getScore()); message += "\n"; } } else { message += "nothing"; } return message; }
From source file:com.team.formal.eyeshopping.MainActivity.java
private String convertResponseToStringLabel(BatchAnnotateImagesResponse response) { String message = "I found these things!!!!!!!!:\n\n"; java.util.List<EntityAnnotation> annotations = response.getResponses().get(0).getLabelAnnotations(); if (annotations != null) { System.out.println("Entity:Score"); System.out.println("==============="); for (EntityAnnotation entity : annotations) { message += String.format(Locale.KOREAN, "%.3f: %s", entity.getScore(), entity.getDescription()); message += "\n"; System.out.println(entity.getDescription() + " : " + entity.getScore()); }//from w ww . j a va 2 s . c o m } else { message += "nothing"; } return message; }