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:
@@ -2,6 +2,7 @@ import { SkipNavContent, SkipNavLink } from '@chakra-ui/react';
|
||||
import { Outlet } from '@tanstack/react-router';
|
||||
import siteContent from '@/content/siteContent';
|
||||
import useRouteFocus from '@/hooks/useRouteFocus';
|
||||
import { t } from '@/i18n';
|
||||
import UmamiAnalytics from './Analytics/UmamiAnalytics';
|
||||
import BackToTop from './BackToTop/BackToTop';
|
||||
import Footer from './Footer/Footer';
|
||||
@@ -15,7 +16,7 @@ export default function AppShell() {
|
||||
return (
|
||||
<>
|
||||
<SkipNavLink id="main" data-testid="skip-link">
|
||||
Direct naar de inhoud
|
||||
{t('common.aria.skipToContent')}
|
||||
</SkipNavLink>
|
||||
<NavigationBar />
|
||||
<SkipNavContent as="main" id="main">
|
||||
|
||||
@@ -25,6 +25,7 @@ import {
|
||||
import { contactClient } from '@/contact/contactClient';
|
||||
import type { EmailAddress } from '@/content/types';
|
||||
import useEmailAddress from '@/hooks/useEmailAddress';
|
||||
import { t } from '@/i18n';
|
||||
import { mailtoLink } from '@/lib/mailLink';
|
||||
import { trackContactEvent } from '@/lib/trackEvent';
|
||||
import { CAPTCHA_HEIGHT } from './CaptchaWidget';
|
||||
@@ -133,7 +134,7 @@ export default function ContactForm({
|
||||
borderStartColor="accent"
|
||||
bg="paper.alt"
|
||||
>
|
||||
{`Bedankt voor je bericht! Ik reageer binnen ${replyTime}.`}
|
||||
{t('common.form.sent', { replyTime })}
|
||||
</Box>
|
||||
);
|
||||
}
|
||||
@@ -178,13 +179,13 @@ export default function ContactForm({
|
||||
required
|
||||
id={fieldId('name')}
|
||||
>
|
||||
{label('Naam')}
|
||||
{label(t('common.form.name.label'))}
|
||||
<Input
|
||||
{...control('name')}
|
||||
type="text"
|
||||
autoComplete="name"
|
||||
maxLength={CONTACT_LIMITS.name}
|
||||
placeholder="Jouw naam"
|
||||
placeholder={t('common.form.name.placeholder')}
|
||||
/>
|
||||
{error('name')}
|
||||
</Field.Root>
|
||||
@@ -193,13 +194,13 @@ export default function ContactForm({
|
||||
required
|
||||
id={fieldId('email')}
|
||||
>
|
||||
{label('E-mail')}
|
||||
{label(t('common.form.email.label'))}
|
||||
<Input
|
||||
{...control('email')}
|
||||
type="email"
|
||||
autoComplete="email"
|
||||
maxLength={CONTACT_LIMITS.email}
|
||||
placeholder="jouw@email.nl"
|
||||
placeholder={t('common.form.email.placeholder')}
|
||||
/>
|
||||
{error('email')}
|
||||
</Field.Root>
|
||||
@@ -210,10 +211,12 @@ export default function ContactForm({
|
||||
required
|
||||
id={fieldId('subject')}
|
||||
>
|
||||
{label('In welke shoot heb je interesse?')}
|
||||
{label(t('common.form.subject.label'))}
|
||||
<NativeSelect.Root>
|
||||
<NativeSelect.Field {...control('subject')}>
|
||||
<option value="">Kies een optie...</option>
|
||||
<option value="">
|
||||
{t('common.form.subject.placeholder')}
|
||||
</option>
|
||||
{options.map((option) => (
|
||||
<option key={option.value} value={option.value}>
|
||||
{option.label}
|
||||
@@ -230,11 +233,11 @@ export default function ContactForm({
|
||||
required
|
||||
id={fieldId('message')}
|
||||
>
|
||||
{label('Stel hier je vraag')}
|
||||
{label(t('common.form.message.label'))}
|
||||
<Textarea
|
||||
{...control('message')}
|
||||
maxLength={CONTACT_LIMITS.message}
|
||||
placeholder="Vul hier je bericht in"
|
||||
placeholder={t('common.form.message.placeholder')}
|
||||
minH="170px"
|
||||
resize="vertical"
|
||||
/>
|
||||
@@ -278,11 +281,10 @@ export default function ContactForm({
|
||||
fontSize="sm"
|
||||
>
|
||||
<Text>
|
||||
De controle dat je geen robot bent kon niet laden.
|
||||
Ververs de pagina of
|
||||
{t('common.form.captcha.problem')}
|
||||
{address ? (
|
||||
<>
|
||||
{' mail naar '}
|
||||
{t('common.form.captcha.mailTo')}
|
||||
<Link
|
||||
variant="underline"
|
||||
href={mailtoLink(address, mailSubject)}
|
||||
@@ -291,7 +293,7 @@ export default function ContactForm({
|
||||
</Link>
|
||||
</>
|
||||
) : (
|
||||
' mail me.'
|
||||
t('common.form.captcha.mailMe')
|
||||
)}
|
||||
</Text>
|
||||
</Box>
|
||||
@@ -321,7 +323,7 @@ export default function ContactForm({
|
||||
>
|
||||
{disabled
|
||||
? form.messages.sendingLabel
|
||||
: '(Aan)vraag versturen'}
|
||||
: t('common.form.submit')}
|
||||
</chakra.button>
|
||||
{/* Under the submit button, aligned with it */}
|
||||
<PrivacyNote textAlign="end" />
|
||||
|
||||
@@ -4,6 +4,7 @@ import Eyebrow from '@/components/Eyebrow/Eyebrow';
|
||||
import PrivacyNote from '@/components/PrivacyNote/PrivacyNote';
|
||||
import type { EmailAddress } from '@/content/types';
|
||||
import useEmailAddress from '@/hooks/useEmailAddress';
|
||||
import { t } from '@/i18n';
|
||||
import { mailtoLink } from '@/lib/mailLink';
|
||||
|
||||
type ContactFormGateProps = {
|
||||
@@ -14,7 +15,7 @@ type ContactFormGateProps = {
|
||||
};
|
||||
|
||||
// The text that comes before the address once it is shown
|
||||
const MAIL_LEAD = ' Mail me voor nu op ';
|
||||
const MAIL_LEAD = t('common.gate.mailLead');
|
||||
|
||||
// Until there is a back-end the form stays visible but dimmed and inert
|
||||
// under a "coming soon" notice with a mail button (FR-HP-07). inert keeps
|
||||
@@ -52,9 +53,9 @@ export default function ContactFormGate({
|
||||
textAlign="center"
|
||||
data-testid="contact-gate-notice"
|
||||
>
|
||||
<Eyebrow>Binnenkort</Eyebrow>
|
||||
<Eyebrow>{t('common.gate.eyebrow')}</Eyebrow>
|
||||
<Text color="ink.soft" mb={available ? 7 : 0}>
|
||||
Het contactformulier komt binnenkort.
|
||||
{t('common.gate.text')}
|
||||
{address ? (
|
||||
<>
|
||||
{MAIL_LEAD}
|
||||
@@ -84,7 +85,7 @@ export default function ContactFormGate({
|
||||
css={linkButton({ variant: 'accent' })}
|
||||
data-testid="contact-gate-mail"
|
||||
>
|
||||
Stuur een e-mail
|
||||
{t('common.gate.mailButton')}
|
||||
</chakra.a>
|
||||
) : (
|
||||
// Same recipe and label, so the notice is as high as
|
||||
@@ -96,7 +97,7 @@ export default function ContactFormGate({
|
||||
data-email-pending
|
||||
data-testid="contact-gate-mail-pending"
|
||||
>
|
||||
Stuur een e-mail
|
||||
{t('common.gate.mailButton')}
|
||||
</chakra.span>
|
||||
))}
|
||||
{/* Readable now, while the form's own line is inert (BR-PR-03) */}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { Link, Text, type TextProps } from '@chakra-ui/react';
|
||||
import RouterLink from '@/components/RouterLink';
|
||||
import { t } from '@/i18n';
|
||||
|
||||
// The line under a contact form (and under its "coming soon" notice) that
|
||||
// tells visitors where to read what happens with their details (BR-PR-01).
|
||||
@@ -12,13 +13,13 @@ export default function PrivacyNote(props: TextProps) {
|
||||
data-testid="privacy-note"
|
||||
{...props}
|
||||
>
|
||||
Lees in de{' '}
|
||||
{t('common.privacyNote.before')}{' '}
|
||||
<Link variant="underline" asChild>
|
||||
<RouterLink to="/privacyverklaring">
|
||||
privacyverklaring
|
||||
{t('common.privacyNote.link')}
|
||||
</RouterLink>
|
||||
</Link>{' '}
|
||||
wat ik met je gegevens doe.
|
||||
{t('common.privacyNote.after')}
|
||||
</Text>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { useEffect } from 'react';
|
||||
import { chakra, useRecipe } from '@chakra-ui/react';
|
||||
import { useRouter, type ErrorComponentProps } from '@tanstack/react-router';
|
||||
import { t } from '@/i18n';
|
||||
import { reportError } from '@/monitoring/sentry';
|
||||
import LinkButton from '../LinkButton';
|
||||
import StatusPage from './StatusPage';
|
||||
@@ -24,10 +25,15 @@ export default function ErrorPage({ error, reset }: ErrorComponentProps) {
|
||||
|
||||
return (
|
||||
<>
|
||||
<title>Er ging iets mis | Andrea Slop Fotografie</title>
|
||||
<title>
|
||||
{t('common.status.documentTitle', {
|
||||
title: t('common.status.error.title'),
|
||||
siteName: t('common.site.name'),
|
||||
})}
|
||||
</title>
|
||||
<meta name="robots" content="noindex" />
|
||||
<StatusPage
|
||||
title="Er ging iets mis"
|
||||
title={t('common.status.error.title')}
|
||||
actions={
|
||||
<>
|
||||
<chakra.button
|
||||
@@ -37,20 +43,19 @@ export default function ErrorPage({ error, reset }: ErrorComponentProps) {
|
||||
cursor="pointer"
|
||||
data-testid="error-page-retry-button"
|
||||
>
|
||||
Opnieuw proberen
|
||||
{t('common.actions.retry')}
|
||||
</chakra.button>
|
||||
<LinkButton
|
||||
to="/"
|
||||
variant="outline"
|
||||
data-testid="error-page-home-link"
|
||||
>
|
||||
Terug naar home
|
||||
{t('common.actions.backHome')}
|
||||
</LinkButton>
|
||||
</>
|
||||
}
|
||||
>
|
||||
Door een fout kan deze pagina nu niet worden getoond. Probeer
|
||||
het opnieuw of ga terug naar de homepage.
|
||||
{t('common.status.error.text')}
|
||||
</StatusPage>
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { useRouterState } from '@tanstack/react-router';
|
||||
import useHydrated from '@/hooks/useHydrated';
|
||||
import { t } from '@/i18n';
|
||||
import { isShootSectionPath } from '@/lib/isShootSectionPath';
|
||||
import LinkButton from '../LinkButton';
|
||||
import StatusPage from './StatusPage';
|
||||
@@ -19,10 +20,15 @@ export default function NotFound() {
|
||||
|
||||
return (
|
||||
<>
|
||||
<title>Pagina niet gevonden | Andrea Slop Fotografie</title>
|
||||
<title>
|
||||
{t('common.status.documentTitle', {
|
||||
title: t('common.status.notFound.title'),
|
||||
siteName: t('common.site.name'),
|
||||
})}
|
||||
</title>
|
||||
<meta name="robots" content="noindex" />
|
||||
<StatusPage
|
||||
title="Pagina niet gevonden"
|
||||
title={t('common.status.notFound.title')}
|
||||
actions={
|
||||
hydrated && isShootSectionPath(pathname) ? (
|
||||
<>
|
||||
@@ -31,21 +37,20 @@ export default function NotFound() {
|
||||
variant="accent"
|
||||
data-testid="status-page-section-link"
|
||||
>
|
||||
Terug naar Soorten fotoshoots
|
||||
{t('common.status.backToShoots')}
|
||||
</LinkButton>
|
||||
<LinkButton
|
||||
to="/"
|
||||
variant="outline"
|
||||
data-testid="status-page-home-link"
|
||||
>
|
||||
Terug naar home
|
||||
{t('common.actions.backHome')}
|
||||
</LinkButton>
|
||||
</>
|
||||
) : undefined
|
||||
}
|
||||
>
|
||||
Deze pagina bestaat niet (meer). Misschien is de link verouderd
|
||||
of zit er een typfout in het adres.
|
||||
{t('common.status.notFound.text')}
|
||||
</StatusPage>
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import type { ReactNode } from 'react';
|
||||
import { Container, Flex, Heading, Text } from '@chakra-ui/react';
|
||||
import { t } from '@/i18n';
|
||||
import LinkButton from '../LinkButton';
|
||||
|
||||
type StatusPageProps = {
|
||||
@@ -32,7 +33,7 @@ export default function StatusPage({
|
||||
<Flex gap={4} justifyContent="center" wrap="wrap">
|
||||
{actions ?? (
|
||||
<LinkButton to="/" data-testid="status-page-home-link">
|
||||
Terug naar home
|
||||
{t('common.actions.backHome')}
|
||||
</LinkButton>
|
||||
)}
|
||||
</Flex>
|
||||
|
||||
@@ -8,6 +8,7 @@ import {
|
||||
} from '@chakra-ui/react';
|
||||
import { Link } from '@tanstack/react-router';
|
||||
import type { PricingPackage } from '@/content/types';
|
||||
import { t } from '@/i18n';
|
||||
import { bookLabel } from '@/lib/bookLabel';
|
||||
import { formatPrice } from '@/lib/formatPrice';
|
||||
|
||||
@@ -62,7 +63,7 @@ export default function PriceCard({ pkg }: PriceCardProps) {
|
||||
color="white"
|
||||
whiteSpace="nowrap"
|
||||
>
|
||||
Uitgelicht
|
||||
{t('common.pricing.featured')}
|
||||
</Text>
|
||||
)}
|
||||
{/* Smaller than the design's 1.75rem: stays clearly below the
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { Box, chakra, Text } from '@chakra-ui/react';
|
||||
import type { PricingTopBanner } from '@/content/types';
|
||||
import { t } from '@/i18n';
|
||||
|
||||
type PriceTopBarProps = {
|
||||
banner: PricingTopBanner;
|
||||
@@ -18,7 +19,7 @@ export default function PriceTopBar({ banner }: PriceTopBarProps) {
|
||||
return (
|
||||
<Box
|
||||
as="aside"
|
||||
aria-label={title ?? 'Mededeling'}
|
||||
aria-label={title ?? t('common.pricing.announcement')}
|
||||
data-testid="price-top-bar"
|
||||
display="flex"
|
||||
flexWrap="wrap"
|
||||
|
||||
@@ -9,5 +9,70 @@
|
||||
"newTab": {
|
||||
"short": "(opent in nieuw tabblad)",
|
||||
"instagram": "(Instagram, opent in nieuw tabblad)"
|
||||
},
|
||||
"actions": {
|
||||
"backHome": "Terug naar home",
|
||||
"close": "Sluiten",
|
||||
"retry": "Opnieuw proberen"
|
||||
},
|
||||
"form": {
|
||||
"name": {
|
||||
"label": "Naam",
|
||||
"placeholder": "Jouw naam"
|
||||
},
|
||||
"email": {
|
||||
"label": "E-mail",
|
||||
"placeholder": "jouw@email.nl"
|
||||
},
|
||||
"subject": {
|
||||
"label": "In welke shoot heb je interesse?",
|
||||
"placeholder": "Kies een optie..."
|
||||
},
|
||||
"message": {
|
||||
"label": "Stel hier je vraag",
|
||||
"placeholder": "Vul hier je bericht in"
|
||||
},
|
||||
"submit": "(Aan)vraag versturen",
|
||||
"sent": "Bedankt voor je bericht! Ik reageer binnen {replyTime}.",
|
||||
"captcha": {
|
||||
"problem": "De controle dat je geen robot bent kon niet laden. Ververs de pagina of",
|
||||
"mailTo": " mail naar ",
|
||||
"mailMe": " mail me."
|
||||
}
|
||||
},
|
||||
"gate": {
|
||||
"eyebrow": "Binnenkort",
|
||||
"text": "Het contactformulier komt binnenkort.",
|
||||
"mailLead": " Mail me voor nu op ",
|
||||
"mailButton": "Stuur een e-mail"
|
||||
},
|
||||
"status": {
|
||||
"documentTitle": "{title} | {siteName}",
|
||||
"backToShoots": "Terug naar Soorten fotoshoots",
|
||||
"notFound": {
|
||||
"title": "Pagina niet gevonden",
|
||||
"text": "Deze pagina bestaat niet (meer). Misschien is de link verouderd of zit er een typfout in het adres."
|
||||
},
|
||||
"error": {
|
||||
"title": "Er ging iets mis",
|
||||
"text": "Door een fout kan deze pagina nu niet worden getoond. Probeer het opnieuw of ga terug naar de homepage."
|
||||
}
|
||||
},
|
||||
"lightbox": {
|
||||
"label": "Foto groot bekijken",
|
||||
"previous": "Vorige foto",
|
||||
"next": "Volgende foto",
|
||||
"announcement": "Foto {position} van {count}",
|
||||
"announcementWithCaption": "Foto {position} van {count}, {caption}",
|
||||
"loadFailed": "Deze foto kon niet groot geladen worden"
|
||||
},
|
||||
"privacyNote": {
|
||||
"before": "Lees in de",
|
||||
"link": "privacyverklaring",
|
||||
"after": "wat ik met je gegevens doe."
|
||||
},
|
||||
"pricing": {
|
||||
"featured": "Uitgelicht",
|
||||
"announcement": "Mededeling"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user