etherpad-lite icon indicating copy to clipboard operation
etherpad-lite copied to clipboard

undefined behaviour with default language and query param language set

Open DanielHabenicht opened this issue 4 years ago • 1 comments

Describe the bug If both the lang: 'en-gb' option (in settings.json) and the query param ?lang=de is set the displayed language is not really defined. Sometimes it displays english, sometimes its german.

To Reproduce Steps to reproduce the behavior:

  1. Set this setting in settings.json:
     "padOptions": {
       "lang": "en-gb"
     },
    
  2. Start the server
  3. Open an etherpad with the lang query parameter, e.g. https://localhost:9001/p/7j6qm9rldicn9ec1vpr4?lang=de
  4. See the english or german etherpad.

Expected behavior The default language set in settings.json should be overridden by the query param.

Server (please complete the following information):

  • Etherpad version: https://github.com/ether/etherpad-lite/commit/1d7a41fec215d52cf794e9ed8121a3a342fbfcb0
  • OS: Ubuntu 20.04
  • Node.js version (node --version): v14.17.6
  • npm version (npm --version): 6.14.15
  • the server free of plugins

Desktop (please complete the following information):

  • OS: Windows
  • Browser edge
  • Version 100.0.1185.39 (Official build) (64-bit)

Additional context While debugging I found that this function is called twice in quick succession: https://github.com/ether/etherpad-lite/blob/34d12022a076d967dcbfc0a3456687c55b4ea5a0/src/static/js/pad.js#L138-L141 But I could not find the part where it is called with the default language. I would propose replacing the additional call with a variable which would replace the hardcoded 'en' string.

DanielHabenicht avatar Apr 14 '22 08:04 DanielHabenicht

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jun 18 '22 20:06 stale[bot]