List of usage examples for java.util ResourceBundle getBundle
@CallerSensitive public static ResourceBundle getBundle(String baseName, Module module)
From source file:py.una.pol.karaku.test.test.ValidationMessagesTest.java
@BeforeClass public static void before() { Locale locale = new Locale("es", "PY"); ResourceBundle toAdd = ResourceBundle.getBundle("language.validation.karaku", locale); Enumeration<String> en = toAdd.getKeys(); keys = new HashSet<String>(); while (en.hasMoreElements()) { keys.add("{" + en.nextElement() + "}"); }//from w w w .ja v a2 s.c om }
From source file:ispok.valid.EmployeeValidator.java
@Override public void validate(FacesContext fc, UIComponent uic, Object o) throws ValidatorException { ResourceBundle rb = ResourceBundle.getBundle("ispok/pres/inter/ispok", fc.getViewRoot().getLocale()); if (employeeService.employeeExist(o.toString())) { throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_ERROR, rb.getString("employee_invalid_exist"), rb.getString("employee_invalid_exist"))); }//from w w w . ja v a 2 s . co m }
From source file:ispok.valid.VisitorEmailExistValidator.java
@Override public void validate(FacesContext fc, UIComponent uic, Object o) throws ValidatorException { ResourceBundle rb = ResourceBundle.getBundle("ispok/pres/inter/ispok", fc.getViewRoot().getLocale()); if (!visitorService.emailAvailable(o.toString())) { throw new ValidatorException(new FacesMessage(FacesMessage.SEVERITY_ERROR, rb.getString("email_taken"), rb.getString("email_taken"))); }//from w ww. jav a 2s . c o m }
From source file:com.inkubator.hrm.web.converter.CompanyConverter.java
@Override public String getAsString(FacesContext context, UIComponent component, Object value) { ResourceBundle resourceBundle = ResourceBundle.getBundle("Messages", new Locale(FacesUtil.getSessionAttribute(HRMConstant.BAHASA_ACTIVE).toString())); String message = StringUtils.EMPTY; String data = (String) value; if (Objects.equals(data, HRMConstant.ORGANIZATION_LEVEL_HOLDING)) { message = resourceBundle.getString("organization.holding"); } else if (Objects.equals(data, HRMConstant.ORGANIZATION_LEVEL_COMPANY)) { message = resourceBundle.getString("organization.company"); }//w w w. jav a2s . c o m return message; }
From source file:com.taobao.itest.util.DateConverter.java
public static synchronized String getDateTimePattern() { Locale locale = LocaleContextHolder.getLocale(); try {/* ww w . ja v a 2 s. c om*/ defaultDateTimePattern = ResourceBundle.getBundle(resource, locale).getString("dateTimePattern"); } catch (MissingResourceException mse) { defaultDateTimePattern = "yyyy-MM-dd HH:mm:ss"; } return defaultDateTimePattern; }
From source file:cn.edu.pku.lib.dataverse.validation.EMailValidator.java
@Override public void validate(FacesContext context, UIComponent component, Object value) throws ValidatorException { if (value != null) { if (!EmailValidator.getInstance().isValid(((String) value).trim())) { FacesMessage message = new FacesMessage( ResourceBundle.getBundle("ValidationMessages", context.getViewRoot().getLocale()) .getString("cn.edu.pku.lib.dataverse.validation.EMailValidator.message")); message.setSeverity(FacesMessage.SEVERITY_ERROR); throw new ValidatorException(message); }/* w w w . jav a2 s.co m*/ } }
From source file:com.inkubator.hrm.web.converter.BatchJobConverter.java
@Override public String getAsString(FacesContext context, UIComponent component, Object value) { ResourceBundle resourceBundle = ResourceBundle.getBundle("Messages", new Locale(FacesUtil.getSessionAttribute(HRMConstant.BAHASA_ACTIVE).toString())); String message = StringUtils.EMPTY; String data = (String) value; switch (data) { case "jobSynchDataFingerRealization": message = resourceBundle.getString("batch.jobSynchDataFingerRealization"); break;//ww w .j a v a 2s . c o m case "jobPaySalaryUpload": message = resourceBundle.getString("batch.jobPaySalaryUpload"); break; case "jobPayAttendanceUpload": message = resourceBundle.getString("batch.jobPayAttendanceUpload"); break; case "jobPayTempOvertimeUpload": message = resourceBundle.getString("batch.jobPayTempOvertimeUpload"); break; case "jobPayEmployeeCalculation": message = resourceBundle.getString("batch.jobPayEmployeeCalculation"); break; case "jobPayReceiverAccount": message = resourceBundle.getString("batch.jobPayReceiverAccount"); break; case "jobMonthEndPayroll": message = resourceBundle.getString("batch.jobMonthEndPayroll"); break; case "jobLoanUpload": message = resourceBundle.getString("batch.jobLoanUpload"); break; case "jobUnregCalculation": message = resourceBundle.getString("batch.jobUnregCalculation"); break; case "jobUnregPayroll": message = resourceBundle.getString("batch.jobUnregPayroll"); break; case "jobAnnouncementLog": message = resourceBundle.getString("batch.jobAnnouncementLog"); break; case "jobEmailingAnnouncementNotSent": message = resourceBundle.getString("batch.jobEmailingAnnouncementNotSent"); break; default: message = data; break; } return message; }
From source file:io.bibleget.BibleGetI18N.java
/** * * @return/* w w w . ja v a2 s .co m*/ */ public static ResourceBundle getMessages() { lcl = BibleGetIO.getLocale(); Locale myLocale; myLocale = new Locale(lcl); try { myResource = ResourceBundle.getBundle("io.bibleget.resources.messages", myLocale); } catch (MissingResourceException ex) { myResource = ResourceBundle.getBundle("io.bibleget.resources.messages"); } return myResource; }
From source file:com.inkubator.hrm.web.converter.OvertimeImplCalculationMethodConverter.java
@Override public String getAsString(FacesContext facesContext, UIComponent uiComponent, Object value) { ResourceBundle resourceBundle = ResourceBundle.getBundle("Messages", new Locale(FacesUtil.getSessionAttribute(HRMConstant.BAHASA_ACTIVE).toString())); String messages = StringUtils.EMPTY; Integer data = (Integer) value; if (Objects.equals(data, HRMConstant.OVERTIME_CALCULATION_STATIC)) { messages = resourceBundle.getString("overTimeImplementation.static"); } else if (Objects.equals(data, HRMConstant.OVERTIME_CALCULATION_RELATIVE)) { messages = resourceBundle.getString("overTimeImplementation.relative"); }/* ww w . j a v a2s .c o m*/ return messages; }
From source file:com.inkubator.hrm.web.converter.ApprovalDefinitionConverter.java
@Override public String getAsString(FacesContext facesContext, UIComponent uiComponent, Object value) { ResourceBundle resourceBundle = ResourceBundle.getBundle("Messages", new Locale(FacesUtil.getSessionAttribute(HRMConstant.BAHASA_ACTIVE).toString())); String messages = StringUtils.EMPTY; String data = (String) value; switch (data) { case HRMConstant.REIMBURSEMENT: messages = resourceBundle.getString("reimbursment.reimbursment"); break;// w w w .j a v a2s . com case HRMConstant.RECRUIT_MPP_APPLY: messages = resourceBundle.getString("approvaldefinition.recruit_mpp_apply"); break; case HRMConstant.LEAVE: messages = resourceBundle.getString("global.leave"); break; case HRMConstant.OVERTIME: messages = resourceBundle.getString("global.overtime"); break; case HRMConstant.RECRUITMENT_REQUEST: messages = resourceBundle.getString("recruitment.recruitment_request"); break; case HRMConstant.EMP_CORRECTION_ATTENDANCE: messages = resourceBundle.getString("emp_correction_attendance.correction_attendance"); break; case HRMConstant.LOAN: messages = resourceBundle.getString("loan.loan"); break; case HRMConstant.SHIFT_SCHEDULE: messages = resourceBundle.getString("global.schedule_shift"); break; case HRMConstant.BUSINESS_TRAVEL: messages = resourceBundle.getString("businesstravel.business_travel"); break; case HRMConstant.PERMIT: messages = resourceBundle.getString("global.permit"); break; case HRMConstant.EMPLOYEE_CAREER_TRANSITION: messages = resourceBundle.getString("emp_career_transition.career_transition"); break; case HRMConstant.EMPLOYEE_ELIMINATION: messages = resourceBundle.getString("approvaldefinition.process_request_career_elimination"); break; case HRMConstant.APPROVAL_PROCESS: messages = resourceBundle.getString("approvaldefinition.approval_process"); break; case HRMConstant.APPROVAL_TYPE_POSITION: messages = resourceBundle.getString("position.position"); break; case HRMConstant.APPROVAL_TYPE_DEPARTMENT: messages = resourceBundle.getString("department.department"); break; case HRMConstant.APPROVAL_TYPE_INDIVIDUAL: messages = resourceBundle.getString("global.individual"); break; default: messages = data; break; } return messages; }