export type CvLang = 'en' | 'de' const TEXT = { en: { experience: 'Experience', education: 'Education', today: 'today', grade: 'Grade', year: ['year', 'years'], month: ['month', 'months'], loadError: 'The CV could not be loaded', empty: 'Nothing here yet.', photo: 'Profile picture', savePdf: 'Save as PDF', types: { 'Part-time': 'Part-time', 'Student': 'Student', 'Pupil': 'Pupil', 'Working Student': 'Working Student', 'Volunteer': 'Volunteer' } }, de: { experience: 'Erfahrung', education: 'Ausbildung', today: 'heute', grade: 'Note', year: ['Jahr', 'Jahre'], month: ['Monat', 'Monate'], loadError: 'Der Lebenslauf konnte nicht geladen werden', empty: 'Noch nichts hier.', photo: 'Profilbild', savePdf: 'Als PDF speichern', types: { 'Part-time': 'Teilzeit', 'Student': 'Studium', 'Pupil': 'Schule', 'Working Student': 'Werkstudent', 'Volunteer': 'Freiwilligendienst' } } } satisfies Record export type CvText = typeof TEXT.en /** The CV's language, remembered in a cookie so the server renders the same one */ export function useCvLang() { const lang = useCookie('cv-lang', { default: () => 'de', maxAge: 60 * 60 * 24 * 365, sameSite: 'lax' }) return { lang, t: computed(() => TEXT[lang.value] ?? TEXT.de) } }