mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-18 17:14:26 +03:00
add parseMissingKeyHandler
This commit is contained in:
parent
eaf27ec714
commit
7476fa1300
@ -30,6 +30,18 @@ i18n
|
||||
interpolation: {
|
||||
escapeValue: false, // react already safes from xss
|
||||
},
|
||||
keySeparator: false,
|
||||
parseMissingKeyHandler: (key: string) => {
|
||||
console.debug("Missing key: " + key);
|
||||
const parts = key.split('.');
|
||||
if (parts.length > 1) {
|
||||
if (parts[0] === 'object' || parts[0] === 'audio') {
|
||||
return parts[1].replaceAll("_", " ").charAt(0).toUpperCase() + parts[1].slice(1);
|
||||
}
|
||||
return parts[parts.length - 1];
|
||||
}
|
||||
return key;
|
||||
}
|
||||
});
|
||||
|
||||
export default i18n;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user