Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Normalize names of translations in the docs #5060

@MrRawbin

Description

@MrRawbin

First Check

  • I added a very descriptive title to this issue.
  • I used the GitHub search to find a similar issue and didn't find it.
  • I searched the FastAPI documentation, with the integrated search.
  • I already searched in Google "How to X in FastAPI" and didn't find any information.
  • I already read and followed all the tutorial in the docs and didn't find an answer.
  • I already checked if it is not related to FastAPI but to Pydantic.
  • I already checked if it is not related to FastAPI but to Swagger UI.
  • I already checked if it is not related to FastAPI but to ReDoc.

Commit to Help

  • I commit to help with one of those options 👆

Example Code

`mkdocs.yml`:


  alternate:
  - link: /
    name: en - English
  - link: /az/
    name: az
  - link: /de/
    name: de
  - link: /es/
    name: es - español
  - link: /fa/
    name: fa
  - link: /fr/
    name: fr - français
  - link: /id/
    name: id
  - link: /it/
    name: it - italiano
  - link: /ja/
    name: ja - 日本語
  - link: /ko/
    name: ko - 한국어
  - link: /nl/
    name: nl
  - link: /pl/
    name: pl
  - link: /pt/
    name: pt - português
  - link: /ru/
    name: ru - русский язык
  - link: /sq/
    name: sq - shqip
  - link: /tr/
    name: tr - Türkçe
  - link: /uk/
    name: uk - українська мова
  - link: /zh/
    name: zh - 汉语

Description

The language menu in the docs contains the names of the language only for some of the available languages, while the rest only have the language code. This looks a little weird, and some developers might not even know what language code their language of choice has. Having the name specified for all languages would be much clearer.

names

Wanted Solution

  1. The mkdocs.yml files should be updated to include the name of every available language.
  2. The command that generates a new language (e.g. python ./scripts/docs.py new-lang sv) should include a second parameter where a name can be specified (python ./scripts/docs.py new-lang sv svenska), or the instructions for adding a new translation (https://fastapi.tiangolo.com/contributing/#new-language) should at least describe how to add a name manually.

Wanted Code

- link: /
    name: en - English
  - link: /az/
    name: az - Azərbaycanca
  - link: /de/
    name: de - Deutsch


etc.

Alternatives

No response

Operating System

Linux

Operating System Details

No response

FastAPI Version

0.78.0

Python Version

3.10.4

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions