Files
o2o-infinith-demo/templates/supporters-astro/src/lib/i18n.ts
T
Haewon KamandClaude Sonnet 5 c0804dd2bd feat(supporters): 서포터즈 사이트 초안 표시를 눈에 띄게 강화
기존 상단 띠 배너("샘플 사이트입니다")는 스크롤하면 사라져 병원이
둘러보는 동안에는 초안인지 최종본인지 판단이 서지 않았다.

- sticky 헤더 안에 "초안" 배지 추가(스크롤해도 계속 보임), 영문판도 동일
- 문구를 "샘플 사이트입니다"에서 상태 중심으로 변경:
  "초안입니다. 검색에 노출되지 않으며, 병원 확인 전입니다."
- 띠 배너 글자 크기·굵기 상향(0.83rem/500 → 0.95rem/600)
- 인쇄 시 배지 숨김(기존 배너 규칙과 동일하게)
- INDEXABLE=true(공개본)에서는 배너·배지 모두 그대로 뜨지 않음

templates/supporters-astro(정본)와 supporters/(현재 작업 사본) 양쪽에
동일하게 반영. 이미 배포된 서포터즈 사이트(예: supporters-jkplastic)에는
재빌드·재배포 전까지 적용되지 않는다.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-21 10:27:26 +09:00

54 lines
3.9 KiB
TypeScript

// 사이트 공통(헤더·푸터·배너) 문자열과 언어 전환 규칙. 페이지 본문은 각 페이지가 맡고, 이 모듈은 Base.astro 가 쓴다.
// 언어 전환은 전역 하나(헤더)로만 한다. 페이지마다 따로 토글을 두지 않는다 (haewon 결정, 2026-09-10).
export type Lang = 'ko' | 'en';
/** 한국어 경로 ↔ 영어 경로. 영어판이 없는 한국어 페이지는 영어 홈으로, 반대는 한국어 홈으로 보낸다. */
const PAIRS: [string, string][] = [
['/', '/en'],
['/plan', '/en/plan'],
['/stay', '/en/stay'],
];
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<Lang, Record<string, string>> = {
ko: {
sample: '초안입니다. 검색에 노출되지 않으며, 병원 확인 전입니다.',
draftBadge: '초안',
draftBadgeAria: '이 사이트는 초안입니다. 검색에 노출되지 않습니다.',
brand: '서포터즈',
nav_posts: '상담 전 질문', nav_videos: '의료진 영상', nav_news: '뉴스룸', nav_stay: '주변 안내', 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: 'Draft. Not indexed by search engines, and not yet confirmed by the clinic.',
draftBadge: 'Draft',
draftBadgeAria: 'This site is a draft and is not indexed by search engines.',
brand: 'Supporters',
nav_home: 'Home', nav_stay: 'Nearby', 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',
},
};