Skip to content

Commit

Permalink
fix(console): language auto detection
Browse files Browse the repository at this point in the history
  • Loading branch information
charIeszhao committed Jul 7, 2022
1 parent 78cba36 commit 7c880fc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/console/src/i18n/init.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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;

0 comments on commit 7c880fc

Please sign in to comment.