Bundle data was carrying localized strings (name, usage, items, description, imageAlt, badge) directly, so EN visitors saw German copy on the bundle page and home grid. Strings are now keyed under bundle.<id>.<field> in the i18n catalogue (DE + EN); src/api/bundles.js keeps only structural data + i18n key references. HomePage builds a localizedBundles computed that resolves the keys through t() before passing to the Bundles design-system component, so the existing component stays agnostic of i18n. BundlePage exposes a `bundleCopy` computed for the same reason, and resolvedItems now maps over `itemKeys` instead of static labels. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 line
5.7 KiB
JavaScript
1 line
5.7 KiB
JavaScript
import{A as e,B as t,C as n,G as r,T as i,c as a,ft as o,j as s,l as c,m as l,o as u,p as d,r as f,s as p,u as m}from"./runtime-core.esm-bundler-DTXUv7Wx.js";import{t as h}from"./runtime-dom.esm-bundler-CXLmyuFK.js";import{a as g,n as _,t as v}from"./vue-router-Cyqru1db.js";import{t as y}from"./Logo-K2VN1F6l.js";import{t as b}from"./Icon-BCo6-bGH.js";import{t as x}from"./IconButton-Cw1KbfUO.js";import{t as ee}from"./i18n-XDSWEyNo.js";import{t as S}from"./LanguageSwitcher-BeyDSAjE.js";import{t as C}from"./_plugin-vue_export-helper-0vLWKQyu.js";var w={class:`h-screen flex bg-surface text-ink overflow-hidden`},T={class:`hidden lg:flex w-[260px] shrink-0 border-r border-line bg-paper flex-col`},E={class:`px-6 py-6 border-b border-line`},D={class:`eyebrow mt-3`},O={class:`flex-1 overflow-y-auto px-3 py-5 space-y-6`},k={class:`eyebrow px-3 mb-2`},A={class:`flex flex-col gap-0.5`},j={class:`px-6 py-4 border-t border-line`},M={class:`flex-1 overflow-y-auto pb-20 lg:pb-0`},N=[`aria-expanded`],P={class:`flex flex-col min-w-0`},F={class:`eyebrow`},I={class:`truncate text-[15px] font-semibold text-ink`},te={class:`inline-flex items-center justify-center w-10 h-10 rounded-pill bg-brand-wash text-brand shrink-0`},L=[`aria-label`],R={class:`shrink-0 flex items-center justify-between px-5 pt-3 pb-3 border-b border-line`},z={class:`flex flex-col`},B={class:`eyebrow`},V={class:`text-[15px] font-semibold`},H={class:`flex-1 overflow-y-auto px-3 py-4 space-y-6`},U={class:`eyebrow px-3 mb-2`},W={class:`flex flex-col gap-0.5`},G={class:`px-3 pt-3 border-t border-line`},K=C({__name:`DesignLayout`,setup(C){let{t:K}=ee(),q=g(),J=u(()=>[{title:K(`ds.sidebar.brand`),items:[{name:`ds-logo`,label:K(`ds.nav.logo`)}]},{title:K(`ds.sidebar.tokens`),items:[{name:`ds-colors`,label:K(`ds.nav.colors`)},{name:`ds-typography`,label:K(`ds.nav.typography`)},{name:`ds-radii`,label:K(`ds.nav.radii`)},{name:`ds-shadows`,label:K(`ds.nav.shadows`)},{name:`ds-motion`,label:K(`ds.nav.motion`)}]},{title:K(`ds.sidebar.components`),items:[{name:`ds-icons`,label:K(`ds.nav.icons`)},{name:`ds-buttons`,label:K(`ds.nav.buttons`)},{name:`ds-badges`,label:K(`ds.nav.badges`)},{name:`ds-inputs`,label:K(`ds.nav.inputs`)},{name:`ds-cards`,label:K(`ds.nav.cards`)},{name:`ds-products`,label:K(`ds.nav.products`)},{name:`ds-bundle-card`,label:K(`ds.nav.bundleCard`)},{name:`ds-hero`,label:K(`ds.nav.hero`)},{name:`ds-navbar`,label:K(`ds.nav.navbar`)},{name:`ds-search`,label:K(`ds.nav.search`)},{name:`ds-quantity-stepper`,label:K(`ds.nav.qtyStepper`)},{name:`ds-cart-drawer`,label:K(`ds.nav.cartDrawer`)},{name:`ds-checkout-stepper`,label:K(`ds.nav.checkoutStepper`)},{name:`ds-language`,label:K(`ds.nav.language`)}]},{title:K(`ds.sidebar.sections`),items:[{name:`ds-bundles`,label:K(`ds.nav.bundles`)},{name:`ds-revitalization`,label:K(`ds.nav.revitalization`)},{name:`ds-about`,label:K(`ds.nav.about`)},{name:`ds-footer`,label:K(`ds.nav.footer`)}]}]),Y=u(()=>J.value.flatMap(e=>e.items)),X=u(()=>{let e=Y.value.find(e=>e.name===q.name);return e?e.label:K(`ds.eyebrow.designSystem`)}),Z=t(!1);function Q(){Z.value=!0}function $(){Z.value=!1}return e(()=>q.name,$),(e,t)=>(n(),m(`div`,w,[p(`aside`,T,[p(`div`,E,[l(r(v),{to:`/`,class:`block text-brand`,"aria-label":`Kaiser Natron home`},{default:s(()=>[l(y,{class:`w-16 h-auto`})]),_:1}),p(`p`,D,o(r(K)(`ds.eyebrow.designSystem`)),1)]),p(`nav`,O,[(n(!0),m(f,null,i(J.value,e=>(n(),m(`div`,{key:e.title},[p(`p`,k,o(e.title),1),p(`div`,A,[(n(!0),m(f,null,i(e.items,e=>(n(),a(r(v),{key:e.name,to:{name:e.name},class:`px-3 py-2 rounded-sm text-[14px] font-medium text-muted hover:text-brand hover:bg-brand-wash transition-colors`,"active-class":`!text-brand !bg-brand-soft-wash`},{default:s(()=>[d(o(e.label),1)]),_:2},1032,[`to`]))),128))])]))),128))]),p(`div`,j,[l(r(v),{to:`/`,class:`text-[13px] text-muted hover:text-brand transition-colors`},{default:s(()=>[d(o(r(K)(`ds.sidebar.back`)),1)]),_:1})])]),p(`main`,M,[l(r(_))]),p(`button`,{type:`button`,class:`lg:hidden fixed bottom-0 inset-x-0 z-40 flex items-center justify-between gap-3 px-5 py-3 bg-paper border-t border-line text-left shadow-[0_-4px_16px_rgba(28,58,40,0.06)]`,"aria-expanded":Z.value,"aria-controls":`ds-mobile-sheet`,onClick:Q},[p(`span`,P,[p(`span`,F,o(r(K)(`ds.mobile.currentPage`)),1),p(`span`,I,o(X.value),1)]),p(`span`,te,[l(b,{name:`chevron-up`,size:20,label:r(K)(`ds.mobile.selectPage`)},null,8,[`label`])])],8,N),l(h,{name:`ds-backdrop`},{default:s(()=>[Z.value?(n(),m(`div`,{key:0,class:`lg:hidden fixed inset-0 z-50 bg-ink/40`,onClick:$})):c(``,!0)]),_:1}),l(h,{name:`ds-sheet`},{default:s(()=>[Z.value?(n(),m(`aside`,{key:0,id:`ds-mobile-sheet`,role:`dialog`,"aria-modal":`true`,"aria-label":r(K)(`ds.mobile.selectPage`),class:`lg:hidden fixed bottom-0 inset-x-0 z-50 h-[50svh] bg-paper border-t border-line rounded-t-xl flex flex-col shadow-[0_-12px_32px_rgba(28,58,40,0.18)]`},[p(`div`,R,[p(`span`,z,[p(`span`,B,o(r(K)(`ds.eyebrow.designSystem`)),1),p(`span`,V,o(r(K)(`ds.mobile.selectPage`)),1)]),l(x,{icon:`close`,variant:`ghost`,size:`xs`,"icon-size":22,"aria-label":r(K)(`menu.close`),onClick:$},null,8,[`aria-label`])]),p(`nav`,H,[(n(!0),m(f,null,i(J.value,e=>(n(),m(`div`,{key:e.title},[p(`p`,U,o(e.title),1),p(`div`,W,[(n(!0),m(f,null,i(e.items,e=>(n(),a(r(v),{key:e.name,to:{name:e.name},class:`px-3 py-2.5 rounded-sm text-[15px] font-medium text-muted hover:text-brand hover:bg-brand-wash transition-colors`,"active-class":`!text-brand !bg-brand-soft-wash`},{default:s(()=>[d(o(e.label),1)]),_:2},1032,[`to`]))),128))])]))),128)),p(`div`,G,[l(r(v),{to:`/`,class:`inline-block text-[14px] text-muted hover:text-brand transition-colors`},{default:s(()=>[d(o(r(K)(`ds.sidebar.back`)),1)]),_:1})])])],8,L)):c(``,!0)]),_:1}),l(S,{floating:``})]))}},[[`__scopeId`,`data-v-bbee6d71`]]);export{K as default}; |