question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Search right language in search bar

See original GitHub issue

It seems that reasonml website search bar doesn’t search the correct language. It only search english documentation when I’m actually on Espanol

wrong

I saw @chenglou restricting the doc search to ‘english’ only based on https://github.com/algolia/docsearch-configs/pull/292 because searching ‘foo’ gives 5+ result across all languages. Till today https://github.com/algolia/docsearch-configs/blob/master/configs/reason.json is still restricted to english

Some suggestion. You can search the right language by reverting that commit and change this https://github.com/reasonml/reasonml.github.io/blob/95f4d390b50f823a7b88f21098fec30bc34c6162/website/siteConfig.js#L265-L268

to

  algolia: {
    apiKey: "966d1e412f67114a07dc0afe44b19b53",
    indexName: "reason",
    algoliaOptions: {
      facetFilters: ["lang:LANGUAGE"] 
    }
  },

P.S : I can help to submit a PR if you want

This is because LANGUAGE will be replaced by Docusaurus to the right language. Source code: https://github.com/facebook/Docusaurus/blob/d28b864a59fabeea45add8c090a13de7d0530de5/lib/core/Site.js#L128-L142

algoliaOptions: ${JSON.stringify(
   this.props.config.algolia.algoliaOptions
)
 .replace('VERSION', docsVersion)
 .replace('LANGUAGE', this.props.language)}

Example on my site: Only search for ‘korean’ documentation when on ‘korean’ dynamic language

Only search for ‘chinese’ documentation when on ‘chinese’ cn

cc @joelmarcey @yangshun . Maybe we should update Docusaurus documentation on search bar. I don’t think user know this extra processing that we did. We only refer them to https://community.algolia.com/docsearch/documentation/ 😢 based on https://docusaurus.io/docs/en/search.html#enabling-the-search-bar

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
chengloucommented, Jun 7, 2018

@endiliey so this’ll work today if you make the change right? Feel free to submit a PR to change it for reasonml here!

1reaction
JoelMarceycommented, Jun 7, 2018

@endiliey I would be fine putting those back. We can file an issue as a good first issue or a PR can be done.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Google Search is displaying the wrong language in its results
Google Search is displaying the wrong language in its results · Open Settings > Search settings · Under Region Settings at the bottom...
Read more >
Search results in wrong language - Microsoft Community
Whenever I search something in the search bar, search results are displayed in Greek. For example, if I search "uac", the Greek translation ......
Read more >
Wrong language for Settings search results - Windows 10
Click “Language” (on the left); Click “Administrative Language Settings” (on the right); A popup opened up, called “Region”. In the Tab “ ...
Read more >
How to Change the Default Language of an Internet Browser.
On the right side of the Settings window, click the Language option. ... You can also search for languages using the search field...
Read more >
How to Change Google Search Language on Google.com
In this tutorial, I will show you how to change the Google search language so that your Google searches and the Google.com website...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found