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:
parent
e33a589a27
commit
1c663b7675
1 changed files with 8 additions and 2 deletions
|
@ -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];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue