Uploaded image for project: 'ZK'
  1. ZK
  2. ZK-3821

timeout message not localized

    XMLWordPrintable

    Details

      Description

      Steps to Reproduce

      <?import org.zkoss.util.Locales?>
      <zk>
      	<zscript>session.setMaxInactiveInterval(5);</zscript>
      	<label onCreate="self.setValue(Locales.getCurrent().toString());"/>
      	<button label="click after 5 seconds" onClick=""/>
      </zk>
      

      access the page using a locale request header different to the server's default

      click the button after >5sec to cause a session timeout error

      Current Result

      the error text is always shown in the default language of the server
      the dialog buttons (reload / cancel) are localized as expected

      Expected Result

      the localized message as provided for different languages should be used
      e.g.:
      english label (msgzk.properties)
      german label (msgzk_de.properties)

      Debug Info

      in order to test you can change your browser's request locale to a different than the server's default locale

      Root Cause

      Default Ajax request handling between Charsets.setup() and cleanup():
      https://github.com/zkoss/zk/blob/v8.5.0/zk/src/org/zkoss/zk/au/http/DHtmlUpdateServlet.java#L452-L460
      Session timeout message outside the block above:
      https://github.com/zkoss/zk/blob/v8.5.0/zk/src/org/zkoss/zk/au/http/DHtmlUpdateServlet.java#L470

        Attachments

          Activity

            People

            Assignee:
            rudyhuang rudyhuang
            Reporter:
            cor3000 cor3000
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 4 hours
                4h
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 4 hours
                4h