From 1c663b7675724db0c3c69c7fe5db64d028fdb6bc Mon Sep 17 00:00:00 2001 From: Bill Thornton Date: Wed, 8 Sep 2021 10:39:46 -0400 Subject: [PATCH] Log warning instead of error when dictionary has not loaded --- src/scripts/globalize.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/scripts/globalize.js b/src/scripts/globalize.js index c66ed2b7f4..6ecedfeafa 100644 --- a/src/scripts/globalize.js +++ b/src/scripts/globalize.js @@ -1,5 +1,7 @@ -import * as userSettings from './settings/userSettings'; import { Events } from 'jellyfin-apiclient'; +import isEmpty from 'lodash-es/isEmpty'; + +import * as userSettings from './settings/userSettings'; /* eslint-disable indent */ @@ -189,7 +191,11 @@ import { Events } from 'jellyfin-apiclient'; dictionary = getDictionary(module, fallbackCulture); } if (!dictionary || !dictionary[key]) { - console.error(`Translation key is missing from dictionary: ${key}`); + if (dictionary && isEmpty(dictionary)) { + console.warn('Translation dictionary is empty.'); + } else { + console.error(`Translation key is missing from dictionary: ${key}`); + } return key; } return dictionary[key];