| 100 | */ | 100 | */ |
| 101 | export function translate(text, key = null) { | 101 | export function translate(text, key = null) { |
| 102 | const translationKey = key || text; | 102 | const translationKey = key || text; |
| | 103 | if (translationKey === null || translationKey === undefined) { |
| | 104 | console.trace('WARN: No translation key provided'); |
| | 105 | return ''; |
| | 106 | } |
| 103 | if (trackMissingDynamicTranslate && localeData && !Object.hasOwn(localeData, translationKey) && !trackMissingDynamicTranslate.includes(translationKey)) { | 107 | if (trackMissingDynamicTranslate && localeData && !Object.hasOwn(localeData, translationKey) && !trackMissingDynamicTranslate.includes(translationKey)) { |
| 104 | trackMissingDynamicTranslate.push(translationKey); | 108 | trackMissingDynamicTranslate.push(translationKey); |
| 105 | } | 109 | } |