Skip to content
This repository has been archived by the owner on Dec 5, 2022. It is now read-only.

Cannot search in Chinese #143

Closed
TonyRenHK opened this issue Nov 17, 2018 · 5 comments
Closed

Cannot search in Chinese #143

TonyRenHK opened this issue Nov 17, 2018 · 5 comments

Comments

@TonyRenHK
Copy link

Hi, I found that I cannot search in Chinese or other language in this theme.

@rbarilani
Copy link
Contributor

@TonyRenHK Hi, yep it's a limitation of the library that we use for "search functionality" which is lunr.js which as far as I know doesn't support Chinese unfortunately.

Do you have any idea how to solve the problem? Do you feel contributing?

@TonyRenHK
Copy link
Author

Due to my project needed, I have updated some code which can support Chinese using lunr.js.
https://github.com/TonyRenHK/hexo-theme-doc
Thank you very much for your great theme!

@rbarilani
Copy link
Contributor

@TonyRenHK Do you think that we can make it chinese available in our theme as a plugin + config options for example? what did you change?

@bhaskarmelkani
Copy link
Contributor

I think if we somehow remove the hardcoading(in chineese) for lables we can make it work, and maybe merge your branch to master.
It will benifit others, who are maybe looking for this feature.
@TonyRenHK WDYT?

@TonyRenHK
Copy link
Author

Actually, I mainly comment out code in line 111 to line 132 in ' lib/nodejs/search/build.js', and then the 'lunr.json' generated normally, and then I re-write the search react component in 'lib/browser/search/components.jsx' to finding the related key-word instead of using lunr's search function.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants