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>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user