quran-meta
    Preparing search index...

    Function getSurahNamesAsync

    • Loads the Surah names for one language on demand, so only that language ends up in your bundle (bundlers split each language into its own chunk).

      Parameters

      • lang:
            | "en"
            | "ar"
            | "az"
            | "ru"
            | "tr"
            | "uz"
            | "kk"
            | "fr"
            | "lt"
            | "tg"
            | "ky"
            | "bs"
            | "bn"
            | "es"
            | "id"
            | "it"
            | "ml"
            | "ms"
            | "nl"
            | "sv"
            | "ur"
            | "zh"

        The language code, unknown codes fall back to English

      Returns Promise<
          [
              []
              | SurahName,
              [] | SurahName,
              [] | SurahName,
              [] | SurahName,
              [] | SurahName,
              [] | SurahName,
              [] | SurahName,
              [] | SurahName,
              [] | SurahName,
          ],
      >

      The Surah names in that language, see SurahNames

      const names = await getSurahNamesAsync("fr")
      names[1] // ["Al Fâtiha", "L'ouverture"]