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
+5 -5
View File
@@ -376,11 +376,11 @@
},
"iconLabel": "Icon",
"invalidDate": "Bitte ein gültiges Datum im ausgewählten Format verwenden.",
"attachmentLabel": "Attachment",
"attachmentHint": "Attach a local image, PDF, or document. Images will be shown in the event popup.",
"attachmentFallback": "Attachment",
"attachmentReadError": "The attachment could not be read.",
"attachmentTooLarge": "Attachment may be at most 5 MB."
"attachmentLabel": "Anhang",
"attachmentHint": "Lokales Bild, PDF oder Dokument anhängen. Bilder werden im Ereignis-Popup angezeigt.",
"attachmentFallback": "Anhang",
"attachmentReadError": "Der Anhang konnte nicht gelesen werden.",
"attachmentTooLarge": "Der Anhang darf höchstens 5 MB groß sein."
},
"notes": {
"title": "Notizen",
+2 -2
View File
@@ -362,8 +362,8 @@
"attachmentLabel": "Anexo",
"attachmentHint": "Anexe uma imagem, PDF ou documento local. Imagens aparecem no pop-up do evento.",
"attachmentFallback": "Anexo",
"attachmentReadError": "Nao foi possivel ler o anexo.",
"attachmentTooLarge": "O anexo pode ter no maximo 5 MB."
"attachmentReadError": "Não foi possível ler o anexo.",
"attachmentTooLarge": "O anexo pode ter no máximo 5 MB."
},
"notes": {
"title": "Quadro de notas",
+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 () => {