로컬라이제이션 적용 (영어 / 한국어 )
This commit is contained in:
1 parent
29fdb7e65c
commit
ad6f9e09a1
30 files changed
+1474
-309
No files matched your search
@@ -0,0 +1,22 @@
|
||||
import i18n from 'i18next';
|
||||
import { initReactI18next } from 'react-i18next';
|
||||
import ko from '../locales/ko.json';
|
||||
import en from '../locales/en.json';
|
||||
|
||||
const LANGUAGE_KEY = 'castad_language';
|
||||
|
||||
i18n.use(initReactI18next).init({
|
||||
resources: {
|
||||
ko: { translation: ko },
|
||||
en: { translation: en },
|
||||
},
|
||||
lng: localStorage.getItem(LANGUAGE_KEY) || 'ko',
|
||||
fallbackLng: 'ko',
|
||||
interpolation: { escapeValue: false },
|
||||
});
|
||||
|
||||
i18n.on('languageChanged', (lng) => {
|
||||
localStorage.setItem(LANGUAGE_KEY, lng);
|
||||
});
|
||||
|
||||
export default i18n;
|
||||
Reference in new issue
Block a user