Files
kaiser-natron/dist/assets/LanguageSwitcher-BeyDSAjE.js
Dorian 0c9a0ccd95 bundles: locale-aware copy via i18n keys
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>
2026-05-04 11:02:46 +01:00

1 line
1.3 KiB
JavaScript

import{C as e,G as t,T as n,ft as r,o as i,r as a,u as o,ut as s}from"./runtime-core.esm-bundler-DTXUv7Wx.js";import{t as c}from"./i18n-XDSWEyNo.js";var l=[`aria-label`,`aria-pressed`,`onClick`],u={__name:`LanguageSwitcher`,props:{floating:{type:Boolean,default:!1},tone:{type:String,default:`paper`,validator:e=>[`paper`,`cream`,`brand`].includes(e)}},setup(u){let d=u,{locale:f,setLocale:p,availableLocales:m}=c(),h={paper:{container:`border border-line bg-paper`,active:`bg-brand text-accent`,inactive:`text-muted hover:text-brand`},cream:{container:`border border-line-strong bg-paper`,active:`bg-brand text-accent`,inactive:`text-muted hover:text-brand`},brand:{container:`border border-cream-line bg-cream-wash`,active:`bg-accent text-brand`,inactive:`text-cream hover:text-accent`}},g=i(()=>h[d.tone]);return(i,c)=>(e(),o(`div`,{role:`group`,"aria-label":`Language`,class:s([`inline-flex items-center h-10 px-2 gap-0.5 rounded-pill font-sans`,g.value.container,u.floating?`fixed top-6 right-6 z-[60] shadow-sm`:``])},[(e(!0),o(a,null,n(t(m),n=>(e(),o(`button`,{key:n.code,type:`button`,"aria-label":n.name,"aria-pressed":t(f)===n.code,class:s([`px-2.5 py-1 text-[11px] font-bold tracking-eyebrow rounded-pill transition-colors duration-base`,t(f)===n.code?g.value.active:g.value.inactive]),onClick:e=>t(p)(n.code)},r(n.label),11,l))),128))],2))}};export{u as t};