List of usage examples for java.util Locale ENGLISH
Locale ENGLISH
To view the source code for java.util Locale ENGLISH.
Click Source Link
From source file:net.sourceforge.fenixedu.presentationTier.Action.externalServices.epfl.ExportPhdIndividualProgramProcessInformation.java
@Override public ActionForward execute(ActionMapping mapping, ActionForm actionForm, HttpServletRequest request, HttpServletResponse response) throws Exception { setLocale(request, Locale.ENGLISH); I18N.setLocale(request.getSession(), Locale.ENGLISH); final ActionForward actionForward = checkPermissions(request, response); if (actionForward == null) { final String method = request.getParameter("method"); if (method == null || method.isEmpty() || method.equals("login")) { displayPresentationPage(request, response); } else if (method.equals("displayCandidatePage")) { displayCandidatePage(request, response); } else if (method.equals("displayRefereePage")) { displayRefereePage(request, response); } else if (method.equals("downloadCandidateDocuments")) { downloadCandidateDocuments(request, response); } else if (method.equals("displayPhoto")) { displayPhoto(request, response); } else if (method.equals("exportInformationXml")) { exportInformationXml(request, response); }/*from w w w .j ava2s .c om*/ } return actionForward; }
From source file:com.sk89q.craftbook.sponge.mechanics.area.complex.CopyManager.java
/** * Save a copy to disk. The copy will be cached. * * @param namespace The namespace//from ww w . jav a 2 s . co m * @param id The area ID * @param copy The CuboidCopy to save * * @throws IOException Thrown if an IO error occured when saving * @throws DataException Thrown if the data was invalid */ public static void save(String namespace, String id, CuboidCopy copy) throws IOException, DataException { File folder = new File(new File(CraftBookPlugin.inst().getWorkingDirectory(), "areas"), namespace); if (!folder.exists()) { folder.mkdirs(); } id = id.toLowerCase(Locale.ENGLISH); copy.save(new File(folder, id + getFileSuffix())); }
From source file:com.tesora.dve.charset.NativeCollationCatalogImpl.java
@Override public NativeCollation findDefaultCollationForCharSet(String charsetName) { final List<NativeCollation> collations = collationsByCharsetName .get(charsetName.toUpperCase(Locale.ENGLISH)); if (collations == null) { return null; }/*w w w . j a v a 2 s .c om*/ final NativeCollation defaultCollation = (NativeCollation) CollectionUtils.find(collations, new Predicate() { @Override public boolean evaluate(Object arg0) { if (arg0 instanceof NativeCollation) { final NativeCollation nc = (NativeCollation) arg0; return nc.isDefault(); } return false; } }); if (defaultCollation == null) { throw new PECodingException("No default collation found for character set '" + charsetName + "'"); } return defaultCollation; }
From source file:io.crate.metadata.PartitionName.java
/** * decodes an encoded ident into it's values *///from w w w . j a va 2 s . c om @Nullable public static List<BytesRef> decodeIdent(@Nullable String ident) { if (ident == null) { return ImmutableList.of(); } byte[] inputBytes = BASE32.decode(ident.toUpperCase(Locale.ROOT)); try (StreamInput in = StreamInput.wrap(inputBytes)) { int size = in.readVInt(); List<BytesRef> values = new ArrayList<>(size); for (int i = 0; i < size; i++) { values.add(StringType.INSTANCE.streamer().readValueFrom(in)); } return values; } catch (IOException e) { throw new IllegalArgumentException(String.format(Locale.ENGLISH, "Invalid partition ident: %s", ident), e); } }
From source file:net.bible.service.format.osistohtml.taghandler.TitleHandler.java
@Override public void start(Attributes attrs) { //JSword adds the chapter no at the top but hide this because the chapter is in the And Bible header boolean addedByJSword = attrs.getLength() == 1 && OSISUtil.GENERATED_CONTENT.equals(attrs.getValue(OSISUtil.OSIS_ATTR_TYPE)); // otherwise show if user wants Titles or the title is canonical isShowTitle = !addedByJSword && (parameters.isShowTitles() || "true".equalsIgnoreCase(attrs.getValue(OSISUtil.OSIS_ATTR_CANONICAL))); if (isShowTitle) { // ESV has subType butNETtext has lower case subtype so concatenate both and search with contains() String subtype = attrs.getValue(OSISUtil.OSIS_ATTR_SUBTYPE) + attrs.getValue(OSISUtil.OSIS_ATTR_SUBTYPE.toLowerCase(Locale.ENGLISH)); isMoveBeforeVerse = (StringUtils.containsIgnoreCase(subtype, PREVERSE) || (!verseInfo.isTextSinceVerse && verseInfo.currentVerseNo > 0)); if (isMoveBeforeVerse) { // section Titles normally come before a verse, so overwrite the, already written verse, which is rewritten on writer.finishedInserting writer.beginInsertAt(verseInfo.positionToInsertBeforeVerse); }//ww w .j ava 2s. c om // get title type from level String titleClass = "heading" + TagHandlerHelper.getAttribute(OSISUtil.OSIS_ATTR_LEVEL, attrs, "1"); writer.write("<h1 class='" + titleClass + "'>"); } else { writer.setDontWrite(true); } }
From source file:ph.fingra.statisticsweb.controller.CommonController.java
@RequestMapping(method = RequestMethod.POST, value = "/changeLocaleByAjax") public @ResponseBody String changeLocale(@RequestParam("lang") String lang, HttpServletRequest request, HttpServletResponse response) {//w ww . j av a2s . c o m LocaleResolver localeResolver = RequestContextUtils.getLocaleResolver(request); Locale locale = null; if (lang.equals("ko")) { locale = Locale.KOREA; } else if (lang.equals("cn")) { locale = Locale.CHINA; } else if (lang.equals("hk")) { locale = Locale.TRADITIONAL_CHINESE; } else if (lang.equals("ja")) { locale = Locale.JAPAN; } else { locale = Locale.ENGLISH; } localeResolver.setLocale(request, response, locale); return null; }
From source file:de.tudarmstadt.ukp.dkpro.uby.vis.webapp.page.ApplicationPageBase.java
@SuppressWarnings({ "serial" }) private void commonInit() { getSession().setLocale(Locale.ENGLISH); Properties props = getVersionProperties(); String versionString = props.getProperty("version") + " (" + props.getProperty("timestamp") + ")"; versionLabel = new Label("version", versionString); embeddedDbWarning = new Label("embeddedDbWarning", "USE THIS INSTALLATION FOR TESTING ONLY -- " + "AN EMBEDDED DATABASE IS NOT SUPPORTED FOR PRODUCTION USE"); embeddedDbWarning.setVisible(false); // try { // String driver = repository.getDatabaseDriverName(); // embeddedDbWarning.setVisible(StringUtils.contains(driver.toLowerCase(Locale.US), // "hsql")); // }// ww w.ja v a 2 s . com // catch (Throwable e) { // LOG.warn("Unable to determine which database is being used", e); // } add(versionLabel); add(embeddedDbWarning); }
From source file:fi.helsinki.opintoni.service.CourseServiceTest.java
@Test public void thatStudentAndTeacherCourseDtosAreFetched() { expectTeacherCourses();//www . j ava 2 s .c o m expectStudentCourses(); Set<CourseDto> courseDtos = courseService.getCourses(Optional.of(TestConstants.STUDENT_NUMBER), Optional.of(TestConstants.TEACHER_NUMBER), Locale.ENGLISH); assertThat(courseDtos).hasSize(3); assertThat(courseDtos, hasCourseWithRealisationId(TestConstants.STUDENT_COURSE_REALISATION_ID)); assertThat(courseDtos, hasCourseWithRealisationId(TestConstants.TEACHER_COURSE_REALISATION_ID)); assertThat(courseDtos, hasCourseWithRealisationId(TestConstants.EXAM_TEACHER_COURSE_REALISATION_ID)); }
From source file:jp.go.nict.langrid.management.web.view.page.language.component.form.validator.SameInlineLanguagePathValidator.java
public void validate(Form form) { List<String[]> list = target.getNoValidateValueList(); for (String[] inputs : list) { List<String> tmp = new ArrayList<String>(); for (int i = 0; i < inputs.length; i++) { if (isWildcard(inputs[i]) || !InternalLanguageModel.getCodeList().contains(inputs[i])) { continue; }/*from w w w . j a v a 2s .co m*/ if (tmp.contains(inputs[i])) { form.error(MessageManager.getMessage("SameInlineLanguagePathValidator", Locale.ENGLISH)); return; } tmp.add(inputs[i]); } } }