當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。