Translation files, step 2: navigation, footer and contact details in site.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 9405e2d4f9
commit 034ba902d2
14 changed files with 101 additions and 38 deletions
+2 -1
View File
@@ -1,6 +1,7 @@
import { Fragment } from 'react'; import { Fragment } from 'react';
import { Box, Flex, Text } from '@chakra-ui/react'; import { Box, Flex, Text } from '@chakra-ui/react';
import RouterLink from '@/components/RouterLink'; import RouterLink from '@/components/RouterLink';
import { t } from '@/i18n';
import type { BreadcrumbItem } from '@/lib/shootPageView'; import type { BreadcrumbItem } from '@/lib/shootPageView';
type BreadcrumbProps = { type BreadcrumbProps = {
@@ -68,7 +69,7 @@ export default function Breadcrumb({
</Box> </Box>
{!last && ( {!last && (
<Box as="li" aria-hidden="true"> <Box as="li" aria-hidden="true">
/ {t('site.breadcrumb.separator')}
</Box> </Box>
)} )}
</Fragment> </Fragment>
@@ -12,6 +12,7 @@ import Eyebrow from '@/components/Eyebrow/Eyebrow';
import socialPlatforms from '@/content/socialPlatforms'; import socialPlatforms from '@/content/socialPlatforms';
import type { ContentImage, EmailAddress, SocialLink } from '@/content/types'; import type { ContentImage, EmailAddress, SocialLink } from '@/content/types';
import useHydrated from '@/hooks/useHydrated'; import useHydrated from '@/hooks/useHydrated';
import { t } from '@/i18n';
import { contactChannels, type ContactChannel } from '@/lib/contactChannels'; import { contactChannels, type ContactChannel } from '@/lib/contactChannels';
type ContactDetailsProps = { type ContactDetailsProps = {
@@ -122,7 +123,7 @@ export default function ContactDetails({
<> <>
{' '} {' '}
<VisuallyHidden> <VisuallyHidden>
(opent in nieuw tabblad) {t('common.newTab.short')}
</VisuallyHidden> </VisuallyHidden>
</> </>
)} )}
+9 -5
View File
@@ -12,6 +12,7 @@ import socialPlatforms from '@/content/socialPlatforms';
import type { SiteContent } from '@/content/types'; import type { SiteContent } from '@/content/types';
import useEmailAddress from '@/hooks/useEmailAddress'; import useEmailAddress from '@/hooks/useEmailAddress';
import useHydrated from '@/hooks/useHydrated'; import useHydrated from '@/hooks/useHydrated';
import { t } from '@/i18n';
import { copyrightLine } from '@/lib/copyrightLine'; import { copyrightLine } from '@/lib/copyrightLine';
import { visibleSocials } from '@/lib/visibleSocials'; import { visibleSocials } from '@/lib/visibleSocials';
import { footerNav } from '@/navigation'; import { footerNav } from '@/navigation';
@@ -69,7 +70,7 @@ export default function Footer({ content }: FooterProps) {
> >
<Image <Image
src={logoDark} src={logoDark}
alt="Andrea Slop Fotografie" alt={t('common.site.name')}
htmlWidth={500} htmlWidth={500}
htmlHeight={500} htmlHeight={500}
w={{ base: '150px', md: '110px' }} w={{ base: '150px', md: '110px' }}
@@ -84,7 +85,7 @@ export default function Footer({ content }: FooterProps) {
</Flex> </Flex>
{socials.length > 0 && ( {socials.length > 0 && (
<FooterColumn title="Socials"> <FooterColumn title={t('site.footer.socialsTitle')}>
{socials.map((social) => ( {socials.map((social) => (
<chakra.li key={social.platform}> <chakra.li key={social.platform}>
<FooterLink <FooterLink
@@ -97,7 +98,7 @@ export default function Footer({ content }: FooterProps) {
valt hij weg uit de voorgelezen naam */} valt hij weg uit de voorgelezen naam */}
{socialPlatforms[social.platform].name}{' '} {socialPlatforms[social.platform].name}{' '}
<VisuallyHidden> <VisuallyHidden>
(opent in nieuw tabblad) {t('common.newTab.short')}
</VisuallyHidden> </VisuallyHidden>
</FooterLink> </FooterLink>
</chakra.li> </chakra.li>
@@ -106,7 +107,10 @@ export default function Footer({ content }: FooterProps) {
)} )}
{available && ( {available && (
<FooterColumn title="Contact" requiresJs> <FooterColumn
title={t('site.footer.contactTitle')}
requiresJs
>
{address === null ? ( {address === null ? (
// Even hoog als FooterLink (44px onder lg, daarna // Even hoog als FooterLink (44px onder lg, daarna
// een tekstregel), zodat de kolom niet verspringt // een tekstregel), zodat de kolom niet verspringt
@@ -143,7 +147,7 @@ export default function Footer({ content }: FooterProps) {
<Text fontSize="sm" color="ink.soft"> <Text fontSize="sm" color="ink.soft">
{copyrightLine(year)} {copyrightLine(year)}
</Text> </Text>
<chakra.nav aria-label="Footermenu"> <chakra.nav aria-label={t('site.footer.menuLabel')}>
<Flex <Flex
as="ul" as="ul"
listStyleType="none" listStyleType="none"
@@ -1,5 +1,6 @@
import { useEffect, useRef } from 'react'; import { useEffect, useRef } from 'react';
import { Box, Stack } from '@chakra-ui/react'; import { Box, Stack } from '@chakra-ui/react';
import { t } from '@/i18n';
import type { NavMenuEvent } from '@/lib/navMenuState'; import type { NavMenuEvent } from '@/lib/navMenuState';
import { hasChildren, mainNav } from '@/navigation'; import { hasChildren, mainNav } from '@/navigation';
import RouterLink from '../RouterLink'; import RouterLink from '../RouterLink';
@@ -84,7 +85,7 @@ export default function MobileNav({
menu bovenaan beginnen (centreren zou de bovenkant afknippen) */} menu bovenaan beginnen (centreren zou de bovenkant afknippen) */}
<Box marginBlock="auto"> <Box marginBlock="auto">
<NoScriptMenuClose /> <NoScriptMenuClose />
<nav aria-label="Mobiel menu"> <nav aria-label={t('site.nav.mobileLabel')}>
<Stack as="ul" gap={5} listStyleType="none"> <Stack as="ul" gap={5} listStyleType="none">
{mainNav.map((item) => ( {mainNav.map((item) => (
<li key={item.to}> <li key={item.to}>
@@ -1,4 +1,5 @@
import { Box, chakra, Flex } from '@chakra-ui/react'; import { Box, chakra, Flex } from '@chakra-ui/react';
import { t } from '@/i18n';
import { isSectionCurrent } from '@/lib/navCurrent'; import { isSectionCurrent } from '@/lib/navCurrent';
import type { NavMenuEvent } from '@/lib/navMenuState'; import type { NavMenuEvent } from '@/lib/navMenuState';
import type { NavItem } from '@/navigation'; import type { NavItem } from '@/navigation';
@@ -50,7 +51,7 @@ export default function MobileNavGroup({
data-requires-js data-requires-js
aria-expanded={open} aria-expanded={open}
aria-controls={id} aria-controls={id}
aria-label={`Submenu ${item.label}`} aria-label={t('site.nav.submenu', { name: item.label })}
data-open={open || undefined} data-open={open || undefined}
display="flex" display="flex"
alignItems="center" alignItems="center"
@@ -1,6 +1,7 @@
import { useRef, type RefObject } from 'react'; import { useRef, type RefObject } from 'react';
import { Box, chakra } from '@chakra-ui/react'; import { Box, chakra } from '@chakra-ui/react';
import useDismiss from '@/hooks/useDismiss'; import useDismiss from '@/hooks/useDismiss';
import { t } from '@/i18n';
import { isSectionCurrent } from '@/lib/navCurrent'; import { isSectionCurrent } from '@/lib/navCurrent';
import type { NavMenuEvent } from '@/lib/navMenuState'; import type { NavMenuEvent } from '@/lib/navMenuState';
import type { NavItem } from '@/navigation'; import type { NavItem } from '@/navigation';
@@ -84,7 +85,7 @@ export default function NavSubmenu({
data-requires-js data-requires-js
aria-expanded={open} aria-expanded={open}
aria-controls={id} aria-controls={id}
aria-label={`Submenu ${item.label}`} aria-label={t('site.nav.submenu', { name: item.label })}
data-open={open || undefined} data-open={open || undefined}
display="flex" display="flex"
alignItems="center" alignItems="center"
@@ -15,6 +15,7 @@ import RouterLink from '../RouterLink';
import usePageLoaded from '@/hooks/usePageLoaded'; import usePageLoaded from '@/hooks/usePageLoaded';
import useScrolledPast from '@/hooks/useScrolledPast'; import useScrolledPast from '@/hooks/useScrolledPast';
import { HEADER_ID, MOBILE_NAV_ID } from '../NoScript/noScriptCss'; import { HEADER_ID, MOBILE_NAV_ID } from '../NoScript/noScriptCss';
import { t } from '@/i18n';
import { isSectionCurrent } from '@/lib/navCurrent'; import { isSectionCurrent } from '@/lib/navCurrent';
import { initialNavMenuState, navMenuReducer } from '@/lib/navMenuState'; import { initialNavMenuState, navMenuReducer } from '@/lib/navMenuState';
import { useEffect, useReducer, useRef } from 'react'; import { useEffect, useReducer, useRef } from 'react';
@@ -110,7 +111,7 @@ export default function NavigationBar() {
> >
<RouterLink <RouterLink
to="/" to="/"
aria-label="Andrea Slop Fotografie, naar de homepage" aria-label={t('site.nav.logoLink')}
data-testid="nav-logo-link" data-testid="nav-logo-link"
display="block" display="block"
flexBasis="auto" flexBasis="auto"
@@ -152,7 +153,7 @@ export default function NavigationBar() {
/> />
</RouterLink> </RouterLink>
<chakra.nav <chakra.nav
aria-label="Hoofdmenu" aria-label={t('site.nav.mainLabel')}
flexBasis="100%" flexBasis="100%"
flexGrow={0} flexGrow={0}
flexShrink={1} flexShrink={1}
@@ -213,8 +214,8 @@ export default function NavigationBar() {
} }
aria-label={ aria-label={
state.menuOpen state.menuOpen
? 'Menu sluiten' ? t('site.nav.menuClose')
: 'Menu openen' : t('site.nav.menuOpen')
} }
aria-expanded={state.menuOpen} aria-expanded={state.menuOpen}
aria-controls={MOBILE_NAV_ID} aria-controls={MOBILE_NAV_ID}
@@ -1,3 +1,4 @@
import { t } from '@/i18n';
import { HEADER_ID, MOBILE_NAV_ID } from '../NoScript/noScriptCss'; import { HEADER_ID, MOBILE_NAV_ID } from '../NoScript/noScriptCss';
// Menu links for a visitor without JavaScript. Plain elements: a browser with // Menu links for a visitor without JavaScript. Plain elements: a browser with
@@ -9,7 +10,7 @@ export function NoScriptMenuOpen() {
<a <a
className="ns-menu-open" className="ns-menu-open"
href={`#${MOBILE_NAV_ID}`} href={`#${MOBILE_NAV_ID}`}
aria-label="Menu openen" aria-label={t('site.nav.menuOpen')}
data-testid="nav-noscript-open" data-testid="nav-noscript-open"
> >
<span aria-hidden="true" /> <span aria-hidden="true" />
@@ -28,7 +29,7 @@ export function NoScriptMenuClose() {
href={`#${HEADER_ID}`} href={`#${HEADER_ID}`}
data-testid="nav-noscript-close" data-testid="nav-noscript-close"
> >
Menu sluiten {t('site.nav.menuClose')}
</a> </a>
</noscript> </noscript>
); );
+10 -7
View File
@@ -1,31 +1,34 @@
import { t } from '../i18n/index.ts';
import type { SiteContent } from './types'; import type { SiteContent } from './types';
// Site-brede content tot de CMS-API er is. Daarna komt dit object uit de API. // Site-brede content tot de CMS-API er is. Daarna komt dit object uit de API.
const siteContent: SiteContent = { const siteContent: SiteContent = {
// Elke zin op een eigen regel; de footer toont de regelafbreking // Elke zin op een eigen regel; de footer toont de regelafbreking
footerIntro: footerIntro: t('site.info.footerIntro'),
'Lifestyle fotograaf uit Huizen.\nIk leg jouw mooiste momenten vast.',
// In display order: Instagram first, her main channel // In display order: Instagram first, her main channel
socials: [ socials: [
{ {
platform: 'instagram', platform: 'instagram',
href: 'https://www.instagram.com/andreaslopfotografie/', href: 'https://www.instagram.com/andreaslopfotografie/',
label: '@andreaslopfotografie', label: t('site.socials.instagramHandle'),
}, },
{ {
platform: 'facebook', platform: 'facebook',
href: 'https://www.facebook.com/andreaslopfotografie/', href: 'https://www.facebook.com/andreaslopfotografie/',
label: 'Andrea Slop Fotografie', label: t('common.site.name'),
}, },
], ],
email: { user: 'info', domain: 'andreaslop.nl' }, email: { user: 'info', domain: 'andreaslop.nl' },
// Switched on once the API can receive the form // Switched on once the API can receive the form
contactForm: { enabled: true, replyTime: '1-2 werkdagen' }, contactForm: { enabled: true, replyTime: t('site.info.replyTime') },
// Huizen and the region around it (Bussum, Hilversum, …), as the pages // Huizen and the region around it (Bussum, Hilversum, …), as the pages
// say; not the whole country, which would weaken the local signal // say; not the whole country, which would weaken the local signal
serviceArea: [ serviceArea: [
{ type: 'City', name: 'Huizen' }, { type: 'City', name: t('site.info.serviceArea.city') },
{ type: 'AdministrativeArea', name: 'Gooi en Vechtstreek' }, {
type: 'AdministrativeArea',
name: t('site.info.serviceArea.region'),
},
], ],
}; };
+3 -2
View File
@@ -1,11 +1,12 @@
import facebookFilled from '@iconify-icons/ant-design/facebook-filled'; import facebookFilled from '@iconify-icons/ant-design/facebook-filled';
import instagramFilled from '@iconify-icons/ant-design/instagram-filled'; import instagramFilled from '@iconify-icons/ant-design/instagram-filled';
import { t } from '../i18n/index.ts';
// Vaste set ondersteunde platforms. De icon-data zit in de build, dus er gaat // Vaste set ondersteunde platforms. De icon-data zit in de build, dus er gaat
// geen request naar de Iconify API. Het CMS levert alleen de links aan. // geen request naar de Iconify API. Het CMS levert alleen de links aan.
const socialPlatforms = { const socialPlatforms = {
facebook: { name: 'Facebook', icon: facebookFilled }, facebook: { name: t('site.socials.facebook'), icon: facebookFilled },
instagram: { name: 'Instagram', icon: instagramFilled }, instagram: { name: t('site.socials.instagram'), icon: instagramFilled },
}; };
export type SocialPlatform = keyof typeof socialPlatforms; export type SocialPlatform = keyof typeof socialPlatforms;
+44 -1
View File
@@ -1 +1,44 @@
{} {
"nav": {
"items": {
"home": "Home",
"about": "Over mij",
"portfolio": "Portfolio",
"shoots": "Soorten fotoshoots",
"contact": "Contact",
"privacy": "Privacyverklaring"
},
"logoLink": "Andrea Slop Fotografie, naar de homepage",
"mainLabel": "Hoofdmenu",
"mobileLabel": "Mobiel menu",
"menuOpen": "Menu openen",
"menuClose": "Menu sluiten",
"submenu": "Submenu {name}"
},
"footer": {
"socialsTitle": "Socials",
"contactTitle": "Contact",
"menuLabel": "Footermenu",
"copyright": "© {year} Andrea Slop Fotografie"
},
"breadcrumb": {
"separator": "/"
},
"info": {
"footerIntro": "Lifestyle fotograaf uit Huizen.\nIk leg jouw mooiste momenten vast.",
"replyTime": "1-2 werkdagen",
"serviceArea": {
"city": "Huizen",
"region": "Gooi en Vechtstreek"
},
"mail": {
"subjectPackage": "Aanvraag fotoshoot: {packageName}",
"subjectGeneral": "Vraag via andreaslop.nl"
}
},
"socials": {
"facebook": "Facebook",
"instagram": "Instagram",
"instagramHandle": "@andreaslopfotografie"
}
}
+3 -1
View File
@@ -1,4 +1,6 @@
import { t } from '../i18n/index.ts';
// Copyrightregel in de onderste footerbalk (BR-FOOT-02) // Copyrightregel in de onderste footerbalk (BR-FOOT-02)
export function copyrightLine(year: number): string { export function copyrightLine(year: number): string {
return `© ${year} Andrea Slop Fotografie`; return t('site.footer.copyright', { year });
} }
+4 -2
View File
@@ -1,9 +1,11 @@
import { t } from '../i18n/index.ts';
// Subject of a mail from the site: the package when the visitor came via a // Subject of a mail from the site: the package when the visitor came via a
// "Boek ..." link, otherwise a general one (BR-MAIL-01) // "Boek ..." link, otherwise a general one (BR-MAIL-01)
export function mailSubject(packageName?: string): string { export function mailSubject(packageName?: string): string {
return packageName return packageName
? `Aanvraag fotoshoot: ${packageName}` ? t('site.info.mail.subjectPackage', { packageName })
: 'Vraag via andreaslop.nl'; : t('site.info.mail.subjectGeneral');
} }
export function mailtoLink(address: string, subject: string): string { export function mailtoLink(address: string, subject: string): string {
+10 -9
View File
@@ -1,4 +1,5 @@
import shootTypes from './content/shootTypes.ts'; import shootTypes from './content/shootTypes.ts';
import { t } from './i18n/index.ts';
import { shootNavItems } from './lib/shootNavItems.ts'; import { shootNavItems } from './lib/shootNavItems.ts';
import type { FileRoutesByTo } from './routeTree.gen.ts'; import type { FileRoutesByTo } from './routeTree.gen.ts';
@@ -23,22 +24,22 @@ export function hasChildren(
// Hoofdmenu: desktopnavigatie en mobiel menu // Hoofdmenu: desktopnavigatie en mobiel menu
export const mainNav: readonly NavItem[] = [ export const mainNav: readonly NavItem[] = [
{ to: '/', label: 'Home' }, { to: '/', label: t('site.nav.items.home') },
{ to: '/over-mij', label: 'Over mij' }, { to: '/over-mij', label: t('site.nav.items.about') },
{ to: '/portfolio', label: 'Portfolio' }, { to: '/portfolio', label: t('site.nav.items.portfolio') },
{ {
to: '/soorten-fotoshoots', to: '/soorten-fotoshoots',
label: 'Soorten fotoshoots', label: t('site.nav.items.shoots'),
// One source: a new shoot type shows up in the menu by itself (D5) // One source: a new shoot type shows up in the menu by itself (D5)
children: shootNavItems(shootTypes), children: shootNavItems(shootTypes),
}, },
{ to: '/contact', label: 'Contact' }, { to: '/contact', label: t('site.nav.items.contact') },
]; ];
// Menu in de onderste footerbalk // Menu in de onderste footerbalk
export const footerNav: readonly NavItem[] = [ export const footerNav: readonly NavItem[] = [
{ to: '/portfolio', label: 'Portfolio' }, { to: '/portfolio', label: t('site.nav.items.portfolio') },
{ to: '/soorten-fotoshoots', label: 'Soorten fotoshoots' }, { to: '/soorten-fotoshoots', label: t('site.nav.items.shoots') },
{ to: '/contact', label: 'Contact' }, { to: '/contact', label: t('site.nav.items.contact') },
{ to: '/privacyverklaring', label: 'Privacyverklaring' }, { to: '/privacyverklaring', label: t('site.nav.items.privacy') },
]; ];