Skip to content

[improvement] Translation: automatic and manual language selection #2488

Open
@AndreyMZ

Description

@AndreyMZ

Problem description:

* To enable translation you should include one of language-files in your index.html
* after <script src='lang/translator.js' type='text/javascript'></script>.
* For example - <script src='lang/ru.js' type='text/javascript'></script>

* To enable translation you should include one of language-files in your index.html
* after <script src='lang/translator.js' type='text/javascript'></script>.
* For example - <script src='lang/ru.js' type='text/javascript'></script>

This is unacceptable in today's internet. Every end user should see his language.
So:

  1. swagger-ui should provide some query parameter (e.g. lang) to set set user's language and apply corresponding translation. (This is needed for integration purposes.)

  2. If the parameter is not specified, swagger-ui should determine user's language automatically using the following variables (actually, all of them in the specified order) and apply corresponding translation:

    1. navigator.languages
    2. navigator.language
    3. navigator.userLanguage
  3. End user should be able to change the language using swagger-ui.

Additional information:
swagger-ui version affected: commit 1f2a5d7
swagger file: not required

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