From db0c4cdc6c7ea0794b33c0a8cf5176ab6c481c38 Mon Sep 17 00:00:00 2001 From: Kibi Kelburton Date: Thu, 14 May 2026 13:49:31 +0200 Subject: [PATCH] i18n for comment truncating --- public/s/js/comments.js | 8 +++++--- src/inc/locales/de.json | 3 ++- src/inc/locales/en.json | 3 ++- src/inc/locales/nl.json | 3 ++- src/inc/locales/zange.json | 5 +++-- views/snippets/footer.html | 1 + 6 files changed, 15 insertions(+), 8 deletions(-) diff --git a/public/s/js/comments.js b/public/s/js/comments.js index da08e43..824159d 100644 --- a/public/s/js/comments.js +++ b/public/s/js/comments.js @@ -1367,7 +1367,7 @@ class CommentSystem { } // Maximum characters to fully render in the item view per comment - static get ITEM_VIEW_MAX_CHARS() { return 10000; } + static get ITEM_VIEW_MAX_CHARS() { return 2000; } renderCommentContent(content, commentId = null, bypassTruncation = false) { if (!content) return ''; @@ -1638,7 +1638,8 @@ class CommentSystem { } if (truncated) { - md += ``; + const btnLabel = (window.f0ckI18n?.sidebar_show_full_comment) || 'show full comment'; + md += ``; } return md; @@ -1646,7 +1647,8 @@ class CommentSystem { console.error('Markdown error:', e); let fallback = this.escapeHtml(content); if (truncated) { - fallback += ` `; + const btnLabel = (window.f0ckI18n?.sidebar_show_full_comment) || 'show full comment'; + fallback += ` `; } return fallback; } diff --git a/src/inc/locales/de.json b/src/inc/locales/de.json index 0a10594..e8bc1b0 100644 --- a/src/inc/locales/de.json +++ b/src/inc/locales/de.json @@ -404,7 +404,8 @@ "loading_activity": "Aktivität wird geladen...", "view": "Ansehen", "read_more": "mehr sehen", - "see_less": "weniger anzeigen" + "see_less": "weniger anzeigen", + "show_full_comment": "ganzen Kommentar anzeigen" }, "subscriptions": { "title": "Meine Abonnements", diff --git a/src/inc/locales/en.json b/src/inc/locales/en.json index c061c11..ed6f324 100644 --- a/src/inc/locales/en.json +++ b/src/inc/locales/en.json @@ -408,7 +408,8 @@ "loading_activity": "Loading activity...", "view": "View", "read_more": "read more", - "see_less": "see less" + "see_less": "see less", + "show_full_comment": "show full comment" }, "subscriptions": { "title": "My Subscriptions", diff --git a/src/inc/locales/nl.json b/src/inc/locales/nl.json index 4f303b9..aa42b92 100644 --- a/src/inc/locales/nl.json +++ b/src/inc/locales/nl.json @@ -404,7 +404,8 @@ "loading_activity": "Activiteit laden...", "view": "Bekijken", "read_more": "lees meer", - "see_less": "zie minder" + "see_less": "zie minder", + "show_full_comment": "volledig commentaar tonen" }, "subscriptions": { "title": "Mijn Abonnementen", diff --git a/src/inc/locales/zange.json b/src/inc/locales/zange.json index fcb7441..75b67f8 100644 --- a/src/inc/locales/zange.json +++ b/src/inc/locales/zange.json @@ -405,8 +405,9 @@ "sidebar": { "loading_activity": "Aktivität wird geladen...", "view": "Ansehen", - "read_more": "mehr lesen", - "see_less": "weniger sehen" + "read_more": "mehr sehen", + "see_less": "weniger sehen", + "show_full_comment": "Kommentar vollständig ausklappen" }, "subscriptions": { "title": "Meine Abonnements", diff --git a/views/snippets/footer.html b/views/snippets/footer.html index 77a4b51..74fbefb 100644 --- a/views/snippets/footer.html +++ b/views/snippets/footer.html @@ -401,6 +401,7 @@ sidebar_view: "{{ t('sidebar.view') }}", sidebar_read_more: "{{ t('sidebar.read_more') }}", sidebar_see_less: "{{ t('sidebar.see_less') }}", + sidebar_show_full_comment: "{{ t('sidebar.show_full_comment') }}", select_file: "{{ t('upload_btn.select_file') }}", enter_url: "{{ t('upload_btn.enter_url') }}", tags_required: "{{ t('upload_btn.tags_required') }}",