Skip to content

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

@DanielHabenicht

Description

@DanielHabenicht

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: 1d7a41f
  • 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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions