We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2bf9ebf commit 6f598e8Copy full SHA for 6f598e8
1 file changed
packages/cli/src/api/catalog.ts
@@ -252,7 +252,21 @@ export class Catalog {
252
console.error(`Message with key ${key} is missing in locale ${locale}`)
253
}
254
255
- const getTranslation = (locale) => catalogs[locale][key].translation
+ const getTranslation = (locale) => {
256
+ const configLocales = this.config.locales.join('", "')
257
+ if (catalogs[locale]) {
258
+ return catalogs[locale][key].translation
259
+ }
260
+
261
+ console.warn(`
262
+ Catalog "${locale}" isn't present in locales config parameter
263
+ Add "${locale}" to your lingui.config.js:
264
+ {
265
+ locales: ["${configLocales}", "${locale}"]
266
267
+ `)
268
+ return null
269
270
271
const getMultipleFallbacks = (locale) => {
272
const fL = fallbackLocales[locale]
0 commit comments