Click
  1. Click
  2. CLK-624

Add missing translations for Date Field

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.1.0
    • Fix Version/s: 2.2.0
    • Component/s: examples
    • Labels:
      None
    • Environment:
      Apache Tomcat 6

      Description

      Below is the full list of translations necessary for the DateField control. If you would like to add a translation please add it as a patch or in a comment.

      // Full month names
      Date.months = new Array('January','February','March','April','May','June','July','August','September','October','November','December');

      // Month abbreviations
      Date.monthAbbreviations = new Array('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec');

      // Full day names
      Date.dayNames = new Array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday');

      // Day abbreviations
      Date.dayAbbreviations = new Array('Sun','Mon','Tue','Wed','Thu','Fri','Sat');

      // Weekdays displayed by popup calendar
      Date.weekdays = new Array('S','M','T','W','T','F','S');

      Date.first_day_of_week = 0;

      _translations =

      { "OK": "OK", "Now": "Now", "Today": "Today", "Clear": "Clear" }
      1. CLK-624.patch
        1 kB
        Rafal Rusin
      2. CLK-624-calendar-1.0.2.patch
        2 kB
        Rafal Rusin
      3. datefield.patch
        4 kB
        Finn Bock

        Activity

        Hide
        Bob Schellink added a comment -

        fixed in trunk

        Show
        Bob Schellink added a comment - fixed in trunk
        Hide
        Joseph Schmidt added a comment -

        > This patch injects javascript ....
        > So the list of supported languages are then no longer needed.
        I like this automated translation allot .
        Is it possible that the JDK has more translated texts that could be used too?

        Show
        Joseph Schmidt added a comment - > This patch injects javascript .... > So the list of supported languages are then no longer needed. I like this automated translation allot . Is it possible that the JDK has more translated texts that could be used too?
        Hide
        Finn Bock added a comment -

        This patch injects javascript that defines Date.month, Date.monthAbbreviations, Date.dayNames and Date.dayAbbreviations with values from DateFormatSymbols. With these definition the date string generated by the javascript calendar is always a valid date that can be parsed by java's dateparser. So the list of supported languages are then no longer needed.

        Regarding the remaining translations, I would strongly prefer that they were read from the DateField property file and injected into the javascript the same way as month names. So that all string are translated in the same way.

        Show
        Finn Bock added a comment - This patch injects javascript that defines Date.month, Date.monthAbbreviations, Date.dayNames and Date.dayAbbreviations with values from DateFormatSymbols. With these definition the date string generated by the javascript calendar is always a valid date that can be parsed by java's dateparser. So the list of supported languages are then no longer needed. Regarding the remaining translations, I would strongly prefer that they were read from the DateField property file and injected into the javascript the same way as month names. So that all string are translated in the same way.
        Hide
        Bob Schellink added a comment -

        @Finn, that is a good idea. We could use this as a fallback mechanism in case the locale language is not supported. I can still see benefit in having a user defined property file for more fine grained customization. For example the English locale uses the weekdays 'S', 'M', 'T' instead of the shortWeekdays abbreviation.

        Show
        Bob Schellink added a comment - @Finn, that is a good idea. We could use this as a fallback mechanism in case the locale language is not supported. I can still see benefit in having a user defined property file for more fine grained customization. For example the English locale uses the weekdays 'S', 'M', 'T' instead of the shortWeekdays abbreviation.
        Hide
        Naoki Takezoe added a comment -

        Hi Bob,

        Thanks, I didn't look at the description neatly...
        I updated Japanese translation in SVN trunk.

        Show
        Naoki Takezoe added a comment - Hi Bob, Thanks, I didn't look at the description neatly... I updated Japanese translation in SVN trunk.
        Hide
        Finn Bock added a comment -

        Before we all go ahead and submit translations for month and day names (and abbreviations), I think it would make more sense for DateField to generate these names from here:

        http://java.sun.com/j2se/1.4.2/docs/api/java/text/DateFormatSymbols.html#getMonths%28%29
        http://java.sun.com/j2se/1.4.2/docs/api/java/text/DateFormatSymbols.html#getShortMonths%28%29
        http://java.sun.com/j2se/1.4.2/docs/api/java/text/DateFormatSymbols.html#getWeekdays%28%29
        http://java.sun.com/j2se/1.4.2/docs/api/java/text/DateFormatSymbols.html#getShortWeekdays%28%29

        By creating the arrays from java's names we will AFAIK also instantly "support" all language so that DateField.SUPPORTTED_LANGUAGES can be removed.

        Show
        Finn Bock added a comment - Before we all go ahead and submit translations for month and day names (and abbreviations), I think it would make more sense for DateField to generate these names from here: http://java.sun.com/j2se/1.4.2/docs/api/java/text/DateFormatSymbols.html#getMonths%28%29 http://java.sun.com/j2se/1.4.2/docs/api/java/text/DateFormatSymbols.html#getShortMonths%28%29 http://java.sun.com/j2se/1.4.2/docs/api/java/text/DateFormatSymbols.html#getWeekdays%28%29 http://java.sun.com/j2se/1.4.2/docs/api/java/text/DateFormatSymbols.html#getShortWeekdays%28%29 By creating the arrays from java's names we will AFAIK also instantly "support" all language so that DateField.SUPPORTTED_LANGUAGES can be removed.
        Hide
        WarnerJan Veldhuis added a comment -

        // Full month names
        Date.months = new Array('Januari','Februari','Maart','April','Mei','Juni','Juli','Augustus','September','Oktober','November','December');

        // Month abbreviations
        Date.monthAbbreviations = new Array('Jan','Feb','Mrt','Apr','Mei','Jun','Jul','Aug','Sep','Okt','Nov','Dec');

        // Full day names
        Date.dayNames = new Array('Zondag','Maandag','Dinsdag','Woensdag','Donderdag','Vrijdag','Zaterdag');

        // Day abbreviations
        Date.dayAbbreviations = new Array('Zo','Ma','Di','Wo','Do','Vr','Za');

        // Weekdays displayed by popup calendar
        Date.weekdays = new Array('Z','M','D','W','D','V','Z');

        Date.first_day_of_week = 0;

        _translations =

        { "OK": "OK", "Now": "Nu", "Today": "Vandaag", "Clear": "Wissen" }

        Show
        WarnerJan Veldhuis added a comment - // Full month names Date.months = new Array('Januari','Februari','Maart','April','Mei','Juni','Juli','Augustus','September','Oktober','November','December'); // Month abbreviations Date.monthAbbreviations = new Array('Jan','Feb','Mrt','Apr','Mei','Jun','Jul','Aug','Sep','Okt','Nov','Dec'); // Full day names Date.dayNames = new Array('Zondag','Maandag','Dinsdag','Woensdag','Donderdag','Vrijdag','Zaterdag'); // Day abbreviations Date.dayAbbreviations = new Array('Zo','Ma','Di','Wo','Do','Vr','Za'); // Weekdays displayed by popup calendar Date.weekdays = new Array('Z','M','D','W','D','V','Z'); Date.first_day_of_week = 0; _translations = { "OK": "OK", "Now": "Nu", "Today": "Vandaag", "Clear": "Wissen" }
        Hide
        Bob Schellink added a comment -

        Hi Naoki,

        There are DateField translations that wasn't made visible in the current translation file. See this issue's main description for the full list of translations.

        kind regards

        bob

        Show
        Bob Schellink added a comment - Hi Naoki, There are DateField translations that wasn't made visible in the current translation file. See this issue's main description for the full list of translations. kind regards bob
        Hide
        Naoki Takezoe added a comment -

        I committed Japanese translation to DateField into SVN trunk.
        http://svn.apache.org/viewvc?view=revision&revision=910014

        Show
        Naoki Takezoe added a comment - I committed Japanese translation to DateField into SVN trunk. http://svn.apache.org/viewvc?view=revision&revision=910014
        Hide
        Naoki Takezoe added a comment -

        I'd like to add Japanese translation to DateField.
        Now I'm making it, please wait for a moment.

        Show
        Naoki Takezoe added a comment - I'd like to add Japanese translation to DateField. Now I'm making it, please wait for a moment.
        Hide
        Rafal Rusin added a comment -

        I've tested click-calendar-1.0.2.jar and it works perfectly.
        So in order to use it, you need to put jar into click/lib/click-calendar-1.0.2.jar. Then apply patch CLK-624-calendar-1.0.2.patch

        Show
        Rafal Rusin added a comment - I've tested click-calendar-1.0.2.jar and it works perfectly. So in order to use it, you need to put jar into click/lib/click-calendar-1.0.2.jar. Then apply patch CLK-624 -calendar-1.0.2.patch
        Hide
        Rafal Rusin added a comment -

        I saw, as Bob suggested, that using newer version of click-calendar, may resolve this problem.
        For example click-calendar-1.0.2.jar contains ./META-INF/web/click/jscalendar/calendar-pl.js with relevant data.
        However I haven't tried that yet.

        Show
        Rafal Rusin added a comment - I saw, as Bob suggested, that using newer version of click-calendar, may resolve this problem. For example click-calendar-1.0.2.jar contains ./META-INF/web/click/jscalendar/calendar-pl.js with relevant data. However I haven't tried that yet.
        Hide
        Rafal Rusin added a comment - - edited

        This patch solves problem (only for polish locale).

        Show
        Rafal Rusin added a comment - - edited This patch solves problem (only for polish locale).

          People

          • Assignee:
            Bob Schellink
            Reporter:
            Rafal Rusin
          • Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development