Skip to content

Commit

Permalink
fix: message when translations are missing (#964)
Browse files Browse the repository at this point in the history
  • Loading branch information
HamAndRock authored Jan 27, 2021
1 parent f368b35 commit 14f24f2
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/cli/src/api/catalog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,13 @@ export class Catalog {

const getTranslation = (locale) => {
const configLocales = this.config.locales.join('", "')

if (!catalogs[locale].hasOwnProperty(key)) {
console.error(`Message with key ${key} is missing in locale ${locale}`);
return null;
}


if (catalogs[locale]) {
return catalogs[locale][key].translation
}
Expand Down

1 comment on commit 14f24f2

@vercel
Copy link

@vercel vercel bot commented on 14f24f2 Jan 27, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.