当前位置: 首页>>代码示例>>Java>>正文


Java Locale.ENGLISH属性代码示例

本文整理汇总了Java中java.util.Locale.ENGLISH属性的典型用法代码示例。如果您正苦于以下问题:Java Locale.ENGLISH属性的具体用法?Java Locale.ENGLISH怎么用?Java Locale.ENGLISH使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在java.util.Locale的用法示例。


在下文中一共展示了Locale.ENGLISH属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: switchLanguage

protected void switchLanguage(String lang) {
    Resources resources = getResources();
    Configuration configuration = resources.getConfiguration();
    DisplayMetrics displayMetrics = resources.getDisplayMetrics();
    switch (lang) {
        case "zh":
            configuration.locale = Locale.TAIWAN;
            break;
        case "ja":
            configuration.locale = Locale.JAPAN;
            break;
        default:
            configuration.locale = Locale.ENGLISH;
            break;
    }

    resources.updateConfiguration(configuration, displayMetrics);
    /*  避免重複寫入
    MainApplication.writeSetting("uiLang", lang);
    //*/
}
 
开发者ID:kamisakihideyoshi,项目名称:TaipeiTechRefined,代码行数:21,代码来源:MainActivity.java

示例2: register_UserAlreadyExist_NotInternalMode

@Test
public void register_UserAlreadyExist_NotInternalMode() throws Exception {
    // given
    new FacesContextStub(Locale.ENGLISH);
    prepareRegister();
    doReturn(Boolean.FALSE).when(userBeanMock).isInternalAuthMode();
    registrationBean.init();
    NonUniqueBusinessKeyException ex = new NonUniqueBusinessKeyException();
    doThrow(ex).when(accountServiceMock).registerCustomer(
            any(VOOrganization.class), any(VOUserDetails.class), any(String.class),
            eq(SERVICE_KEY), eq(MARKETPLACE_ID), eq(SUPPLIER_ID));

    //when
    String result = registrationBean.register();

    // then
    assertEquals(BaseBean.ERROR_USER_ALREADY_EXIST, ex.getMessageKey());        
    assertEquals(BaseBean.OUTCOME_ERROR, result);
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:19,代码来源:RegistrationBeanTest.java

示例3: givenContextStub

/**
 * @param facesMessages
 * @return
 */
private FacesContextStub givenContextStub(
        final List<FacesMessage> facesMessages) {
    FacesContextStub contextStub = new FacesContextStub(Locale.ENGLISH) {
        @Override
        public void addMessage(String arg0, FacesMessage arg1) {
            facesMessages.add(arg1);
        }

        @Override
        public Iterator<FacesMessage> getMessages() {
            return facesMessages.iterator();
        }
    };
    return contextStub;
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:19,代码来源:ManageLanguageCtrlTest.java

示例4: setup

@Before
public void setup() throws Exception {
    voDetails = new VOServiceDetails();
    voDetails.setImageDefined(true);
    voDetails.setAccessType(ServiceAccessType.DIRECT);
    voDetails.setDescription("marketingName");
    voDetails.setFeatureURL("technicalURL");
    voDetails.setName("name");
    voDetails.setServiceId("serviceId");
    voDetails.setStatus(ServiceStatus.ACTIVE);
    voDetails.setSellerId("supplierId");
    voDetails.setSellerName("supplierName");
    voDetails.setTechnicalId("technicalId");

    new FacesContextStub(Locale.ENGLISH);
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:16,代码来源:ServiceDetailsTest.java

示例5: initFacesContext

private void initFacesContext() {
    new FacesContextStub(Locale.ENGLISH) {
        @Override
        public Application getApplication() {
            Application applicationStub = new ApplicationStub();
            List<Locale> locales = new ArrayList<Locale>();
            locales.add(Locale.ENGLISH);
            locales.add(Locale.GERMAN);
            locales.add(Locale.JAPANESE);
            locales.add(new Locale("in"));
            applicationStub.setSupportedLocales(locales);
            return applicationStub;
        }
    };
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:15,代码来源:LocaleUtilsTest.java

示例6: getDefaultLocale

@Override
public Locale getDefaultLocale() {
    if (defaultLocale != null) {
        return defaultLocale;
    }
    return Locale.ENGLISH;
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:7,代码来源:ApplicationStub.java

示例7: dataTableTitile

private void dataTableTitile(Document documento, String data) throws IOException, BadElementException, DocumentException {
    
   try {
       pTableEmpresaPricipal = new PdfPTable(new float[]{15f, 85f});
       pTableEmpresaInforImpres1 = new PdfPTable(1);
       pTableEmpresaInforImpres5 = new PdfPTable(1);
       
       PdfPCell pCellNomeEmpresa = new PdfPCell(new Phrase(Empresa.NOME, fontCabecalhoNG));
       pCellNomeEmpresa.setBorder(0);
       PdfPCell pCellNomeEndereco = new PdfPCell(new Phrase(Empresa.ENDERECO, fontCabecalhoN));
       pCellNomeEndereco.setBorder(0);
       PdfPCell pCellCaixaPostal = new PdfPCell(new Phrase(Empresa.CAIXAPOSTAL, fontCabecalhoN));
       pCellCaixaPostal.setBorder(0);
       PdfPCell pCellTeleFax = new PdfPCell(new Phrase(Empresa.TELEFAX + " " + ConfigDoc.Empresa.EMAIL, fontCabecalhoN));
       pCellTeleFax.setBorder(0);
       PdfPCell pCellSociedade = new PdfPCell(new Phrase(Empresa.SOCIEDADE, fontCabecalhoN));
       pCellSociedade.setBorder(0);
       Image imageEmpresa = Image.getInstance("logo.png");
       imageEmpresa.scaleToFit(120f, 85f);
       pTableEmpresaInforImpres1.addCell(pCellNomeEmpresa);
       pTableEmpresaInforImpres1.addCell(pCellNomeEndereco);
       pTableEmpresaInforImpres1.addCell(pCellCaixaPostal);
       pTableEmpresaInforImpres1.addCell(pCellTeleFax);
       pTableEmpresaInforImpres1.addCell(pCellSociedade);
       PdfPCell cellTabela3 = new PdfPCell(pTableEmpresaInforImpres1);
       cellTabela3.setBorder(0);
       pTableEmpresaInforImpres5.addCell(cellTabela3);
       PdfPCell cellTabela5 = new PdfPCell(pTableEmpresaInforImpres5);
       cellTabela5.setBorder(0);
       PdfPCell cellTabela6 = new PdfPCell(imageEmpresa);
       cellTabela6.setBorder(0);
       pTableEmpresaPricipal.setWidthPercentage(95);
       pTableEmpresaPricipal.addCell(cellTabela6);
       pTableEmpresaPricipal.addCell(cellTabela5);
       PdfPTable pTableTitulo = new PdfPTable(1);
       pTableTitulo.setHorizontalAlignment(Element.ALIGN_CENTER);
       pTableTitulo.setWidthPercentage(100);
       
       SimpleDateFormat sdfEsp = new SimpleDateFormat("MMMM, yyyy", Locale.ENGLISH);
       SimpleDateFormat sdf = new SimpleDateFormat("MM-yyyy");
       PdfPCell cellTitulo = new PdfPCell(new Phrase("TOTAL PREMIUM COLLECTED ON TRAVEL INSURANCE AND TAXES FOR "+sdfEsp.format(sdf.parse(data)).toUpperCase(), fontCorpoNG));
       cellTitulo.setBorder(0);
       cellTitulo.setPaddingBottom(10f);
       pTableTitulo.addCell(cellTitulo);
       
       pTableEmpresaPricipal.setHorizontalAlignment(Element.ALIGN_CENTER);
       
       documento.add(pTableEmpresaPricipal);
       documento.add(pTableNull);
       documento.add(pTableTitulo);
   } catch (ParseException ex) {
       Logger.getLogger(ExporOnlyViagemPdf.class.getName()).log(Level.SEVERE, null, ex);
   }
}
 
开发者ID:JIGAsoftSTP,项目名称:NICON,代码行数:54,代码来源:ExporOnlyViagemPdf.java

示例8: init

private void init() {
    mFormat = "hh:mm a";
    aSize = 0.5f;
    aColor = "#000000";
    numformats = "en";
    if(numformats.equals("ar")){
        local = new Locale("ar");
    }else{
        local = Locale.ENGLISH;
    }
    syf = new SimpleDateFormat("hh:mm a", local);
    createTime(mTimeZone);
}
 
开发者ID:BaselHorany,项目名称:MaterialTextClock,代码行数:13,代码来源:MaterialTextClock.java

示例9: setup

@Before
public void setup() {

    context = new FacesContextStub(Locale.ENGLISH);
    component = mock(UIComponent.class);

    tenantValidator = spy(new TenantValidator());
    tenantService = mock(TenantService.class);
    serviceLocator = mock(ServiceLocator.class);

    tenantValidator.serviceLocator = serviceLocator;
    when(serviceLocator.findService(TenantService.class))
            .thenReturn(tenantService);
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:14,代码来源:TenantValidatorTest.java

示例10: getLocale

public static Locale getLocale(String language) {
	if ("en".equalsIgnoreCase(language)) {
    	return Locale.ENGLISH;
    } else if ("zh".equalsIgnoreCase(language)) {
    	return Locale.SIMPLIFIED_CHINESE;
    } else if ("zh_TW".equalsIgnoreCase(language)) {
    	return Locale.TRADITIONAL_CHINESE;
    }
    return Locale.getDefault();
}
 
开发者ID:yunhaibin,项目名称:dubbox-hystrix,代码行数:10,代码来源:LocaleUtils.java

示例11: startButtonPressed

private void startButtonPressed() {

        if(checkPermission() && locationSettingsHandler.checkLocationSettings()) {

            // Set user as unavailable
            new FirebaseHelper().
                    setUserAvailable(((AppRunnest) getActivity().getApplication()).getUser().getEmail(), false, false);

            // initialize new Run
            SimpleDateFormat dateFormat = new SimpleDateFormat("d MMM yyyy HH:mm:ss", Locale.ENGLISH);
            String runName = dateFormat.format(new Date());
            run = new Run(runName);
            super.startRun();
            // Prevent sleeping
            //noinspection ConstantConditions
            getView().setKeepScreenOn(true);

            startUpdatesButton.setVisibility(View.INVISIBLE);
            stopUpdatesButton.setVisibility(View.VISIBLE);

            chronometer.setVisibility(View.VISIBLE);
            chronometer.setBase(SystemClock.elapsedRealtime());
            chronometer.start();

            ((SideBarActivity)getActivity()).setRunning(true);

            setButtonsEnabledState();
        }
    }
 
开发者ID:IrrilevantHappyLlamas,项目名称:Runnest,代码行数:29,代码来源:RunningMapFragment.java

示例12: AlphabeticIndexVN

public AlphabeticIndexVN(Context context) {
    LocaleList locales = context.getResources().getConfiguration().getLocales();
    int localeCount = locales.size();

    Locale primaryLocale = localeCount == 0 ? Locale.ENGLISH : locales.get(0);
    AlphabeticIndex indexBuilder = new AlphabeticIndex(primaryLocale);
    for (int i = 1; i < localeCount; i++) {
        indexBuilder.addLabels(locales.get(i));
    }
    indexBuilder.addLabels(Locale.ENGLISH);

    mAlphabeticIndex = indexBuilder.buildImmutableIndex();
}
 
开发者ID:TeamBrainStorm,项目名称:SimpleUILauncher,代码行数:13,代码来源:AlphabeticIndexCompat.java

示例13: setup

@Before
public void setup() {

    validator = new IdValidator() {
        @Override
        protected int getMaxLength() {
            return TEST_LENGTH;
        }
    };

    context = new FacesContextStub(Locale.ENGLISH);
    Map<String, Object> map = new HashMap<String, Object>();
    map.put(Constants.UI_COMPONENT_ATTRIBUTE_LABEL, "componentStub");
    component = new UIComponentStub(map);
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:15,代码来源:IdValidatorTest.java

示例14: testGetServiceNameToDisplay_EmptyName

@Test
public void testGetServiceNameToDisplay_EmptyName() {
    new FacesContextStub(Locale.ENGLISH);

    VOServiceDetails details = new VOServiceDetails();
    details.setName("");
    bean.setSelectedService(details);

    String result = bean.getSelectedServiceNameToDisplay();
    assertEquals(JSFUtils.getText("marketplace.name.undefined", null),
            result);
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:12,代码来源:PriceModelBeanTest.java

示例15: setup

@Before
public void setup() {
    validator = new UserIdValidator();
    context = new FacesContextStub(Locale.ENGLISH);
    Map<String, Object> map = new HashMap<String, Object>();
    map.put(Constants.UI_COMPONENT_ATTRIBUTE_LABEL, "componentStub");
    component = new UIComponentStub(map);
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:8,代码来源:UserIdValidatorTest.java


注:本文中的java.util.Locale.ENGLISH属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。