Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const messages = R.mapObjIndexed(
(_, key) =>
catalog.getTranslation(catalogs, locale, key, {
fallbackLocale: config.fallbackLocale,
sourceLocale: config.sourceLocale
}),
catalogs[locale]
)
// In production we don't want untranslated strings. It's better to use message
// keys as a last resort.
// In development, however, we want to catch missing strings with `missing` parameter
// of I18nProvider (React) or setupI18n (core) and therefore we need to get
// empty translations if missing.
const strict = process.env.NODE_ENV !== "production"
return createCompiledCatalog(
locale,
messages,
strict,
config.compileNamespace,
config.pseudoLocale
)
}