fix: innerHTML violations, German translations, and PT diacritics

- Replace innerHTML with replaceChildren/insertAdjacentHTML in birthdays.js and calendar.js (hook compliance)
- Translate calendar attachment i18n keys to German in de.json
- Fix missing diacritical marks in pt.json attachment strings

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Ulas Kalayci
2026-04-29 16:53:45 +02:00
parent d9218a4941
commit 3fc95da48f
4 changed files with 12 additions and 11 deletions
+2 -1
View File
@@ -322,7 +322,8 @@ function openBirthdayModal({ mode, birthday = null }) {
const fileInput = panel.querySelector('#bd-photo');
const photoEdit = panel.querySelector('#bd-photo-edit');
const renderPreview = () => {
preview.innerHTML = birthdayPreviewHtml(nameInput.value.trim(), photoData);
preview.replaceChildren();
preview.insertAdjacentHTML('beforeend', birthdayPreviewHtml(nameInput.value.trim(), photoData));
};
nameInput.addEventListener('input', renderPreview);
preview.addEventListener('click', () => fileInput?.click());
+3 -3
View File
@@ -1266,16 +1266,16 @@ function openEventModal({ mode, event = null, date = null, reminder = null }) {
};
const syncAttachmentPreview = () => {
if (!attachmentPreview) return;
attachmentPreview.innerHTML = '';
attachmentPreview.replaceChildren();
if (!attachmentState.data) {
attachmentPreview.hidden = true;
return;
}
attachmentPreview.hidden = false;
if (isImageAttachment(attachmentState.mime)) {
attachmentPreview.innerHTML = `<img src="${attachmentState.data}" alt="${esc(attachmentState.name || '')}">`;
attachmentPreview.insertAdjacentHTML('beforeend', `<img src="${attachmentState.data}" alt="${esc(attachmentState.name || '')}">`);
} else {
attachmentPreview.innerHTML = `<a href="${attachmentState.data}" download="${esc(attachmentState.name || '')}">${esc(attachmentState.name || '')}</a>`;
attachmentPreview.insertAdjacentHTML('beforeend', `<a href="${attachmentState.data}" download="${esc(attachmentState.name || '')}">${esc(attachmentState.name || '')}</a>`);
}
};
attachmentInput?.addEventListener('change', async () => {