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