Example usage for java.util Locale ENGLISH

List of usage examples for java.util Locale ENGLISH

Introduction

In this page you can find the example usage for java.util Locale ENGLISH.

Prototype

Locale ENGLISH

To view the source code for java.util Locale ENGLISH.

Click Source Link

Document

Useful constant for language.

Usage

From source file:io.crate.testing.Utils.java

static void log(String message, Object... params) {
    System.out.println(String.format(Locale.ENGLISH, message, params));
}

From source file:annis.frontend.servlets.MatchedNodeColors.java

private String twoDigitHex(int i) {
    String result = Integer.toHexString(i).toLowerCase(Locale.ENGLISH);

    if (result.length() > 2) {
        result = result.substring(0, 2);
    } else if (result.length() < 2) {
        result = StringUtils.leftPad(result, 2, '0');
    }/*from  w  ww  .  ja v  a2  s . c om*/
    return result;
}

From source file:it.ms.theing.loquitur.functions.LocationInterface.java

private void sendLocation(Location location) {
    String conv = String.format(Locale.ENGLISH, "(%3.8f,%3.8f,%3.8f)", location.getLatitude(),
            location.getLongitude(), location.getAltitude());
    context.executeCallback(gpsCallback + conv);
}

From source file:ch.ralscha.extdirectspring.provider.RemoteProviderStoreModify.java

@ExtDirectMethod(value = ExtDirectMethodType.STORE_MODIFY, event = "test")
public List<Row> create2(List<Row> rows, HttpServletResponse response, HttpServletRequest request,
        HttpSession session, Locale locale) {
    assertThat(response).isNotNull();/*from www  .j a  v  a2  s  .co  m*/
    assertThat(request).isNotNull();
    assertThat(session).isNotNull();
    assertThat(locale).isEqualTo(Locale.ENGLISH);

    return rows;
}

From source file:ca.nines.ise.cmd.Annotations.java

/**
 * {@inheritDoc}/*from   w  ww  . j ava 2s .co  m*/
 */
@ErrorCode(code = { "dom.errors" })
@Override
public void execute(CommandLine cmd) throws Exception {
    Log log = Log.getInstance();
    Locale.setDefault(Locale.ENGLISH);
    PrintStream logOut = new PrintStream(System.out, true, "UTF-8");

    if (cmd.hasOption("l")) {
        logOut = new PrintStream(new FileOutputStream(cmd.getOptionValue("l")), true, "UTF-8");
    }

    String args[] = getArgList(cmd);

    File docFile = new File(args[0]);
    if (!docFile.exists()) {
        System.err.println("Cannot read document " + docFile.getCanonicalPath());
        System.exit(1);
    }

    File annFile = new File(args[1]);
    if (!annFile.exists()) {
        System.err.println("Cannot read annotations " + annFile.getCanonicalPath());
        System.exit(1);
    }

    DOM dom = new DOMBuilder(docFile).build();
    if (dom.getStatus() != DOM.DOMStatus.ERROR) {
        Annotation annotation = Annotation.builder().from(annFile).build();
        AnnotationValidator av = new AnnotationValidator();
        av.validate(dom, annotation);
    } else {
        Message m = Message.builder("dom.errors").setSource(dom.getSource()).build();
        log.add(m);
    }
    if (log.count() > 0) {
        logOut.print(log);
    }
}

From source file:de.hybris.platform.servicelayer.model.ModelServiceMapTest.java

@Before
public void setUp() {
    //setup test product
    i18nService.setCurrentLocale(Locale.ENGLISH);

    product = modelService.create(ProductModel.class);
    product.setCode("testproduct");
    product.setName("enName", Locale.ENGLISH);

    final CatalogModel catalog = modelService.create(CatalogModel.class);
    catalog.setId("testCatalog");
    final CatalogVersionModel catver = modelService.create(CatalogVersionModel.class);
    catver.setVersion("testCatalogVersion");
    catver.setCatalog(catalog);/*from   w ww.  j av  a  2 s .c o m*/
    product.setCatalogVersion(catver);

    modelService.save(product);

    //test correct creation of test  product
    assertEquals("no catalog", catalog, product.getCatalogVersion().getCatalog());
    assertTrue("catver was not saved", modelService.isUpToDate(product.getCatalogVersion()));
    assertFalse("catalog was not saved", modelService.isNew(catalog));
    assertEquals("set name normal fails", "enName", product.getName());

    //additional test data
    testMap = new HashMap<ArticleStatus, String>();
    testMap.put(ArticleStatus.BARGAIN, "that's a bargain no doubt!");

}

From source file:by.creepid.docsreporter.AbstractDocsReporterIT.java

protected Project createProjectSample() {
    Project project = new Project("project name", new Date(), new BigDecimal("123.123"));

    project.setUrl("https://github.com/creepid/DocsReporter");

    Manager manager = new Manager("Mike", "<b>Green</b>", 5);
    String string = "January 2, 1982";
    Date birthDate = null;/*from   ww  w  .  j a va  2s. c  om*/
    try {
        birthDate = new SimpleDateFormat("MMMM d, yyyy", Locale.ENGLISH).parse(string);
    } catch (ParseException ex) {
        Logger.getLogger(ReportTemplateIT.class.getName()).log(Level.SEVERE, null, ex);
    }

    List<Role> roles = new ArrayList<Role>();
    roles.add(new Role("Programmer"));
    roles.add(new Role("GUI programmer"));

    manager.setBirthDate(birthDate);

    project.setManager(manager);

    project.add(new DeveloperWithPhoto("<b>ZERR</b>", "Angelo", "angelo.zerr@gmail.com", birthDate,
            this.getFileBytes(photoFolder + "photo2.jpeg"), roles));
    project.add(new DeveloperWithPhoto("<b>Leclercq</b>", "Pascal", "pascal.leclercq@gmail.com", null,
            this.getFileBytes(photoFolder + "photo1.jpeg"), roles, WorkingStatus.freelance));

    project.add(new DeveloperWithPhoto("<b>Leclercq</b>", "Pascal", null, birthDate,
            this.getFileBytes(photoFolder + "photo1.jpeg"), roles));

    roles = new ArrayList<Role>();
    roles.add(new Role("System programmer"));
    roles.add(new Role("Admin"));
    project.add(new DeveloperWithPhoto("<b>Arnold</b>", "Brown", "arnoldbrown@yahoo.com", birthDate,
            this.getFileBytes(photoFolder + "photo2.jpeg"), roles));

    roles = new ArrayList<Role>();
    roles.add(new Role("Architect"));
    project.add(new DeveloperWithPhoto("<b>Jim</b>", "Smith", "jimmythebest@tut.by", birthDate,
            this.getFileBytes(photoFolder + "photo3.jpeg"), roles, WorkingStatus.halfTime));

    project.setLogo(this.getFileBytes(photoFolder + imageName));

    return project;
}

From source file:com.example.app.resource.service.ResourceTagsLabelProvider.java

@Nonnull
@Override/*from  www.  j  a  v  a 2s  .co  m*/
protected TransientLocalizedObjectKey getDefaultName() {
    TransientLocalizedObjectKey defaultName = new TransientLocalizedObjectKey(new HashMap<>());
    defaultName.addLocalization(Locale.ENGLISH, "Tags");
    return defaultName;
}

From source file:io.lavagna.service.BoardRepository.java

@Transactional(readOnly = false)
public Board createEmptyBoard(String name, String shortName, String description, int projectId) {
    queries.createNewBoard(trimToNull(name), trimToNull(shortName.toUpperCase(Locale.ENGLISH)),
            trimToNull(description), projectId);
    queries.initializeSequence();

    return queries.findLastCreatedBoard();
}

From source file:net.sf.jabref.logic.journals.JournalAbbreviationRepository.java

public boolean isKnownName(String journalName) {
    String nameKey = Objects.requireNonNull(journalName).trim().toLowerCase(Locale.ENGLISH);
    return (fullNameLowerCase2Abbreviation.containsKey(nameKey))
            || (isoLowerCase2Abbreviation.containsKey(nameKey))
            || (medlineLowerCase2Abbreviation.containsKey(nameKey));
}