How to use the @lingui/cli/api.createCompiledCatalog function in @lingui/cli

To help you get started, we’ve selected a few @lingui/cli examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github lingui / js-lingui / packages / loader / src / index.js View on Github external
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
  )
}

@lingui/cli

CLI for working wit message catalogs

MIT
Latest version published 6 days ago

Package Health Score

98 / 100
Full package analysis