docusaurus-search-local icon indicating copy to clipboard operation
docusaurus-search-local copied to clipboard

is search not supported for other language which is not mentioned on doc?

Open code-masala opened this issue 4 years ago • 1 comments
trafficstars

@cmfcmf For other language search-index.json is generated perfectly fine.But in search bar only supported the locale language en .For other language no results.

code-masala avatar Nov 11 '21 06:11 code-masala

I am not 100% sure what the issue is here. It should currently work like so: Let's say your documentation is in two languages, English and German. You have configured them in your docusaurus.config.js like this:

 i18n: {
    defaultLocale: 'en',
    locales: ['en', 'de'],
    localeConfigs: {
      en: {
        label: 'English',
      },
      de: {
        label: 'Deutsch',
      },
    },
  },

Then, the search bar will use the German search index when you are on a German docs page, and the English search index, when you are on an English docs page. Please let me know if that doesn't work for you :)

cmfcmf avatar Dec 03 '21 23:12 cmfcmf