@@ -21,8 +21,13 @@ import {
2121} from "./PlatformCategory" ;
2222import { getRuntime } from "@next-core/runtime" ;
2323import { CSSTransition , TransitionGroup } from "react-transition-group" ;
24+ import { initializeReactI18n , useTranslation } from "@next-core/i18n/react" ;
25+ import { K , NS , locales } from "./i18n" ;
26+
27+ initializeReactI18n ( NS , locales ) ;
2428
2529export function Launchpad ( { active } : { active ?: boolean } ) {
30+ const { t } = useTranslation ( NS ) ;
2631 const searchInputRef = useRef < HTMLInputElement > ( null ) ;
2732 const [ favorites , setFavorites ] = useState < FavMenuItem [ ] > ( [ ] ) ;
2833 const handleClickSearchBox = useCallback ( ( ) => {
@@ -119,7 +124,7 @@ export function Launchpad({ active }: { active?: boolean }) {
119124 < div className = "sidebar" >
120125 < div className = "union" >
121126 < div className = "quick-nav" >
122- < div className = "quick-nav-label" > 快捷访问 </ div >
127+ < div className = "quick-nav-label" > { t ( K . QUICK_ACCESS ) } </ div >
123128 { /* <Loading loading={loading || loadingFavorites} /> */ }
124129 < TransitionGroup >
125130 < ul className = "sidebar-menu quick-nav-menu" >
@@ -148,7 +153,7 @@ export function Launchpad({ active }: { active?: boolean }) {
148153
149154 { showPlatformCategory && (
150155 < div className = "platform-nav" >
151- < div className = "platform-nav-label" > 平台底座 </ div >
156+ < div className = "platform-nav-label" > { t ( K . PLATFORM_BASE ) } </ div >
152157 < ul className = "sidebar-menu platform-nav-menu" >
153158 { platformCategories . map ( ( item , index ) => (
154159 < PlatformCategorySidebarMenuItem
@@ -165,7 +170,7 @@ export function Launchpad({ active }: { active?: boolean }) {
165170 { showScenarioCenter && (
166171 < div className = "jump-nav" >
167172 < WrappedLink type = "plain" url = { "/portal/scenario" } >
168- < div className = "jump-nav-label" > 场景中心 </ div >
173+ < div className = "jump-nav-label" > { t ( K . SCENARIO_CENTER ) } </ div >
169174 < WrappedIcon lib = "antd" icon = "right" theme = "outlined" />
170175 </ WrappedLink >
171176 </ div >
@@ -174,15 +179,15 @@ export function Launchpad({ active }: { active?: boolean }) {
174179 { showSolutionCenter && (
175180 < div className = "jump-nav" >
176181 < WrappedLink type = "plain" url = { "/portal/solution" } >
177- < div className = "jump-nav-label" > 解决方案 </ div >
182+ < div className = "jump-nav-label" > { t ( K . SOLUTIONS ) } </ div >
178183 < WrappedIcon lib = "antd" icon = "right" theme = "outlined" />
179184 </ WrappedLink >
180185 </ div >
181186 ) }
182187 { showOpenPlatform && (
183188 < div className = "jump-nav" >
184189 < WrappedLink type = "plain" url = { "/developers" } >
185- < div className = "jump-nav-label" > 开放平台 </ div >
190+ < div className = "jump-nav-label" > { t ( K . OPEN_PLATFORM ) } </ div >
186191 < WrappedIcon lib = "antd" icon = "right" theme = "outlined" />
187192 </ WrappedLink >
188193 </ div >
@@ -201,7 +206,7 @@ export function Launchpad({ active }: { active?: boolean }) {
201206 />
202207 < input
203208 ref = { searchInputRef }
204- placeholder = "通过关键字搜索"
209+ placeholder = { t ( K . SEARCH_PLACEHOLDER ) as string }
205210 value = { q }
206211 onChange = { handleSearch }
207212 className = "search-input"
@@ -216,7 +221,7 @@ export function Launchpad({ active }: { active?: boolean }) {
216221 </ div >
217222 { platform === "#all" && (
218223 < div className = { classNames ( { empty : recentVisits . length === 0 } ) } >
219- < div className = "recent-visits-label" > 最近访问 </ div >
224+ < div className = "recent-visits-label" > { t ( K . RECENT_VISITS ) } </ div >
220225 < ul className = "recent-visits" >
221226 { recentVisits . map ( ( item , index ) => (
222227 < li key = { index } >
@@ -243,7 +248,7 @@ export function Launchpad({ active }: { active?: boolean }) {
243248 { menuGroups . map ( ( group ) => (
244249 < MenuGroup
245250 key = { group . name }
246- name = { group . name }
251+ name = { group . localeName as string }
247252 items = { group . items }
248253 />
249254 ) ) }
0 commit comments