mirror of
https://github.com/logto-io/logto.git
synced 2025-03-31 22:51:25 -05:00
fix(console): language auto detection
This commit is contained in:
parent
78cba36e8f
commit
7c880fc3e6
1 changed files with 2 additions and 1 deletions
|
@ -1,4 +1,5 @@
|
|||
import resources, { Language } from '@logto/phrases';
|
||||
import { conditional } from '@silverhand/essentials';
|
||||
import i18next from 'i18next';
|
||||
import LanguageDetector from 'i18next-browser-languagedetector';
|
||||
import { initReactI18next } from 'react-i18next';
|
||||
|
@ -13,11 +14,11 @@ const initI18n = async (language?: Language) =>
|
|||
interpolation: {
|
||||
escapeValue: false,
|
||||
},
|
||||
lng: language,
|
||||
detection: {
|
||||
lookupLocalStorage: 'i18nextLogtoAcLng',
|
||||
lookupSessionStorage: 'i18nextLogtoAcLng',
|
||||
},
|
||||
...conditional(language && { lng: language }),
|
||||
});
|
||||
|
||||
export default initI18n;
|
||||
|
|
Loading…
Add table
Reference in a new issue