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

有大佬知道搜索功能如何改为中文吗? #327

Closed
webPorter opened this issue Apr 12, 2021 · 10 comments
Closed

有大佬知道搜索功能如何改为中文吗? #327

webPorter opened this issue Apr 12, 2021 · 10 comments

Comments

@webPorter
Copy link

webPorter commented Apr 12, 2021

No description provided.

@yuuuuu422
Copy link

可以在config.toml中加上

[languages]
[languages.en]
  languageName = 'English'
  contentDir = 'content'
  weight = 1

[languages.ru]
  languageName = 'Russian'
  contentDir = 'content.ru'
  weight = 2

[languages.zh]
  languageName = 'Chinese'
  contentDir = 'content.zh'
  weight = 3

选择语言为中文即可,然后把content文件夹改为content.zh。
或者可以直接在i18n中把en.yaml中的- id: bookSearchConfig改为zh.yaml中的那一行,但我发现这样会导致搜索英文失败,好像目前中英文搜索只能二选一。

@webPorter
Copy link
Author

解决了,用的第二种方法,感谢

@halfrost
Copy link

解决了,用的第二种方法,感谢

@webPorter 那你用第二种方法,就抛弃了英文搜索咯??

@webPorter
Copy link
Author

是的,用第一种的话默认语言还是英文,修改权重weight也没用,一打开页面首先显示的还是英文,我想要一打开就是中文

@alex-shpak
Copy link
Owner

defaultContentLanguage = 'zh'

@webPorter
Copy link
Author

感谢

@dyxang
Copy link

dyxang commented Oct 27, 2021

好像目前中英文搜索只能二选一。

这就很难受了,一般文章不会纯中文的,而且这样貌似阿拉伯数字都搜索不了。
可以参考 #357 来看看混合搜索管不管用

@peter-liu
Copy link

刚刚搞定 ,可以参考解决方法

image

没有去研究flexsearch,所以未明白其处理机制下的办法,所以可以先用着。问题也反馈给官方了,后续修复之后可以先用这个撑着。

@peter-liu
Copy link

刚刚搞定 ,可以参考解决方法

image image

没有去研究flexsearch,所以未明白其处理机制下的办法,所以可以先用着。问题也反馈给官方了,后续修复之后可以先用这个撑着。

不太行, 忽略吧

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

No branches or pull requests

7 participants