本文整理汇总了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);
//*/
}
示例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);
}
示例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;
}
示例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);
}
示例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;
}
};
}
示例6: getDefaultLocale
@Override
public Locale getDefaultLocale() {
if (defaultLocale != null) {
return defaultLocale;
}
return Locale.ENGLISH;
}
示例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);
}
}
示例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);
}
示例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);
}
示例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();
}
示例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();
}
}
示例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();
}
示例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);
}
示例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);
}
示例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);
}