Tapestry
  1. Tapestry
  2. TAPESTRY-2617

DateField component should localize the month names and day name abbreviations shown in the client web browser

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 5.0.14
    • Fix Version/s: 5.0.15
    • Component/s: None
    • Labels:
      None
    • Environment:
      All

      Description

      Datefield is almost localized as TAPESTRY-1856 is closed, but still the UI of the date selector is hard coded to use english day and month names. Please fix this too.

        Activity

        Hide
        Howard M. Lewis Ship added a comment -

        Seems like this could be a one-time JavaScript invocation to move the month and days names and the start day of the week as a JSON object and use that data to reconfigure the DatePicker. Another option, one I like less, is to split datepicker.js into two parts: datepicker_main.js and datepicker_config.js, with localizations of the latter for different locales (and bit of a maintenance issue). A third option is for the DatePicker to send a subsequent initialization request to the server to collect the localization data.

        Show
        Howard M. Lewis Ship added a comment - Seems like this could be a one-time JavaScript invocation to move the month and days names and the start day of the week as a JSON object and use that data to reconfigure the DatePicker. Another option, one I like less, is to split datepicker.js into two parts: datepicker_main.js and datepicker_config.js, with localizations of the latter for different locales (and bit of a maintenance issue). A third option is for the DatePicker to send a subsequent initialization request to the server to collect the localization data.
        Hide
        Ville Virtanen added a comment -

        So if I understand correctly the first datefield to get localized date names would trigger AJAX call to the server and then the result would be cached to client side if there are more datefields in the page?

        Either that approach or then supply the names as parameters in DateField.java

        setup.put("field", clientId);
        setup.put("parseURL", resources.createEventLink("parse").toAbsoluteURI());
        setup.put("formatURL", resources.createEventLink("format").toAbsoluteURI());

        support.addInit("dateField", setup);

        This would add the size of the original response, but would save one round trip to server. (Which approach is more efficient depends on the number of datefields in the page)

        I would like to see the no-server-round-trip approach, as usually there are max 2 datefields in one page.

        Show
        Ville Virtanen added a comment - So if I understand correctly the first datefield to get localized date names would trigger AJAX call to the server and then the result would be cached to client side if there are more datefields in the page? Either that approach or then supply the names as parameters in DateField.java setup.put("field", clientId); setup.put("parseURL", resources.createEventLink("parse").toAbsoluteURI()); setup.put("formatURL", resources.createEventLink("format").toAbsoluteURI()); support.addInit("dateField", setup); This would add the size of the original response, but would save one round trip to server. (Which approach is more efficient depends on the number of datefields in the page) I would like to see the no-server-round-trip approach, as usually there are max 2 datefields in one page.

          People

          • Assignee:
            Howard M. Lewis Ship
            Reporter:
            Ville Virtanen
          • Votes:
            2 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development