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:org.n2.chess.beans.RuleService.java

@Override
public GameMove parseMove(String notation) {
    if (notation.length() > 5) {
        notation = notation.substring(1);
    }//from w w  w  . j a  va 2  s.  c om
    notation = notation.replace("x", "-");
    return getRules().parseMove(notation, Locale.ENGLISH, position, getInitialBoard());
}

From source file:at.ac.univie.isc.asio.security.RoleUserServiceTest.java

@Theory
public void should_ignore_casing_on_username(final Role role) throws Exception {
    final String lowerRoleName = role.name().toLowerCase(Locale.ENGLISH);
    final TestingAuthenticationToken token = new TestingAuthenticationToken(lowerRoleName, "N/A");
    final UserDetails user = subject.loadUserDetails(token);
    assertThat(user.getUsername(), equalTo(role.name()));
}

From source file:com.example.mego.adas.videos.api.YouTubeApiUtilities.java

/**
 * Return the formatted date string (i.e. "4:30 PM") from a Date object.
 *//*from  w ww.ja v a2 s.co  m*/
public static String formatTime(Date dateObject) {
    SimpleDateFormat timeFormat = new SimpleDateFormat("h:mm a", Locale.ENGLISH);
    return timeFormat.format(dateObject);
}

From source file:com.opengamma.financial.convention.yield.YieldConventionFactory.java

/**
 * Stores the convention.//from   w  w  w  .j  av  a2s. c o  m
 * @param convention  the convention to store, not null
 */
private void store(final YieldConvention convention) {
    Validate.notNull(convention, "YieldConvention");
    _conventionMap.put(convention.getConventionName().toLowerCase(Locale.ENGLISH), convention);
}

From source file:at.ac.univie.isc.asio.security.RoleUserService.java

@Override
public UserDetails loadUserByUsername(final String principal) throws UsernameNotFoundException {
    final String roleName = principal.toUpperCase(Locale.ENGLISH);
    final UserDetails user = users.get(roleName);
    if (user == null) {
        throw new UsernameNotFoundException("unknown role <" + principal + ">");
    }//from  ww  w . j  av a2 s. c o  m
    return user;
}

From source file:com.autonomy.aci.client.util.DateTimeUtils.java

/**
 * Parses a string representing a date, using the supplied pattern and the <tt>ENGLISH</tt> locale.
 * <p>//from w w w  .  j a v  a  2s  . c  o  m
 * A parse is only deemed successful if it parses the whole of the input string. If the parse pattern didn't match, a
 * ParseException is thrown.
 * @param string The date to parse, not null
 * @param format The date format pattern to use, see {@link java.text.SimpleDateFormat}, not null
 * @return The parsed date
 * @throws IllegalArgumentException If the date string is null
 * @throws ParseException           If the date pattern was unsuitable
 */
public Date parseDate(final String string, final String format) throws ParseException {
    return parseDate(string, format, Locale.ENGLISH);
}

From source file:org.openmrs.module.metadatamapping.api.LocalMappingHibernateInterceptorTest.java

@Test
public void shouldRetireConceptReferenceTermIfConceptPurged() {
    //given//from w  ww  .j  ava  2s.  c o m
    Concept concept = new Concept();
    concept.setConceptClass(conceptService.getConceptClass(1));
    concept.setDatatype(conceptService.getConceptDatatype(1));
    concept.addName(new ConceptName("my-dict-concept", Locale.ENGLISH));
    conceptService.saveConcept(concept);
    Integer id = concept.getId();

    service.addLocalMappingToConcept(concept);

    ConceptReferenceTerm term = conceptService.getConceptReferenceTermByCode(id.toString(), localConceptSource);
    Assert.assertFalse(term.isRetired());

    //when
    conceptService.purgeConcept(concept);

    //then
    term = conceptService.getConceptReferenceTermByCode(id.toString(), localConceptSource);
    Assert.assertTrue(term.isRetired());
}

From source file:is.idega.idegaweb.egov.gumbo.handler.FishingLicenseDescriptionHandler.java

protected Locale getCurrentLocale() {
    Locale locale = null;/*  ww w.j ava 2  s.  c  o m*/
    try {
        LoginSession loginSession = ELUtil.getInstance().getBean(LoginSession.class);
        locale = loginSession.getCurrentLocale();
    } catch (Exception e) {
    }

    if (locale == null) {
        IWContext iwc = CoreUtil.getIWContext();
        locale = iwc == null ? null : iwc.getCurrentLocale();
    }

    if (locale == null) {
        locale = IWMainApplication.getDefaultIWMainApplication().getDefaultLocale();
    }

    return locale == null ? Locale.ENGLISH : locale;
}

From source file:com.playonlinux.configuration.IntegrationContextConfig.java

@Bean
protected LanguageBundle languageBundle() {
    return LanguageBundleSelector.forLocale(Locale.ENGLISH);
}

From source file:com.alibaba.dubbo.governance.web.common.interceptor.LocaleValve.java

public void invoke(PipelineContext pipelineContext) throws Exception {
    TurbineRunData rundata = getTurbineRunData(request);
    if (ignoreTarget(rundata.getTarget())) {
        pipelineContext.invokeNext();/*from   w  w  w  .  j  a  va  2  s.  co m*/
        return;
    }

    //
    String[] temp = rundata.getCookies().getStrings("locale");
    String locale = null;
    if (temp != null) {
        if (temp.length > 1) {
            locale = temp[temp.length - 1];
        } else if (temp.length == 1) {
            locale = temp[0];
        }
    }
    if (locale == null || "".equals(locale)) {
        locale = "zh";
    }

    Locale newLocale = Locale.SIMPLIFIED_CHINESE;
    if ("en".equals(locale)) {
        newLocale = Locale.ENGLISH;
    } else if ("zh".equals(locale)) {
        newLocale = Locale.SIMPLIFIED_CHINESE;
    } else if ("zh_TW".equals(locale)) {
        newLocale = Locale.TRADITIONAL_CHINESE;
    }
    LocaleUtil.setLocale(newLocale);

    pipelineContext.invokeNext();
}