cmfcmf / docusaurus-search-local

Offline / Local Search for Docusaurus v2. Try it live at:
https://cmfcmf.github.io/OpenWeatherMap-PHP-API/
MIT License
438 stars 67 forks source link

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

Closed code-masala closed 1 year ago

code-masala commented 2 years ago

@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.

cmfcmf commented 2 years ago

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 :)