Nyuan Zhang

Results 22 comments of Nyuan Zhang

> This would really only be practical if the enums were "batteries included" in base python. Having every library define their own Enum and then, for correct type checking, require...

I tried to tweak the code and made a prototype, however I'm not sure where to place the language files, since multiple themes could utilize the same language file. In...

That seems reasonable to me. I'll look into it again in the following few days :)

Although the implementation is ugly, I made a working prototype. ![image](https://github.com/mkdocstrings/mkdocstrings/assets/50769752/b2517947-cd39-4bb3-ab32-7d4fdbc79ff3) Here's the branch: https://github.com/BlueGlassBlock/mkdocstrings-python/tree/master

> Looks nice to me! Is there something in particular bothering you in your prototype? I'm quite uncertain about handling symbols and capitalization (e.g. `description` `Description` `Description:`), since they might...

> This, or the keys themselves have the expected casing: `description`, `DESCRIPTION`, `Description:`, etc. Sounds quite interesting, in this way the maintenance burden of the templates could be reduced to...

Just submitted mkdocstrings/python#77 However `mkdocstrings` itself may require a small patch here (didn't find other ways to inject locale value): ```diff diff --git a/src/mkdocstrings/plugin.py b/src/mkdocstrings/plugin.py index 5233cf4..cde45a4 100644 --- a/src/mkdocstrings/plugin.py...

> Do all themes accept this `locale` option? It will not always be specified, so it should maybe use `config["theme"].get("locale", default_locale)` instead. I checked `mkdocs`' code, it's always provided: https://github.com/mkdocs/mkdocs/blob/afb66c1bea3eb07a917803a25d5e536edd2b8084/mkdocs/theme.py#L34...

Ooh, I just found out that `mkdocs-material` [used a different approach](https://squidfunk.github.io/mkdocs-material/setup/changing-the-language/?h=internat#configuration)(`theme.language`) from the [mkdocs ones](https://www.mkdocs.org/user-guide/localizing-your-theme/)(`theme.locale`), maybe we should provide fallback and respect `config["theme"].get("language", "en")` in case the `locale` is not...

Sorry for the late update, however I thought I underestimated the pitfalls in i18n implementations across MkDocs :( So, according to [MkDocs Material - Changing the Language](https://squidfunk.github.io/mkdocs-material/setup/changing-the-language/), they use a...