Skip to content
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

search plugin: do not crash on missing lang options, inform instead #2602

Merged
merged 4 commits into from Oct 10, 2021

Conversation

@ultrabug
Copy link
Member

@ultrabug ultrabug commented Oct 8, 2021

  • fallback to english on missing search.lang option
  • support search.lang territory pt_BR -> pt
- fallback to english on missing search.lang option
- support search.lang territory pt_BR -> pt
@ultrabug ultrabug requested a review from oprypin Oct 8, 2021
@ultrabug
Copy link
Member Author

@ultrabug ultrabug commented Oct 8, 2021

This replaces #2564 to address your points #2535 (comment) with #2535 (comment)

Example output:

INFO     -  Option search.lang 'pt_BR' fallbacked to 'pt'
INFO     -  Option search.lang 'zz_BR' is not supported, falling back to 'en'

Copy link
Member

@oprypin oprypin left a comment

Thanks! The approach looks good to me. Let's get this done :)

CI is failing, though 😬

mkdocs/contrib/search/__init__.py Show resolved Hide resolved
mkdocs/contrib/search/__init__.py Outdated Show resolved Hide resolved
mkdocs/contrib/search/__init__.py Outdated Show resolved Hide resolved
@ultrabug
Copy link
Member Author

@ultrabug ultrabug commented Oct 10, 2021

Fixing tests now, should be good soon

@ultrabug
Copy link
Member Author

@ultrabug ultrabug commented Oct 10, 2021

Good for me now 👍

mkdocs/tests/search_tests.py Outdated Show resolved Hide resolved
@ultrabug ultrabug merged commit c426455 into mkdocs:master Oct 10, 2021
16 of 17 checks passed
@ultrabug
Copy link
Member Author

@ultrabug ultrabug commented Oct 10, 2021

Thanks for the review @oprypin

@oprypin
Copy link
Member

@oprypin oprypin commented Oct 10, 2021

Ah thanks for the great fix.

@ultrabug so you probably saw that I mentioned that a release is coming on Sunday [today]
but it seems like there's still some language PRs that we could merge now. So let's not rush with the release.

@ultrabug
Copy link
Member Author

@ultrabug ultrabug commented Oct 10, 2021

Yes mate indeed, I'll check the pt_BR PR out later today, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants