Skip to content

Commit

Permalink
docs: align api/v1/langs doc to match current implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
joanise committed Dec 16, 2024
1 parent 947045f commit 4f8811e
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions readalongs/web_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,17 +124,22 @@ async def langs() -> List[SupportedLanguage]:
"""Return the list of supported languages and their names as a dict.
Returns:
Supported languages as list with language codes and mapping of
language code to name, including minimally the key "_" for the
default display name (usually, but not always, in English).
For example:
Supported languages as a list with language codes and a mapping
`{ "_": "Default Display Name" }`, where the language's default display name is
usually (but not always) in English.
For example:
[
{"code": "alq", names: { "alq": "Anishinaabemowin", "_": "Algonquin" }},
{"code": "atj", names: { "atj": "Nehiromowin", "_": "Atikamekw" }},
{"code": "fra", names: { "fra": "Français", "_": "French" }},
{"code": "alq", names: { "_": "Algonquin" }},
{"code": "atj", names: { "_": "Atikamekw" }},
{"code": "fra", names: { "_": "French" }},
...
]
In the future, we may add localized names to this mapping with language
codes as the keys, e.g.,
[ {"code": "alq", names: { "alq": "Anishinaabemowin", "_": "Algonquin" }}, ... ]
"""
langs, lang_names = LANGS
return [
Expand Down

0 comments on commit 4f8811e

Please sign in to comment.