ultrabug / mkdocs-static-i18n

MkDocs i18n plugin using static translation markdown files
https://ultrabug.github.io/mkdocs-static-i18n/
MIT License
228 stars 38 forks source link

Search is currently restricted to English #202

Closed mribeirodantas closed 1 year ago

mribeirodantas commented 1 year ago

I'm not sure what's going on, but my search box won't search in the translated pages. I tried copy-pasting multiple different configurations from this repository and others, where I can clearly see the search box reaching out of the English content to different languages, but I can't make it work in my instance. Any tips on what to try?

You can check the page here: https://training.nextflow.io And the GitHub repo with the source code (e.g. mkdocs.yml) here: https://github.com/nextflow-io/training

kamilkrzyskow commented 1 year ago

Imo duplicate of #182 there is a repo with a fix there you can fork and use instead for the time being. I didn't make a PR, because I wasn't sure if the author wants to support material's new plugin, and then it turned out my fix isn't complete, as it doesn't fix every section where the search plugin is used in the code.

ultrabug seems to be preoccupied with something else at the moment🤔


As a side-note I think, the issue "only occurs" when using the default language. I saw a repo recently that didn't have this issue, and used .en, .lang.md files, so there was no base default fallback file without a language suffix. The core issue is still there, being that the i18n plugin doesn't detect the new search plugin from the theme, but somehow the paths are searchable when not using the default language.

ultrabug commented 1 year ago

Indeed and I apologize for this @kamilkrzyskow , I really feed bad about my lack of responsiveness

kamilkrzyskow commented 1 year ago

@ultrabug It's ok, I'm managing to fix the issues to my needs. The issue is I'm too inexperienced with MkDocs plugins, E2E testing, and your plugin overall to "properly" fix things. But since the issue has been up for so long, then I shall fix the other parts of code related to the search plugin and I'll open a PR today. The fix is good enough to get the job done and get merged, if it's not fully proper then you can always make changes later 👌

mribeirodantas commented 1 year ago

I would like to take this opportunity to thank @ultrabug for this amazing plugin! 🥳 Changing the order of the plugins worked, @kamilkrzyskow 😄 Thanks!

kamilkrzyskow commented 1 year ago

@mribeirodantas Changing the order of the plugins was only the first clue to the solution, it restored the search ability, but there are a bunch of duplicated links in the results now, since the de-duplication still doesn't work without using the fork.

mribeirodantas commented 1 year ago

You're right, I hadn't noticed the duplication of occurrences.