ether / etherpad-lite

Etherpad: A modern really-real-time collaborative document editor.
http://docs.etherpad.org/
Apache License 2.0
16.53k stars 2.84k forks source link

undefined behaviour with default language and query param language set #5510

Open DanielHabenicht opened 2 years ago

DanielHabenicht commented 2 years ago

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):

Desktop (please complete the following information):

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.

stale[bot] commented 2 years ago

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.