Trace-log stacktrace of translations without key
| @@ -100,6 +100,10 @@ export function t(strings, ...values) { | ||
| 100 | 100 | */ |
| 101 | 101 | export function translate(text, key = null) { |
| 102 | 102 | const translationKey = key || text; |
| 103 | + if (translationKey === null || translationKey === undefined) { | |
| 104 | + console.trace('WARN: No translation key provided'); | |
| 105 | + return ''; | |
| 106 | + } | |
| 103 | 107 | if (trackMissingDynamicTranslate && localeData && !Object.hasOwn(localeData, translationKey) && !trackMissingDynamicTranslate.includes(translationKey)) { |
| 104 | 108 | trackMissingDynamicTranslate.push(translationKey); |
| 105 | 109 | } |