File tree Expand file tree Collapse file tree 1 file changed +10
-15
lines changed Expand file tree Collapse file tree 1 file changed +10
-15
lines changed Original file line number Diff line number Diff line change @@ -90,19 +90,14 @@ export type TranslationComponentProps =
9090export type TranslationComponent = FC < TranslationComponentProps > ;
9191
9292// Switch translation language.
93- let Translation : TranslationComponent ;
94- let translation : TranslationObject ;
95-
96- switch ( language ) {
97- case "ja-JP" :
98- Translation = JaJPTranslation ;
99- translation = jaJPTranslation ;
100- break ;
101- case "en-US" :
102- Translation = EnUSTranslation ;
103- translation = enUSTranslation ;
104- break ;
105- default :
106- throw new Error ( `Unsupported language: ${ language } ` ) ;
107- }
93+ const { Translation, translation } = ( ( ) => {
94+ switch ( language ) {
95+ case "ja-JP" :
96+ return { Translation : JaJPTranslation , translation : jaJPTranslation } ;
97+ case "en-US" :
98+ return { Translation : EnUSTranslation , translation : enUSTranslation } ;
99+ default :
100+ throw new Error ( `Unsupported language: ${ language } ` ) ;
101+ }
102+ } ) ( ) ;
108103export { Translation , translation } ;
You can’t perform that action at this time.
0 commit comments