MCPcopy Index your code
hub / github.com/IABTechLab/uid2docs / getLocalizedConfigValue

Function getLocalizedConfigValue

docusaurus.config.js:20–33  ·  view source on GitHub ↗
(key)

Source from the content-addressed store, hash-verified

18const defaultLocale = "en";
19
20function 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} */
36const config = {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected