i18n
CI/CD Pipeline / Build and Push PocketBase Docker Image (push) Successful in 8s
CI/CD Pipeline / i18n Catalog Check (push) Failing after 10s
CI/CD Pipeline / Build and Push App Docker Image (push) Skipped
CI/CD Pipeline / Deploy to Kubernetes (push) Skipped

This commit is contained in:
yohlo
2026-08-08 15:29:40 -07:00
parent 22c282d8fa
commit 0a7b5fa00f
178 changed files with 13099 additions and 1285 deletions
+13 -7
View File
@@ -1,3 +1,5 @@
import { msg } from "@lingui/core/macro";
import type { I18n } from "@lingui/core";
import { Match } from "@/features/matches/types";
import { Team, TeamInfo } from "@/features/teams/types";
import { Tournament } from "@/features/tournaments/types";
@@ -150,8 +152,12 @@ export const isPredictionComplete = (
);
};
export const getMatchLabel = (matches: Match[], match: Match): string => {
if (match.reset) return "Bracket Reset";
export const getMatchLabel = (
i18n: I18n,
matches: Match[],
match: Match
): string => {
if (match.reset) return i18n._(msg`Bracket Reset`);
const winners = matches.filter(
(m) => isBracketMatch(m) && !m.reset && !m.is_losers_bracket
@@ -161,24 +167,24 @@ export const getMatchLabel = (matches: Match[], match: Match): string => {
!highest || current.lid > highest.lid ? current : highest,
undefined
);
if (!grandFinal) return `Match ${match.order}`;
if (!grandFinal) return i18n._({ ...msg`Match {order}`, values: { order: match.order } });
const hasLosersBracket = matches.some(
(m) => isBracketMatch(m) && m.is_losers_bracket
);
if (match.lid === grandFinal.lid) return "Final";
if (match.lid === grandFinal.lid) return i18n._(msg`Final`);
if (
hasLosersBracket &&
!match.is_losers_bracket &&
grandFinal.home_from_lid === match.lid
) {
return "Winners Bracket Final";
return i18n._(msg`Winners Bracket Final`);
}
if (match.is_losers_bracket && grandFinal.away_from_lid === match.lid) {
return "Losers Bracket Final";
return i18n._(msg`Losers Bracket Final`);
}
return `Match ${match.order}`;
return i18n._({ ...msg`Match {order}`, values: { order: match.order } });
};
export type PickResult = "correct" | "incorrect" | "pending";