From 4f8811eb68e694cea4605e691813256d18c67e36 Mon Sep 17 00:00:00 2001 From: Eric Joanis Date: Mon, 16 Dec 2024 13:53:03 -0500 Subject: [PATCH] docs: align api/v1/langs doc to match current implementation --- readalongs/web_api.py | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/readalongs/web_api.py b/readalongs/web_api.py index 27cb234c..0e57e3dd 100644 --- a/readalongs/web_api.py +++ b/readalongs/web_api.py @@ -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 [