-
Bug
-
Resolution: Fixed
-
Normal
-
8.5.0
-
Security Level: Jimmy
-
None
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