@@ -7,6 +7,8 @@ import { useWebSocketContext } from "@/hooks/use-websocket-context"
77import { formatBytes } from "@/lib/format"
88import { cn , formatNezhaInfo } from "@/lib/utils"
99import { NezhaWebsocketResponse } from "@/types/nezha-api"
10+ import countries from "i18n-iso-countries"
11+ import enLocale from "i18n-iso-countries/langs/en.json"
1012import { useEffect , useState } from "react"
1113import { useTranslation } from "react-i18next"
1214import { useNavigate } from "react-router-dom"
@@ -77,6 +79,8 @@ export default function ServerDetailOverview({ server_id }: { server_id: string
7779 // @ts -expect-error CustomBackgroundImage is a global variable
7880 ( window . CustomBackgroundImage as string ) !== "" ? window . CustomBackgroundImage : undefined
7981
82+ countries . registerLocale ( enLocale )
83+
8084 return (
8185 < div
8286 className = { cn ( {
@@ -168,7 +172,7 @@ export default function ServerDetailOverview({ server_id }: { server_id: string
168172 < section className = "flex flex-col items-start gap-0.5" >
169173 < p className = "text-xs text-muted-foreground" > { t ( "serverDetail.region" ) } </ p >
170174 < section className = "flex items-start gap-1" >
171- < div className = "text-xs text-start" > { country_code ?. toUpperCase ( ) } </ div >
175+ < div className = "text-xs text-start" > { countries . getName ( country_code ?. toUpperCase ( ) , "en" ) } </ div >
172176 { country_code && < ServerFlag className = "text-[11px] -mt-[1px]" country_code = { country_code } /> }
173177 </ section >
174178 </ section >
0 commit comments