1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Log warning instead of error when dictionary has not loaded

This commit is contained in:
Bill Thornton 2021-09-08 10:39:46 -04:00
parent e33a589a27
commit 1c663b7675

View file

@ -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];