File tree 3 files changed +624
-4
lines changed
3 files changed +624
-4
lines changed Original file line number Diff line number Diff line change @@ -599,6 +599,16 @@ class Nav extends React.PureComponent {
599
599
Español
600
600
</ button >
601
601
</ li >
602
+ < li className = "nav__dropdown-item" >
603
+ < button
604
+ onFocus = { this . handleFocusForLang }
605
+ onBlur = { this . handleBlur }
606
+ value = "ja"
607
+ onClick = { e => this . handleLangSelection ( e ) }
608
+ >
609
+ 日本語
610
+ </ button >
611
+ </ li >
602
612
</ ul >
603
613
</ li >
604
614
</ React . Fragment >
Original file line number Diff line number Diff line change @@ -2,23 +2,25 @@ import i18n from 'i18next';
2
2
import { initReactI18next } from 'react-i18next' ;
3
3
import LanguageDetector from 'i18next-browser-languagedetector' ;
4
4
import Backend from 'i18next-http-backend' ;
5
- import { enUS , es } from 'date-fns/locale' ;
5
+ import { enUS , es , ja } from 'date-fns/locale' ;
6
6
7
7
const fallbackLng = [ 'en-US' ] ;
8
- const availableLanguages = [ 'en-US' , 'es-419' ] ;
8
+ const availableLanguages = [ 'en-US' , 'es-419' , 'ja' ] ;
9
9
10
10
export function languageKeyToLabel ( lang ) {
11
11
const languageMap = {
12
12
'en-US' : 'English' ,
13
- 'es-419' : 'Español'
13
+ 'es-419' : 'Español' ,
14
+ 'ja' : '日本語'
14
15
} ;
15
16
return languageMap [ lang ] ;
16
17
}
17
18
18
19
export function languageKeyToDateLocale ( lang ) {
19
20
const languageMap = {
20
21
'en-US' : enUS ,
21
- 'es-419' : es
22
+ 'es-419' : es ,
23
+ 'ja' : ja
22
24
} ;
23
25
return languageMap [ lang ] ;
24
26
}
@@ -35,6 +37,8 @@ const options = {
35
37
allowMultiLoading : false , // set loadPath: '/locales/resources.json?lng={{lng}}&ns={{ns}}' to adapt to multiLoading
36
38
} ;
37
39
40
+ console . log ( 'options' , options ) ;
41
+
38
42
i18n
39
43
. use ( initReactI18next ) // pass the i18n instance to react-i18next.
40
44
// .use(LanguageDetector)// to detect the language from currentBrowser
You can’t perform that action at this time.
0 commit comments