-
Notifications
You must be signed in to change notification settings - Fork 124
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
Set language after pagefind has been initialized #489
Comments
Hmm, re-initializing isn't something I had considered, but I can see why it would be helpful here. I'll look at exposing something to allow this. Part of the reason it doesn't exist is that there's a fairly high cost to doing so — not only is the index separated by language (so meta info will need to be re-fetched), the WebAssembly itself is loaded specific to a language, so re-initialization will be of the entire stack. Not necessarily a big deal, since changing language through a reload would do so anyway, but just FYI. Will let you know when this is available! |
@bglw Thank you so much! Not only for this, but your whole work on this project! :) |
@openscript, are you using the JS search API directly, or the Default UI package? |
In either case, this has been implemented in #498 and will go out with the next release 🙂 |
I'm using the api and bring my own UI. |
Thank you so much. Looking forward trying it out! |
Released in v1.0.4 🎉 Let me know if that works out for you! I have also included a test specifically for your case here: pagefind/pagefind/features/multilingual.feature Lines 314 to 318 in 971186c
|
I have a web app, where the language can be changed by the user without reloading the page. Pagefind doesn't get to know this change, so it will search in the wrong language.
Is it possible to reinitialize or change the Pagefinds language after it has been initialized?
The text was updated successfully, but these errors were encountered: