File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import { Box , Stack , Typography } from "@mui/material" ;
2+ import { useTranslation } from "i18n" ;
3+ import { GLOBAL } from "i18n/namespaces" ;
24import { ReactNode , useCallback , useState } from "react" ;
35
4- import { useTranslation } from "../i18n" ;
5-
66export interface FlipCardProps {
77 icon : ReactNode ;
88 title : ReactNode ;
@@ -20,7 +20,7 @@ export default function FlipCard({
2020 children,
2121 height = { xs : 300 , md : 320 } ,
2222} : FlipCardProps ) {
23- const { t } = useTranslation ( [ " GLOBAL" ] ) ;
23+ const { t } = useTranslation ( [ GLOBAL ] ) ;
2424 const [ flipped , setFlipped ] = useState ( false ) ;
2525 const toggle = useCallback ( ( ) => setFlipped ( ( f ) => ! f ) , [ ] ) ;
2626
Original file line number Diff line number Diff line change 99import Button from "components/Button" ;
1010import { BugIcon } from "components/Icons" ;
1111import { useTranslation } from "i18n" ;
12+ import { GLOBAL } from "i18n/namespaces" ;
1213import { useState } from "react" ;
1314import { theme } from "theme" ;
1415
@@ -40,7 +41,7 @@ export default function ReportButton({
4041 isMenuLink ?: boolean ;
4142 sx ?: SxProps < Theme > ;
4243} ) {
43- const { t } = useTranslation ( "global" ) ;
44+ const { t } = useTranslation ( GLOBAL ) ;
4445 const isBelowMd = useMediaQuery ( theme . breakpoints . down ( "md" ) ) ;
4546 const [ isDialogOpen , setIsDialogOpen ] = useState ( false ) ;
4647
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ import StyledLink from "components/StyledLink";
1414import TextField from "components/TextField" ;
1515import { RpcError } from "grpc-web" ;
1616import { useTranslation } from "i18n" ;
17+ import { GLOBAL } from "i18n/namespaces" ;
1718import { ReportBugRes } from "proto/bugs_pb" ;
1819import { ComponentPropsWithRef , forwardRef , useState } from "react" ;
1920import { useForm } from "react-hook-form" ;
@@ -56,7 +57,7 @@ const StyledReportTypeButton = styled(Button)(() => ({
5657} ) ) ;
5758
5859export default function ReportDialog ( { open, onClose } : DialogProps ) {
59- const { t } = useTranslation ( "global" ) ;
60+ const { t } = useTranslation ( GLOBAL ) ;
6061
6162 const [ type , setType ] = useState < "initial" | "bug" > ( "initial" ) ;
6263 const {
Original file line number Diff line number Diff line change 11import { styled } from "@mui/material" ;
2+ import { GLOBAL } from "i18n/namespaces" ;
23import Link from "next/link" ;
34import { useTranslation } from "next-i18next" ;
45import { tosRoute } from "routes" ;
@@ -9,7 +10,7 @@ const StyledLink = styled(Link)(({ theme }) => ({
910} ) ) ;
1011
1112export default function TOSLink ( ) {
12- const { t } = useTranslation ( "global" ) ;
13+ const { t } = useTranslation ( GLOBAL ) ;
1314 return (
1415 < StyledLink href = { tosRoute } target = "_blank" >
1516 { t ( "terms_of_service" ) }
Original file line number Diff line number Diff line change @@ -82,7 +82,7 @@ export const ResponseRateLabel = ({ user }: Props) => {
8282 const {
8383 t,
8484 i18n : { language } ,
85- } = useTranslation ( "profile" ) ;
85+ } = useTranslation ( PROFILE ) ;
8686 // Localize the humanized durations at the call site (no global dayjs locale).
8787 const dayjsLocale = i18nToDayjsLocale ( language ) ;
8888
@@ -163,7 +163,7 @@ const AgeAndGenderRenderer = ({ user }: Props) => {
163163 gender,
164164 pronouns,
165165 } = user ;
166- const { t } = useTranslation ( "profile" ) ;
166+ const { t } = useTranslation ( PROFILE ) ;
167167
168168 const getBirthdateVerificationIcon = (
169169 status : BirthdateVerificationStatus ,
@@ -233,7 +233,7 @@ const AgeAndGenderRenderer = ({ user }: Props) => {
233233} ;
234234
235235export const AgeGenderLanguagesLabels = ( { user } : Props ) => {
236- const { t } = useTranslation ( "profile" ) ;
236+ const { t } = useTranslation ( PROFILE ) ;
237237 const { languages } = useLanguages ( ) ;
238238
239239 return (
You can’t perform that action at this time.
0 commit comments