diff --git a/frontend-react/public/locales/en/translation.json b/frontend-react/public/locales/en/translation.json index 4fa64514d..52eb66bb5 100644 --- a/frontend-react/public/locales/en/translation.json +++ b/frontend-react/public/locales/en/translation.json @@ -1468,5 +1468,22 @@ "What is your activity like on a typical week?": "What is your activity like on a typical week?", "What are you looking from a team?": "What are you looking from a team?", "Free word": "Free word" + }, + "tournaments": { + "Tournament": "Tournament", + "Team": "Team", + "Player": "Player", + "Comp": "Comp", + "Map & mode": "Map & mode", + "Region": "Region", + "All": "All", + "Western": "Western", + "Japanese": "Japanese", + "Apply": "Apply", + "Clear filters": "Clear filters", + "All tournaments": "All tournaments", + "Popular weapons": "Popular weapons", + "VICTORY": "VICTORY", + "DEFEAT": "DEFEAT" } } diff --git a/frontend-react/src/components/elements/Select.tsx b/frontend-react/src/components/elements/Select.tsx index e1b2913e3..61cf8a3d8 100644 --- a/frontend-react/src/components/elements/Select.tsx +++ b/frontend-react/src/components/elements/Select.tsx @@ -115,7 +115,7 @@ const Select: React.FC = ({ } return ( - + {label && } = ({ background: themeColorHexLighter, color: "black", }), - option: (styles, { data, isDisabled, isFocused, isSelected }) => { + option: (styles, { isFocused }) => { return { ...styles, backgroundColor: isFocused ? themeColorHexLighter : undefined, diff --git a/frontend-react/src/components/tournaments/TournamentCard.tsx b/frontend-react/src/components/tournaments/TournamentCard.tsx index f5f34e567..fc43d1160 100644 --- a/frontend-react/src/components/tournaments/TournamentCard.tsx +++ b/frontend-react/src/components/tournaments/TournamentCard.tsx @@ -6,6 +6,7 @@ import trophy from "../../assets/trophy.png" import WeaponImage from "../common/WeaponImage" import { Weapon } from "../../types" import Flag from "../common/Flag" +import { useTranslation } from "react-i18next" interface TournamentCardProps { tournament: { @@ -26,6 +27,7 @@ const TournamentCard: React.FC = ({ tournament, styledOnHover, }) => { + const { t } = useTranslation() const { grayWithShade } = useContext(MyThemeContext) const a = new Date(parseInt(tournament.date)) const dateStr = `${a.getDate()} ${ @@ -78,10 +80,10 @@ const TournamentCard: React.FC = ({ fontSize="xs" mt="1.5em" > - Popular weapons + {t("tournaments;Popular weapons")} - {tournament.popular_weapons.map(weapon => ( + {tournament.popular_weapons.map((weapon) => ( diff --git a/frontend-react/src/components/tournaments/TournamentDetailsPage.tsx b/frontend-react/src/components/tournaments/TournamentDetailsPage.tsx index 08108a90d..89552b7af 100644 --- a/frontend-react/src/components/tournaments/TournamentDetailsPage.tsx +++ b/frontend-react/src/components/tournaments/TournamentDetailsPage.tsx @@ -26,6 +26,7 @@ import { } from "use-query-params" import { stringify } from "querystring" import { removeFalsy } from "../../utils/helperFunctions" +import { useTranslation } from "react-i18next" interface TournamentDetailsPageProps { id?: string @@ -55,8 +56,10 @@ const filterMap = { stage: StringParam, } -const TournamentDetailsPage: React.FC = ({ id }) => { +const TournamentDetailsPage: React.FC< + RouteComponentProps & TournamentDetailsPageProps +> = ({ id }) => { + const { t } = useTranslation() const { themeColorWithShade, grayWithShade, @@ -104,10 +107,10 @@ const TournamentDetailsPage: React.FC player.toUpperCase() === playerNameUpper + (player) => player.toUpperCase() === playerNameUpper ) || round.losing_team_players.some( - player => player.toUpperCase() === playerNameUpper + (player) => player.toUpperCase() === playerNameUpper ) ) { return true @@ -117,10 +120,10 @@ const TournamentDetailsPage: React.FC round.winning_team_weapons.indexOf(weapon as any) !== -1 + (weapon) => round.winning_team_weapons.indexOf(weapon as any) !== -1 ) || comp.every( - weapon => round.losing_team_weapons.indexOf(weapon as any) !== -1 + (weapon) => round.losing_team_weapons.indexOf(weapon as any) !== -1 ) ) { return true @@ -150,7 +153,7 @@ const TournamentDetailsPage: React.FC @@ -158,7 +161,7 @@ const TournamentDetailsPage: React.FC - {tournament.rounds.map(round => { + {tournament.rounds.map((round) => { return ( {round.game_number === 1 && ( @@ -194,7 +197,7 @@ const TournamentDetailsPage: React.FC {round.game_number}. - {round.stage} + {t("game;" + round.stage)} - VICTORY + {t("tournaments;VICTORY")} {round.winning_team_name} @@ -251,7 +254,7 @@ const TournamentDetailsPage: React.FC - DEFEAT + {t("tournaments;DEFEAT")} {round.losing_team_name} diff --git a/frontend-react/src/components/tournaments/TournamentFilters.tsx b/frontend-react/src/components/tournaments/TournamentFilters.tsx index 88e4425bf..2d15055f4 100644 --- a/frontend-react/src/components/tournaments/TournamentFilters.tsx +++ b/frontend-react/src/components/tournaments/TournamentFilters.tsx @@ -9,6 +9,7 @@ import MyThemeContext from "../../themeContext" import { Weapon } from "../../types" import { maps } from "../../utils/lists" import { FaFilter } from "react-icons/fa" +import { useTranslation } from "react-i18next" interface TournamentFiltersProps { forms: { @@ -31,40 +32,41 @@ const TournamentFilters: React.FC = ({ handleClear, onSubmit, }) => { + const { t } = useTranslation() const { themeColor } = useContext(MyThemeContext) const [show, setShow] = useState(false) return ( <> handleChange({ tournament_name: value }) } /> handleChange({ team_name: value })} /> handleChange({ player_name: value })} /> handleChange({ comp: value })} isMulti />