i18n (KO/EN), square flags, score→outcome auto, copy & legal fixes
- E. 영문 페이지: lib/i18n.ts(KO/EN 사전) + ?lang 스위치(LangSwitch, AI Prediction Arena 우측, 화이트 활성) + 전 컴포넌트 i18n. World Cup 2026(영문 연도 후행), 영문 AI 근거/날짜/카운트다운 단위 - A. "글로벌 축구"→"2026 월드컵"(Hero 알약·meta), 영문은 World Cup 2026 - B. Crowd Pick 설명 문구 삭제 - C. 국기 찌그러짐 수정(이모지 cqh 비례, CZE 비율보존) + 라운드 제거→사각형 - D. 점수 선택 시 승/무/패 자동 선택(useEffect) - F. 인트로 카피 "가장 정확하게 예측한 … 100만원 상금" - MatchupHUD 상단 진행 바(roundLabel→Final) 삭제 - 푸터: "Not official" 모호 → FIFA·공식 월드컵 비제휴 명시(KO/EN) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
1 parent
c66812d954
commit
a8de6c858d
16 files changed
+504
-199
No files matched your search
+20
-21
@@ -1,31 +1,32 @@
|
||||
import type { Outcome, Match, AIPrediction, Team } from "./types";
|
||||
import { type Lang, teamShort, dayName, monthEn, dict } from "./i18n";
|
||||
|
||||
export function outcomeLabel(match: Match, o: Outcome): string {
|
||||
if (o === "TEAM_A_WIN") return `${match.teamA.shortName} 승`;
|
||||
if (o === "TEAM_B_WIN") return `${match.teamB.shortName} 승`;
|
||||
return "무승부";
|
||||
export function outcomeLabel(match: Match, o: Outcome, lang: Lang = "ko"): string {
|
||||
const d = dict(lang);
|
||||
if (o === "TEAM_A_WIN") return `${teamShort(match.teamA, lang)} ${d.win}`;
|
||||
if (o === "TEAM_B_WIN") return `${teamShort(match.teamB, lang)} ${d.win}`;
|
||||
return d.drawLabel;
|
||||
}
|
||||
|
||||
// D3: 확률 = "이긴다고 예측한 팀의 승리 확률". 무승부 예측이면 "무승부 가능성".
|
||||
// D3: 확률 = 이긴다고 예측한 팀의 승리 확률. 라벨은 호출부에서 dict로 구성.
|
||||
export function winProb(
|
||||
match: Match,
|
||||
p: Pick<AIPrediction, "outcome" | "confidencePct">,
|
||||
): { team: Team | null; label: string; pct: number } {
|
||||
if (p.outcome === "TEAM_A_WIN")
|
||||
return { team: match.teamA, label: `${match.teamA.shortName} 승리 확률`, pct: p.confidencePct };
|
||||
if (p.outcome === "TEAM_B_WIN")
|
||||
return { team: match.teamB, label: `${match.teamB.shortName} 승리 확률`, pct: p.confidencePct };
|
||||
return { team: null, label: "무승부 가능성", pct: p.confidencePct };
|
||||
): { team: Team | null; pct: number } {
|
||||
if (p.outcome === "TEAM_A_WIN") return { team: match.teamA, pct: p.confidencePct };
|
||||
if (p.outcome === "TEAM_B_WIN") return { team: match.teamB, pct: p.confidencePct };
|
||||
return { team: null, pct: p.confidencePct };
|
||||
}
|
||||
|
||||
// "6월 12일 (금)" — 대시보드 날짜 그룹 헤더
|
||||
export function dateHeading(iso: string): string {
|
||||
const days = ["일", "월", "화", "수", "목", "금", "토"];
|
||||
// "6월 12일 (금)" / "Jun 12 (Fri)" — 대시보드 날짜 그룹 헤더
|
||||
export function dateHeading(iso: string, lang: Lang = "ko"): string {
|
||||
const dm = iso.match(/(\d{4})-(\d{2})-(\d{2})/);
|
||||
if (!dm) return iso;
|
||||
const [, y, mo, d] = dm;
|
||||
const dow = days[new Date(Date.UTC(+y, +mo - 1, +d)).getUTCDay()];
|
||||
return `${+mo}월 ${+d}일 (${dow})`;
|
||||
const dow = dayName(lang, new Date(Date.UTC(+y, +mo - 1, +d)).getUTCDay());
|
||||
return lang === "en"
|
||||
? `${monthEn(+mo)} ${+d} (${dow})`
|
||||
: `${+mo}월 ${+d}일 (${dow})`;
|
||||
}
|
||||
|
||||
// "11:00" — 경기 카드 시간
|
||||
@@ -40,14 +41,12 @@ export function dateKey(iso: string): string {
|
||||
return m ? m[1] : iso;
|
||||
}
|
||||
|
||||
export function kickoffDisplay(iso: string): string {
|
||||
// iso는 KST(+09:00). 런타임 TZ에 무관하게 ISO 문자열을 직접 파싱한다.
|
||||
const days = ["일", "월", "화", "수", "목", "금", "토"];
|
||||
// "6.12(금) 11:00 KST" — 요일명만 로케일 적용
|
||||
export function kickoffDisplay(iso: string, lang: Lang = "ko"): string {
|
||||
const dm = iso.match(/(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})/);
|
||||
if (!dm) return iso;
|
||||
const [, y, mo, d, hh, mm] = dm;
|
||||
// 요일은 달력 날짜 기준(UTC Date로 계산하면 TZ 무관)
|
||||
const dow = days[new Date(Date.UTC(+y, +mo - 1, +d)).getUTCDay()];
|
||||
const dow = dayName(lang, new Date(Date.UTC(+y, +mo - 1, +d)).getUTCDay());
|
||||
return `${+mo}.${+d}(${dow}) ${hh}:${mm} KST`;
|
||||
}
|
||||
|
||||
|
||||
+203
@@ -0,0 +1,203 @@
|
||||
// 경량 i18n — ?lang=en 쿼리로 한/영 전환. SSG 유지(서버에서 lang 주입).
|
||||
import type { Team } from "./types";
|
||||
|
||||
export type Lang = "ko" | "en";
|
||||
|
||||
export function parseLang(v: unknown): Lang {
|
||||
return v === "en" ? "en" : "ko";
|
||||
}
|
||||
|
||||
// 팀 짧은 표기 (KO=한글, EN=영문 약식)
|
||||
const TEAM_EN: Record<string, string> = {
|
||||
KOR: "Korea",
|
||||
CZE: "Czechia",
|
||||
MEX: "Mexico",
|
||||
RSA: "S. Africa",
|
||||
};
|
||||
export function teamShort(team: Team, lang: Lang): string {
|
||||
return lang === "en" ? TEAM_EN[team.code] ?? team.name : team.shortName;
|
||||
}
|
||||
|
||||
const DAYS: Record<Lang, string[]> = {
|
||||
ko: ["일", "월", "화", "수", "목", "금", "토"],
|
||||
en: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
|
||||
};
|
||||
const MONTHS_EN = ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];
|
||||
|
||||
export function dayName(lang: Lang, dow: number): string {
|
||||
return DAYS[lang][dow];
|
||||
}
|
||||
export function monthEn(m: number): string {
|
||||
return MONTHS_EN[m - 1];
|
||||
}
|
||||
|
||||
// roundLabel 안의 한국어 토막 번역
|
||||
export function roundLabel(label: string, lang: Lang): string {
|
||||
if (lang === "ko") return label;
|
||||
return label.replace("개막전", "Opener");
|
||||
}
|
||||
|
||||
type Dict = {
|
||||
heroPill: string;
|
||||
back: string;
|
||||
share: string;
|
||||
shareCopied: string;
|
||||
introLead: string;
|
||||
prizeLine1: string;
|
||||
prizeLine2: string;
|
||||
schedTitle: string;
|
||||
schedGuide: string;
|
||||
phase: { open: string; scheduled: string; locked: string; finished: string };
|
||||
aiPicks: string;
|
||||
draw: string;
|
||||
joined: (n: string) => string;
|
||||
aiBattle: string;
|
||||
yourPickLabel: string;
|
||||
yourChoice: string;
|
||||
win: string;
|
||||
drawLabel: string;
|
||||
winProb: (team: string) => string;
|
||||
drawOdds: string;
|
||||
ctaBeat: string;
|
||||
ctaResult: string;
|
||||
ctaLocked: string;
|
||||
ctaOpens: (d: string) => string;
|
||||
emailPh: string;
|
||||
notify: string;
|
||||
submit: string;
|
||||
myPick: string;
|
||||
sameAI: (models: string, exact: boolean) => string;
|
||||
soloPick: string;
|
||||
shareThis: string;
|
||||
copyLink: string;
|
||||
copied: string;
|
||||
goldDesc: string;
|
||||
goldBtn: string;
|
||||
crowdSub: string;
|
||||
finalResult: string;
|
||||
hit: string;
|
||||
miss: string;
|
||||
matchEnded: string;
|
||||
cdUntil: string;
|
||||
cdClosed: string;
|
||||
final: string;
|
||||
group: (g: string) => string;
|
||||
footerNotOfficial: string;
|
||||
footerDisc1: string;
|
||||
footerDisc2: string;
|
||||
footerDisc3: string;
|
||||
hook: (a: string, b: string) => string;
|
||||
};
|
||||
|
||||
export const DICT: Record<Lang, Dict> = {
|
||||
ko: {
|
||||
heroPill: "AI와 함께하는 2026 월드컵 승부예측 챌린지",
|
||||
back: "← 전체 일정",
|
||||
share: "투표 공유하기",
|
||||
shareCopied: "링크 복사됨 ✓",
|
||||
introLead: "GPT · Claude · Gemini가 매 경기를\n서로 다르게 예측합니다.",
|
||||
prizeLine1: "가장 많이 참여하고, 가장 정확하게 예측한",
|
||||
prizeLine2: "최종 우승자에게 100만원 상금",
|
||||
schedTitle: "전체 일정",
|
||||
schedGuide: "투표하고 싶은 경기를 선택해주세요",
|
||||
phase: { open: "투표 중", scheduled: "오픈 예정", locked: "투표 마감", finished: "종료" },
|
||||
aiPicks: "AI 픽",
|
||||
draw: "무",
|
||||
joined: (n) => `${n}명 참여`,
|
||||
aiBattle: "AI의 예측 대결",
|
||||
yourPickLabel: "Your Pick · 내 예측",
|
||||
yourChoice: "당신의 선택",
|
||||
win: "승",
|
||||
drawLabel: "무승부",
|
||||
winProb: (t) => `${t} 승리 확률`,
|
||||
drawOdds: "무승부 가능성",
|
||||
ctaBeat: "AI보다 잘 맞히기",
|
||||
ctaResult: "결과 보기",
|
||||
ctaLocked: "예측 마감 (경기 시작)",
|
||||
ctaOpens: (d) => `투표 오픈 ${d}`,
|
||||
emailPh: "이메일 (결과·다음 경기 알림)",
|
||||
notify: "경기 결과가 나오면 알려주세요. 다음 경기·100만원 챌린지 소식도 받겠습니다.",
|
||||
submit: "제출하고 AI와 겨루기",
|
||||
myPick: "내 예측",
|
||||
sameAI: (m, exact) =>
|
||||
`당신은 ${m}와 같은 선택입니다.${exact ? " 스코어까지 일치!" : ""} 나머지 AI는 생각이 다릅니다.`,
|
||||
soloPick: "당신은 AI 셋 모두와 다른 선택! 소신 픽 🔥",
|
||||
shareThis: "이 경기 공유하기",
|
||||
copyLink: "링크 복사",
|
||||
copied: "복사됨 ✓",
|
||||
goldDesc: "경기마다 승패·스코어를 맞혀 포인트를 쌓고, 누적 1위에게 최종 100만원",
|
||||
goldBtn: "100만 원에\n도전하기",
|
||||
crowdSub: "| 참여자들의 선택",
|
||||
finalResult: "최종 결과",
|
||||
hit: "적중 ✓",
|
||||
miss: "빗나감",
|
||||
matchEnded: "경기 종료 · 최종 결과",
|
||||
cdUntil: "투표 종료까지",
|
||||
cdClosed: "투표가 마감되었습니다",
|
||||
final: "Final",
|
||||
group: (g) => `Group ${g}`,
|
||||
footerNotOfficial:
|
||||
"Independent AI prediction game — not affiliated with, endorsed by, or sponsored by FIFA or the official World Cup.",
|
||||
footerDisc1: "FIFA 및 공식 월드컵과 무관한 독립 AI 예측 게임입니다 (제휴·후원·운영 아님).",
|
||||
footerDisc2: "스포츠 분석·엔터테인먼트 목적의 예측 게임이며 베팅·도박을 권유하지 않습니다. AI 예측은 실제 결과를 보장하지 않습니다.",
|
||||
footerDisc3: "100만 원 이벤트는 무료 참여형 챌린지입니다. 지급·동점 처리 조건은 별도 약관에 따릅니다. 이메일은 결과·이벤트 알림 목적으로만 사용됩니다.",
|
||||
hook: (a, b) => `${a} vs ${b}, AI의 선택은 갈렸다`,
|
||||
},
|
||||
en: {
|
||||
heroPill: "AI-powered World Cup 2026 match predictions",
|
||||
back: "← All matches",
|
||||
share: "Share vote",
|
||||
shareCopied: "Link copied ✓",
|
||||
introLead: "GPT · Claude · Gemini predict\nevery match differently.",
|
||||
prizeLine1: "The most active, most accurate",
|
||||
prizeLine2: "overall winner takes ₩1,000,000",
|
||||
schedTitle: "All Matches",
|
||||
schedGuide: "Pick a match to predict",
|
||||
phase: { open: "Voting", scheduled: "Opens soon", locked: "Closed", finished: "Ended" },
|
||||
aiPicks: "AI picks",
|
||||
draw: "Draw",
|
||||
joined: (n) => `${n} joined`,
|
||||
aiBattle: "AI Prediction Battle",
|
||||
yourPickLabel: "Your Pick",
|
||||
yourChoice: "Your Choice",
|
||||
win: "Win",
|
||||
drawLabel: "Draw",
|
||||
winProb: (t) => `${t} win prob.`,
|
||||
drawOdds: "Draw odds",
|
||||
ctaBeat: "Beat the AI",
|
||||
ctaResult: "View result",
|
||||
ctaLocked: "Closed (kickoff)",
|
||||
ctaOpens: (d) => `Opens ${d}`,
|
||||
emailPh: "Email (result & next-match alerts)",
|
||||
notify: "Notify me when the result is out. I'll also get next-match & ₩1,000,000 challenge news.",
|
||||
submit: "Submit & face the AI",
|
||||
myPick: "My Pick",
|
||||
sameAI: (m, exact) =>
|
||||
`You matched ${m}.${exact ? " Exact score too!" : ""} The other AIs disagree.`,
|
||||
soloPick: "You disagree with all three AIs — bold pick 🔥",
|
||||
shareThis: "Share this match",
|
||||
copyLink: "Copy link",
|
||||
copied: "Copied ✓",
|
||||
goldDesc: "Earn points each match by nailing the result & score — the overall #1 wins ₩1,000,000.",
|
||||
goldBtn: "Go for\n₩1,000,000",
|
||||
crowdSub: "| What the crowd picked",
|
||||
finalResult: "Final result",
|
||||
hit: "Hit ✓",
|
||||
miss: "Miss",
|
||||
matchEnded: "Match ended · Final",
|
||||
cdUntil: "Voting closes in",
|
||||
cdClosed: "Voting closed",
|
||||
final: "Final",
|
||||
group: (g) => `Group ${g}`,
|
||||
footerNotOfficial:
|
||||
"Independent AI prediction game — not affiliated with, endorsed by, or sponsored by FIFA or the official World Cup.",
|
||||
footerDisc1: "A fan-run prediction game using public match schedules; all picks are independent.",
|
||||
footerDisc2: "A sports-analysis & entertainment prediction game. No betting or gambling. AI predictions do not guarantee real outcomes.",
|
||||
footerDisc3: "The ₩1,000,000 event is a free-to-enter challenge. Payout & tie-break terms follow separate rules. Email is used only for result & event alerts.",
|
||||
hook: (a, b) => `AI is split on ${a} vs ${b}`,
|
||||
},
|
||||
};
|
||||
|
||||
export function dict(lang: Lang): Dict {
|
||||
return DICT[lang];
|
||||
}
|
||||
+65
-23
@@ -6,6 +6,21 @@
|
||||
// 체코전(FEATURED)은 큐레이션 값, 그 외 경기는 matchId 시드 결정론적 생성 (Math.random 미사용).
|
||||
import type { AIPrediction, CrowdStats, Match, ModelName, Outcome } from "./types";
|
||||
import { FEATURED, GROUP_A } from "./schedule";
|
||||
import { type Lang, teamShort } from "./i18n";
|
||||
|
||||
// 체코전 큐레이션 근거 (KO/EN)
|
||||
const FEATURED_REASONS: Record<Lang, Record<ModelName, string>> = {
|
||||
ko: {
|
||||
GPT: "한국 측면 스피드가 한 끗 위",
|
||||
Claude: "중원 힘싸움이 끝까지 팽팽",
|
||||
Gemini: "체코 역습 한 방이 매섭다",
|
||||
},
|
||||
en: {
|
||||
GPT: "Korea's wing speed edges it",
|
||||
Claude: "A tight midfield battle to the end",
|
||||
Gemini: "Czechia's counter has real bite",
|
||||
},
|
||||
};
|
||||
|
||||
export const MATCH = FEATURED; // 대표 경기 = 한국 vs 체코 (schedule SSOT)
|
||||
|
||||
@@ -74,28 +89,50 @@ const SCORE_BY_OUTCOME: Record<Outcome, [number, number][]> = {
|
||||
TEAM_B_WIN: [[0, 1], [1, 2], [0, 2], [1, 3]],
|
||||
};
|
||||
|
||||
function reasonFor(match: Match, outcome: Outcome, seed: number): string {
|
||||
const A = match.teamA.shortName;
|
||||
const B = match.teamB.shortName;
|
||||
const win = outcome === "TEAM_A_WIN" ? A : outcome === "TEAM_B_WIN" ? B : null;
|
||||
const winPool = win
|
||||
? [
|
||||
`${win} 측면 스피드가 한 끗 위`,
|
||||
`${win} 세트피스 한 방이면 끝`,
|
||||
`${win} 초반 기세에서 앞선다`,
|
||||
`${win} 결정력이 승부를 가른다`,
|
||||
]
|
||||
: [];
|
||||
const drawPool = [
|
||||
"중원 힘싸움이 끝까지 팽팽",
|
||||
"양 팀 다 한 방 있는 진검승부",
|
||||
"first goal이 모든 걸 가른다",
|
||||
];
|
||||
const pool = win ? winPool : drawPool;
|
||||
function reasonFor(match: Match, outcome: Outcome, seed: number, lang: Lang): string {
|
||||
const win =
|
||||
outcome === "TEAM_A_WIN"
|
||||
? teamShort(match.teamA, lang)
|
||||
: outcome === "TEAM_B_WIN"
|
||||
? teamShort(match.teamB, lang)
|
||||
: null;
|
||||
const pools =
|
||||
lang === "en"
|
||||
? {
|
||||
win: win
|
||||
? [
|
||||
`${win}'s wing speed edges it`,
|
||||
`${win} just needs one set piece`,
|
||||
`${win} starts on the front foot`,
|
||||
`${win}'s finishing decides it`,
|
||||
]
|
||||
: [],
|
||||
draw: [
|
||||
"A tight midfield battle to the end",
|
||||
"Both sides carry a real threat",
|
||||
"The first goal decides everything",
|
||||
],
|
||||
}
|
||||
: {
|
||||
win: win
|
||||
? [
|
||||
`${win} 측면 스피드가 한 끗 위`,
|
||||
`${win} 세트피스 한 방이면 끝`,
|
||||
`${win} 초반 기세에서 앞선다`,
|
||||
`${win} 결정력이 승부를 가른다`,
|
||||
]
|
||||
: [],
|
||||
draw: [
|
||||
"중원 힘싸움이 끝까지 팽팽",
|
||||
"양 팀 다 한 방 있는 진검승부",
|
||||
"first goal이 모든 걸 가른다",
|
||||
],
|
||||
};
|
||||
const pool = win ? pools.win : pools.draw;
|
||||
return pool[seed % pool.length];
|
||||
}
|
||||
|
||||
function generatePredictions(match: Match): AIPrediction[] {
|
||||
function generatePredictions(match: Match, lang: Lang): AIPrediction[] {
|
||||
const base = hash(match.matchId);
|
||||
const outcomes = OUTCOME_SETS[base % OUTCOME_SETS.length];
|
||||
return MODELS.map((model, i) => {
|
||||
@@ -112,15 +149,20 @@ function generatePredictions(match: Match): AIPrediction[] {
|
||||
scoreA,
|
||||
scoreB,
|
||||
confidencePct,
|
||||
reasonShort: reasonFor(match, outcome, seed),
|
||||
reasonShort: reasonFor(match, outcome, seed, lang),
|
||||
generatedAt: "2026-06-08",
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
export function getPredictions(match: Match): AIPrediction[] {
|
||||
if (match.matchId === FEATURED.matchId) return FEATURED_PREDICTIONS;
|
||||
return generatePredictions(match);
|
||||
export function getPredictions(match: Match, lang: Lang = "ko"): AIPrediction[] {
|
||||
if (match.matchId === FEATURED.matchId) {
|
||||
return FEATURED_PREDICTIONS.map((p) => ({
|
||||
...p,
|
||||
reasonShort: FEATURED_REASONS[lang][p.model],
|
||||
}));
|
||||
}
|
||||
return generatePredictions(match, lang);
|
||||
}
|
||||
|
||||
export function getCrowd(match: Match): CrowdStats {
|
||||
|
||||
Reference in new issue
Block a user