New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tox translation build: add tests for lunr.js language support #2564
Conversation
this should avoid forgetting that a locale added to mkdocs theme translations should be supported by lunr.js to work
Unless we want to disable the search plugin for missing locales with a WARNING log instead of crashing like mad? |
@ultrabug Yes, I definitely don't think search plugin support should affect availability of languages. I was actually thinking perhaps a fallback language would be used in that case. Or whatever mkdocs-material does. |
mkdocs-material does crash if you select a language it does not support
|
update tox lunr.js check to only warn and not fail the CI
With latest commit, the search plugin will only WARN on unsupported lang configuration:
Removing the offending locales from the search.lang config is fine since this config option allows to be empty and falls back to english anyway. I've made the tox CI to WARN as well but not fail the CI when a lunr locale is missing. If you're okay with this, I'll update the tests accordingly |
@ultrabug Hmm sorry I'm not quite following the whole scope of this. I have given an example of the ideal state I imagine this in: #2535 (comment) Secondary concerns: surely we don't want a warning if MkDocs has a translation but the search plugin doesn't know the locale for it? In that situation I'd prefer choosing (centrally, within MkDocs) a fallback language (normally English) the search plugin. The reason I don't want it as an actual warning is that then people can't use --strict mode. If MkDocs has the right translation, I think the message should be INFO level. |
Moved to #2602 |
this should avoid forgetting that a locale added to mkdocs theme
translations should be supported by lunr.js to work