| 18 | const defaultLocale = "en"; |
| 19 | |
| 20 | function getLocalizedConfigValue(key) { |
| 21 | const currentLocale = process.env.DOCUSAURUS_CURRENT_LOCALE ?? defaultLocale; |
| 22 | const values = ConfigLocalized[key]; |
| 23 | if (!values) { |
| 24 | throw new Error(`Localized config key=${key} not found`); |
| 25 | } |
| 26 | const value = values[currentLocale] ?? values[defaultLocale]; |
| 27 | if (!value) { |
| 28 | throw new Error( |
| 29 | `Localized value for config key=${key} not found for both currentLocale=${currentLocale} or defaultLocale=${defaultLocale}`, |
| 30 | ); |
| 31 | } |
| 32 | return value; |
| 33 | } |
| 34 | |
| 35 | /** @type {import('@docusaurus/types').Config} */ |
| 36 | const config = { |