// 사이트 공통(헤더·푸터·배너) 문자열과 언어 전환 규칙. 페이지 본문은 각 페이지가 맡고, 이 모듈은 Base.astro 가 쓴다. // 언어 전환은 전역 하나(헤더)로만 한다. 페이지마다 따로 토글을 두지 않는다 (haewon 결정, 2026-09-10). export type Lang = 'ko' | 'en'; /** 한국어 경로 ↔ 영어 경로. 영어판이 없는 한국어 페이지는 영어 홈으로, 반대는 한국어 홈으로 보낸다. */ const PAIRS: [string, string][] = [ ['/', '/en'], ['/plan', '/en/plan'], ]; export function switchHref(pathname: string, to: Lang): string { const p = pathname.replace(/\/index\.html$/, '/').replace(/\.html$/, '').replace(/\/$/, '') || '/'; for (const [ko, en] of PAIRS) { if (to === 'en' && p === ko) return en; if (to === 'ko' && p === en) return ko; } return to === 'en' ? '/en' : '/'; } export const isEnPath = (pathname: string): boolean => /^\/en(\/|\.html$|$)/.test(pathname); export const UI: Record> = { ko: { sample: '샘플 사이트입니다. 정식 공개 전입니다.', brand: '서포터즈', nav_posts: '상담 전 질문', nav_videos: '의료진 영상', nav_news: '뉴스룸', nav_visit: '방문 안내', nav_plan: '회복 일정', nav_about: '매체 소개', cta: '상담 예약', back: '이전 페이지', backAria: '이전 페이지로 돌아가기', totop: '맨 위로', switchLabel: 'EN', switchAria: 'Switch to English', foot_sponsor: '이 매체는 {clinic}의 지원을 받아 서포터즈가 운영합니다. 글의 의학적 내용은 {clinic} 담당 원장의 검토를 거쳐 표시하며, 검토 전 글은 "의학 검토 대기"로 표시합니다. 편집 책임 {editor}.', foot_clinic: '병원 정보', foot_visit: '방문 안내', foot_plan: '회복 일정', foot_about: '이 사이트에 대해', foot_corrections: '정정 기록', foot_request: '정정 요청', foot_editorial: '편집 기준 (운영자용)', foot_phone: '전화', foot_fax: '팩스', foot_rep: '대표', foot_biz: '사업자등록번호', foot_site: '공식 홈페이지', foot_youtube: '유튜브', foot_gu: '강남언니', }, en: { sample: 'Sample site. Not yet public.', brand: 'Supporters', nav_home: 'Home', nav_plan: 'Recovery Planner', nav_visit: 'Getting Here', nav_clinic: 'Clinic Facts', nav_korean: '한국어 전체 보기', cta: 'Book a consultation', back: 'Back', backAria: 'Go back to the previous page', totop: 'Back to top', switchLabel: 'KO', switchAria: '한국어로 보기', // 아래 영문 foot_sponsor · foot_side 는 병원이 확정한 문구가 아니라 푸터 고지에 쓰지 않는다. // 고지는 Base.astro 가 site.json 의 sponsorNoticeEn · factSheet 의 sideEffectNoticeEn 에서 읽고, 없으면 한국어 원문에 확인 대기 표기를 붙인다. foot_sponsor: 'This site is run by supporters with support from {clinic}. Medical content is reviewed by the clinic\'s attending surgeon before it is marked as reviewed. Editor in charge: {editor}.', foot_side: 'After surgery, side effects such as inflammation, bleeding or nerve damage may occur depending on the individual.', foot_clinic: 'Clinic facts', foot_visit: 'Getting here', foot_plan: 'Recovery planner', foot_about: 'About this site (Korean)', foot_corrections: 'Corrections (Korean)', foot_request: 'Request a correction', foot_editorial: '', foot_phone: 'Tel', foot_fax: 'Fax', foot_rep: 'Representative', foot_biz: 'Business no.', foot_site: 'Official website (English)', foot_youtube: 'YouTube', foot_gu: 'Gangnam Unni', }, };