Translation files, step 1: common texts (forms, status pages, lightbox, labels) in common.json

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-15 20:51:07 +01:00
co-authored by Claude Sonnet 5.5
parent 458913fd9d
commit 9405e2d4f9
11 changed files with 137 additions and 46 deletions
+16 -8
View File
@@ -12,6 +12,7 @@ import leftOutlined from '@iconify-icons/ant-design/left-outlined';
import rightOutlined from '@iconify-icons/ant-design/right-outlined';
import type { GalleryItem } from '@/content/types';
import useSwipe from '@/hooks/useSwipe';
import { t } from '@/i18n';
import { neighbourIndexes } from '@/lib/neighbourIndexes';
import { wrapIndex } from '@/lib/wrapIndex';
@@ -42,7 +43,7 @@ export default function Lightbox({
index,
onIndexChange,
onClose,
label = 'Foto groot bekijken',
label = t('common.lightbox.label'),
finalFocusEl,
}: LightboxProps) {
const count = items.length;
@@ -77,8 +78,15 @@ export default function Lightbox({
const next = wrapIndex(to, count);
onIndexChange(next);
const caption = items[next].caption;
const position = next + 1;
setAnnouncement(
`Foto ${next + 1} van ${count}` + (caption ? `, ${caption}` : ''),
caption
? t('common.lightbox.announcementWithCaption', {
position,
count,
caption,
})
: t('common.lightbox.announcement', { position, count }),
);
};
@@ -176,7 +184,7 @@ export default function Lightbox({
<Dialog.CloseTrigger asChild>
<ControlButton
ref={closeButton}
aria-label="Sluiten"
aria-label={t('common.actions.close')}
data-testid="lightbox-close"
position="absolute"
top={{ base: 2, md: 4 }}
@@ -202,7 +210,9 @@ export default function Lightbox({
justifyContent="space-between"
>
<ControlButton
aria-label="Vorige foto"
aria-label={t(
'common.lightbox.previous',
)}
data-testid="lightbox-prev"
onClick={() => show(current - 1)}
position={{ md: 'absolute' }}
@@ -226,7 +236,7 @@ export default function Lightbox({
{current + 1} / {count}
</Text>
<ControlButton
aria-label="Volgende foto"
aria-label={t('common.lightbox.next')}
data-testid="lightbox-next"
onClick={() => show(current + 1)}
position={{ md: 'absolute' }}
@@ -271,9 +281,7 @@ function Photo({ item, swipe, onBackground }: PhotoProps) {
const onLoad = () => setLoad('loaded');
const onError = () => setLoad('failed');
const caption =
load === 'failed'
? 'Deze foto kon niet groot geladen worden'
: item.caption;
load === 'failed' ? t('common.lightbox.loadFailed') : item.caption;
return (
<chakra.figure