有没有办法将富日历翻译成Locale.XX
不支持的语言感谢您的帮助
UPDATE:我的日历bean的一部分
@RequestScoped
@ManagedBean(name="calendarBean")
public class CalendarBean implements Serializable
{
/**/
private static final long serialVersionUID = -219499296173801537L;
private Locale locale;
private String pattern;
private Date currentDate;
private Date selectedDate;
public Locale getLocale() {
return locale;
}
public void setLocale(Locale locale) {
this.locale = locale;
}
public String getPattern() {
return pattern;
}
public void setPattern(String pattern) {
this.pattern = pattern;
}
/* Constructor */
public CalendarBean() {
locale = Locale.US;
pattern = "MMM d, yyyy";
}
public void selectLocale(ValueChangeEvent event) {
String tLocale = (String) event.getNewValue();
if (tLocale != null)
{
String lang = tLocale.substring(0, 2);
String country = tLocale.substring(3);
locale = new Locale(lang, country, "");
}
}
public Date getCurrentDate() {
return currentDate;
}
public void setCurrentDate(Date currentDate) {
this.currentDate = currentDate;
}
public Date getSelectedDate() {
return selectedDate;
}
public void setSelectedDate(Date selectedDate) {
this.selectedDate = selectedDate;
}
}
更新:(富:日历)EXAMPLE ON WEB
<rich:calendar mode="ajax"
boundaryDatesMode="scroll"
value="#{myBdeCheck.calendar.selectedDate}"
locale="#{calendarBean.locale}"
datePattern="#{calendarBean.pattern}"
cellWidth="24px" cellHeight="22px" style="width:200px"/>
答案 0 :(得分:1)
一般来说,语言环境不受限制。只需使用构造函数new Locale("your language")
对于日历 - 它具有每个i18nable项的属性,因此您可以在那里使用#{msg.foo}
:
该组件允许使用“header”,“footer”,“optionalHeader”,“optionalFooter”方面。这些方面提供了以下元素:{currentMonthControl},{nextMonthControl},{nextYearControl},{previousYearControl},{previousMonthControl},{todayControl},{selectedDateControl}。这些元素可用于标签输出。