-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
Localized search placeholders don't appear even when config'd #2132
Comments
It looks like it works on the Docsify site. Can you start with the config for search like in here: Line 70 in a69c22a
And then carefully convert to your languages and see where it breaks? Also we can't see your working code example so we cannot see if there is some other issue. |
Ok I thought my link to the folder containig index.html made it clear but here's a link to the index.html https://github.com/kudoai/chatgpt.js/blob/main/docs/index.html I'm adding languages offline one by one now |
It immediately fails to show the placeholder at 1 language added search: {
paths: 'auto',
placeholder: { '/': 'Search',
'/zh-cn/': '搜索' },
noData: { '/': 'No results!',
'/zh-cn/': '没有结果!' },
pathNamespaces: ['/zh-cn'],
}, |
however when I use the docsify/index.html format, it works search: {
noData: {
'/zh-cn/': '没有结果!',
'/': 'No results!',
},
paths: 'auto',
placeholder: {
'/zh-cn/': '搜索',
'/': 'Search',
},
pathNamespaces: ['/zh-cn'],
}, ...so it appears order of keys or values matters, something i don't recall the instructions mentioning |
I found the glitch, if |
|
I can't get it to work that way either :( |
Ah, good find a out the ordering. We should definitely mention that in the docs. I guess I hadn't noticed as I haven't tried translations myself yet. |
It also has some errors in my project. It can only show the
url: chinese: http://localhost:3000/zh-cn#/. url: english: http://localhost:3000/en#/ |
Bug Report
When filling localized info in
placeholder
,noData
&pathNamespaces
ofwindow.$docsify.search
inindex.html
, only English appears even on non-English pagesSteps to reproduce
window.$docsify.search
inindex.html
with localized info such as:What is current behaviour
Search bar displays English
What is the expected behaviour
Search bar displays localized language
Other relevant information
Bug does still occur when all/other plugins are disabled?
Your OS: Windows 10
Node.js version: 18.15.0
npm/yarn version: 9.5.0
Browser version: 114.0.2
Docsify version: 4.13.0
Docsify plugins: search, code-copy
Please create a reproducible sandbox
The codesandbox.io site keeps giving error when I try to upload files (https://github.com/chatgptjs/chatgpt.js/tree/main/docs)
Mention the docsify version in which this bug was not present (if any)
The text was updated successfully, but these errors were encountered: