locale second stage
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
"use client";
|
||||
|
||||
import { GroupId, GroupTable, Match, Team } from "@/lib/types";
|
||||
import { GroupId, GroupTable, Match, Team, teamName } from "@/lib/types";
|
||||
import { Dictionary } from "@/lib/i18n";
|
||||
import Flag from "./Flag";
|
||||
|
||||
function teamById(teams: Team[], id: string) {
|
||||
@@ -26,10 +27,11 @@ function liveTeamIdsFor(group: GroupId, matches: Match[]): Set<string> {
|
||||
}
|
||||
|
||||
export default function Groups({
|
||||
tables, teams, matches, onOpenGroup,
|
||||
tables, teams, matches, onOpenGroup, dict, locale,
|
||||
}: {
|
||||
tables: GroupTable[]; teams: Team[]; matches: Match[];
|
||||
onOpenGroup: (g: GroupId) => void;
|
||||
dict: Dictionary; locale: string;
|
||||
}) {
|
||||
return (
|
||||
<div className="group-grid">
|
||||
@@ -43,19 +45,19 @@ export default function Groups({
|
||||
<button
|
||||
className="group-head group-head-btn"
|
||||
onClick={() => onOpenGroup(t.group)}
|
||||
title={`Spiele der Gruppe ${t.group} ansehen`}
|
||||
title={dict.groups.viewGroupGames(t.group)}
|
||||
>
|
||||
<span className={`group-name${groupComplete ? " group-complete" : ""}`}>Gruppe {t.group}</span>
|
||||
<span className={`group-name${groupComplete ? " group-complete" : ""}`}>{dict.groups.groupLabel(t.group)}</span>
|
||||
<span className="group-tag">
|
||||
{live ? "● LIVE" : "Spiele ansehen →"}
|
||||
{live ? dict.label.liveIndicator : dict.groups.viewGames}
|
||||
</span>
|
||||
</button>
|
||||
<table className="standings">
|
||||
<thead>
|
||||
<tr>
|
||||
<th className="team">Mannschaft</th>
|
||||
<th>Sp</th><th>S</th><th>U</th><th>N</th>
|
||||
<th>Tore</th><th>±</th><th>Pkt</th>
|
||||
<th className="team">{dict.table.team}</th>
|
||||
<th>{dict.table.matches}</th><th>{dict.table.won}</th><th>{dict.table.drawn}</th><th>{dict.table.lost}</th>
|
||||
<th>{dict.table.goals}</th><th>{dict.table.goalDiff}</th><th>{dict.table.points}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -68,8 +70,8 @@ export default function Groups({
|
||||
<td className="team">
|
||||
<span className={`rankdot ${cls}`}>{r.rank}</span>
|
||||
<Flag team={team} size={20} />
|
||||
<span className="team-name">{team?.localisedName ?? team?.name ?? r.teamId}</span>
|
||||
{isLive && <span className="row-live-dot" title="läuft gerade" />}
|
||||
<span className="team-name">{teamName(team, locale)}</span>
|
||||
{isLive && <span className="row-live-dot" title={dict.status.running} />}
|
||||
</td>
|
||||
<td>{r.played}</td>
|
||||
<td>{r.won}</td>
|
||||
|
||||
Reference in New Issue
Block a user