i18n for comment truncating

This commit is contained in:
2026-05-14 13:49:31 +02:00
parent 4fc262ede2
commit db0c4cdc6c
6 changed files with 15 additions and 8 deletions

View File

@@ -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 += `<span class="item-comment-truncated-notice">… <button class="load-full-comment-btn" type="button">show full comment</button></span>`;
const btnLabel = (window.f0ckI18n?.sidebar_show_full_comment) || 'show full comment';
md += `<span class="item-comment-truncated-notice"><button class="load-full-comment-btn" type="button">${btnLabel}</button></span>`;
}
return md;
@@ -1646,7 +1647,8 @@ class CommentSystem {
console.error('Markdown error:', e);
let fallback = this.escapeHtml(content);
if (truncated) {
fallback += ` <span class="item-comment-truncated-notice">… <button class="load-full-comment-btn" type="button">show full comment</button></span>`;
const btnLabel = (window.f0ckI18n?.sidebar_show_full_comment) || 'show full comment';
fallback += ` <span class="item-comment-truncated-notice"><button class="load-full-comment-btn" type="button">${btnLabel}</button></span>`;
}
return fallback;
}

View File

@@ -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",

View File

@@ -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",

View File

@@ -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",

View File

@@ -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",

View File

@@ -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') }}",