From f9e717aa77a86d90b27a67e63f1c5e0cad4bd1e2 Mon Sep 17 00:00:00 2001 From: Jayesh Date: Sun, 11 Jan 2026 18:48:08 +0530 Subject: [PATCH] fix: footer links, dynamic copyright year, and security improvements (fixes #20) (#21) * fix: resolve footer links, dynamic year, and security issues (fixes #20) * fix: use relative path for locale files --------- Co-authored-by: Jad --- public/index.html | 22 +++++++++++----------- public/terms.html | 7 +++++-- src/i18n.js | 8 ++++++-- src/i18n/en-US.json | 3 ++- src/i18n/zh-CN.json | 3 ++- 5 files changed, 26 insertions(+), 17 deletions(-) diff --git a/public/index.html b/public/index.html index 455c18b..ae73bef 100644 --- a/public/index.html +++ b/public/index.html @@ -88,13 +88,13 @@

- Gemini Watermark Remover + Gemini Watermark Remover

@@ -241,8 +241,8 @@ diff --git a/public/terms.html b/public/terms.html index efe78f2..2b91844 100644 --- a/public/terms.html +++ b/public/terms.html @@ -36,7 +36,7 @@

- Gemini Watermark Remover + Gemini Watermark Remover

@@ -129,10 +129,13 @@
-

© 2025 Gemini Watermark Remover. All rights reserved.

+

© 2025 Gemini Watermark Remover. All rights reserved.

+ \ No newline at end of file diff --git a/src/i18n.js b/src/i18n.js index 04688e8..4667abb 100644 --- a/src/i18n.js +++ b/src/i18n.js @@ -9,14 +9,18 @@ const i18n = { }, async loadTranslations(locale) { - const res = await fetch(`/i18n/${locale}.json?_=${Date.now()}`); + const res = await fetch(`./i18n/${locale}.json?_=${Date.now()}`); this.translations = await res.json(); this.locale = locale; localStorage.setItem('locale', locale); }, t(key) { - return this.translations[key] || key; + let text = this.translations[key] || key; + if (typeof text === 'string') { + text = text.replace('{{year}}', new Date().getFullYear()); + } + return text; }, applyTranslations() { diff --git a/src/i18n/en-US.json b/src/i18n/en-US.json index 1709d99..0b4449d 100644 --- a/src/i18n/en-US.json +++ b/src/i18n/en-US.json @@ -27,8 +27,9 @@ "footer.desc": "Gemini Watermark Remover, for educational purposes only", "footer.links": "Links", "footer.terms": "Terms of Use", + "footer.github": "GitHub", "footer.tech": "Technology", - "footer.copyright": "© 2025 Gemini Watermark Remover. All rights reserved.", + "footer.copyright": "© {{year}} Gemini Watermark Remover. All rights reserved.", "loading.text": "Processing...", "status.loading": "Loading resources...", "status.pending": "Pending...", diff --git a/src/i18n/zh-CN.json b/src/i18n/zh-CN.json index 76b18e3..bebf33d 100644 --- a/src/i18n/zh-CN.json +++ b/src/i18n/zh-CN.json @@ -27,8 +27,9 @@ "footer.desc": "Gemini 无损去水印工具,本工具仅供学习交流使用", "footer.links": "链接", "footer.terms": "使用条款", + "footer.github": "GitHub", "footer.tech": "技术", - "footer.copyright": "© 2025 Gemini Watermark Remover. All rights reserved.", + "footer.copyright": "© {{year}} Gemini Watermark Remover. All rights reserved.", "loading.text": "正在处理...", "status.loading": "正在加载资源...", "status.pending": "等待处理...",