Wicket
  1. Wicket
  2. WICKET-1243

the DatePicker show the same week title in china.

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.3.0-beta4, 1.3.0-rc1, 1.3.0-rc2
    • Fix Version/s: 1.3.1
    • Component/s: wicket-datetime
    • Labels:
      None
    • Environment:
      in chinese(zh_CN) language

      Description

      the DatePicker show the same week title in china. you can see it here in the first pic.

      if DatePicker can show as the last pic is the best:

      i have correct this on my own version. i will submit the solution tomorrow

      1. screenshot-1.jpg
        21 kB
        Ding Zhaolei
      2. screenshot-2.jpg
        19 kB
        Ding Zhaolei

        Activity

        Hide
        Ding Zhaolei added a comment -

        this is my way to fix it.
        at org.apache.wicket.extensions.yui.calendar.DatePicker.java line463,

        protected void localize(Map widgetProperties) {
        DateFormatSymbols dfSymbols = new DateFormatSymbols(getLocale());
        if (Locale.SIMPLIFIED_CHINESE.equals(getLocale())){
        dfSymbols.setShortWeekdays(new String[]

        {"", "日", "一", "二", "三", "四", "五", "六"}

        );
        };
        setWidgetProperty(widgetProperties, "MONTHS_SHORT", filterEmpty(dfSymbols.getShortMonths()));
        setWidgetProperty(widgetProperties, "MONTHS_LONG", filterEmpty(dfSymbols.getMonths()));
        setWidgetProperty(widgetProperties, "WEEKDAYS_1CHAR", filterEmpty(substring(dfSymbols
        .getShortWeekdays(), 1)));
        setWidgetProperty(widgetProperties, "WEEKDAYS_SHORT", filterEmpty(substring(dfSymbols
        .getShortWeekdays(), 2)));
        setWidgetProperty(widgetProperties, "WEEKDAYS_MEDIUM", filterEmpty(dfSymbols
        .getShortWeekdays()));
        setWidgetProperty(widgetProperties, "WEEKDAYS_LONG", filterEmpty(dfSymbols.getWeekdays()));
        }

        Show
        Ding Zhaolei added a comment - this is my way to fix it. at org.apache.wicket.extensions.yui.calendar.DatePicker.java line463, protected void localize(Map widgetProperties) { DateFormatSymbols dfSymbols = new DateFormatSymbols(getLocale()); if (Locale.SIMPLIFIED_CHINESE.equals(getLocale())){ dfSymbols.setShortWeekdays(new String[] {"", "日", "一", "二", "三", "四", "五", "六"} ); }; setWidgetProperty(widgetProperties, "MONTHS_SHORT", filterEmpty(dfSymbols.getShortMonths())); setWidgetProperty(widgetProperties, "MONTHS_LONG", filterEmpty(dfSymbols.getMonths())); setWidgetProperty(widgetProperties, "WEEKDAYS_1CHAR", filterEmpty(substring(dfSymbols .getShortWeekdays(), 1))); setWidgetProperty(widgetProperties, "WEEKDAYS_SHORT", filterEmpty(substring(dfSymbols .getShortWeekdays(), 2))); setWidgetProperty(widgetProperties, "WEEKDAYS_MEDIUM", filterEmpty(dfSymbols .getShortWeekdays())); setWidgetProperty(widgetProperties, "WEEKDAYS_LONG", filterEmpty(dfSymbols.getWeekdays())); }
        Hide
        Gerolf Seitz added a comment -

        can you provide escaped unicode sequences for the short weekdays?

        Show
        Gerolf Seitz added a comment - can you provide escaped unicode sequences for the short weekdays?
        Hide
        Ding Zhaolei added a comment -

        dfSymbols.setShortWeekdays(new String[]

        {"", "\u65E5", "\u4E00", "\u4E8C", "\u4E09", "\u56DB", "\u4E94", "\u516D"}

        );

        Show
        Ding Zhaolei added a comment - dfSymbols.setShortWeekdays(new String[] {"", "\u65E5", "\u4E00", "\u4E8C", "\u4E09", "\u56DB", "\u4E94", "\u516D"} );
        Hide
        Gerolf Seitz added a comment -

        fixed, thanks for the patch.

        Show
        Gerolf Seitz added a comment - fixed, thanks for the patch.
        Hide
        howie , YU added a comment -

        hi~ There are still some problem below.
        --------------------------------------------------------------------------------------------------------------------------
        if (Locale.SIMPLIFIED_CHINESE.equals(getLocale())){
        dfSymbols.setShortWeekdays(new String[]

        {"", "日", "一", "二", "三", "四", "五", "六"}

        );
        };
        --------------------------------------------------------------------------------------------------------------------------
        The same problem in Locale.TAIWAN & Locale.TRADITIONAL_CHINESE.

        Can i overwrite "protected void localize(Map widgetProperties) " when "new DatePocker" myself?

        --------------------------------------------------------------------------------------------------------------------------

        Show
        howie , YU added a comment - hi~ There are still some problem below. -------------------------------------------------------------------------------------------------------------------------- if (Locale.SIMPLIFIED_CHINESE.equals(getLocale())){ dfSymbols.setShortWeekdays(new String[] {"", "日", "一", "二", "三", "四", "五", "六"} ); }; -------------------------------------------------------------------------------------------------------------------------- The same problem in Locale.TAIWAN & Locale.TRADITIONAL_CHINESE. Can i overwrite "protected void localize(Map widgetProperties) " when "new DatePocker" myself? --------------------------------------------------------------------------------------------------------------------------
        Hide
        Gerolf Seitz added a comment -

        can you provide a patch for TAIWAN and TRADITIONAL_CHINESE?
        that would be great.

        Show
        Gerolf Seitz added a comment - can you provide a patch for TAIWAN and TRADITIONAL_CHINESE? that would be great.

          People

          • Assignee:
            Unassigned
            Reporter:
            Ding Zhaolei
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development