Debug: Add warning for missing translation keys
All checks were successful
BotUI CI / build (push) Successful in 4m13s
All checks were successful
BotUI CI / build (push) Successful in 4m13s
This commit is contained in:
parent
be802201fd
commit
fb66708cdc
1 changed files with 4 additions and 0 deletions
|
|
@ -126,6 +126,10 @@
|
||||||
function t(key, params) {
|
function t(key, params) {
|
||||||
let text = translations[key] || MINIMAL_FALLBACK[key] || key;
|
let text = translations[key] || MINIMAL_FALLBACK[key] || key;
|
||||||
|
|
||||||
|
if (!translations[key] && !MINIMAL_FALLBACK[key]) {
|
||||||
|
console.warn(`i18n: Missing translation key: ${key}`);
|
||||||
|
}
|
||||||
|
|
||||||
if (params && typeof params === "object") {
|
if (params && typeof params === "object") {
|
||||||
Object.keys(params).forEach((param) => {
|
Object.keys(params).forEach((param) => {
|
||||||
text = text.replace(
|
text = text.replace(
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue