@@ -889,7 +889,7 @@
scarriffleservices@gmail.com
diff --git a/frontend/js/i18n.js b/frontend/js/i18n.js
index ba49419..957b180 100644
--- a/frontend/js/i18n.js
+++ b/frontend/js/i18n.js
@@ -442,15 +442,26 @@ export function t(key, vars = {}) {
return val.replace(/\{(\w+)\}/g, (_, k) => vars[k] ?? '');
}
+// Look up a translation but return null if the key is undefined in both
+// the current language and German. Lets callers fall back to the existing
+// HTML default rather than displaying the raw key.
+function tOrNull(key) {
+ const dict = translations[currentLang] ?? translations.de;
+ const val = dict[key] ?? translations.de[key];
+ return typeof val === 'string' ? val : null;
+}
+
export function applyLang() {
document.querySelectorAll('[data-i18n]').forEach(el => {
- const v = t(el.dataset.i18n);
- if (typeof v === 'string') el.textContent = v;
+ const v = tOrNull(el.dataset.i18n);
+ if (v != null) el.textContent = v;
});
document.querySelectorAll('[data-i18n-ph]').forEach(el => {
- el.placeholder = t(el.dataset.i18nPh);
+ const v = tOrNull(el.dataset.i18nPh);
+ if (v != null) el.placeholder = v;
});
document.querySelectorAll('[data-i18n-title]').forEach(el => {
- el.title = t(el.dataset.i18nTitle);
+ const v = tOrNull(el.dataset.i18nTitle);
+ if (v != null) el.title = v;
});
}
diff --git a/frontend/js/version.js b/frontend/js/version.js
index 0384aba..15b9c55 100644
--- a/frontend/js/version.js
+++ b/frontend/js/version.js
@@ -1,2 +1,2 @@
// Increment APP_VERSION with every code change
-export const APP_VERSION = 'v15';
+export const APP_VERSION = 'v16';
diff --git a/frontend/sw.js b/frontend/sw.js
index aeed36d..344e6a0 100644
--- a/frontend/sw.js
+++ b/frontend/sw.js
@@ -7,7 +7,7 @@
// the entry HTML / version files). New releases take effect on the next
// reload, no manual SW unregister required.
-const CACHE_VERSION = 'calendarr-v15';
+const CACHE_VERSION = 'calendarr-v16';
const OFFLINE_SHELL = ['/', '/index.html'];
self.addEventListener('install', event => {