mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Trace-log stacktrace of translations without key
This commit is contained in:
@@ -100,6 +100,10 @@ export function t(strings, ...values) {
|
||||
*/
|
||||
export function translate(text, key = null) {
|
||||
const translationKey = key || text;
|
||||
if (translationKey === null || translationKey === undefined) {
|
||||
console.trace('WARN: No translation key provided');
|
||||
return '';
|
||||
}
|
||||
if (trackMissingDynamicTranslate && localeData && !Object.hasOwn(localeData, translationKey) && !trackMissingDynamicTranslate.includes(translationKey)) {
|
||||
trackMissingDynamicTranslate.push(translationKey);
|
||||
}
|
||||
|
Reference in New Issue
Block a user