Skip to content

Commit

Permalink
Gets system language and sets it as default on first launch.
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobmcgowan committed Aug 24, 2024
1 parent 1d89159 commit a5db2fb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/providers/LanguageProvider/LanguageProvider.reducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@ import {
SET_DOWNLOADING_LANG
} from './LanguageProvider.constants';
import { LOGIN_SUCCESS } from '../../components/Account/Login/Login.constants';
import { DEFAULT_LANG } from '../../components/App/App.constants';
import { APP_LANGS } from '../../components/App/App.constants';
import { getDefaultLang } from '../../i18n';

function getDir(lang) {
const locale = lang.slice(0, 2);
return locale === 'ar' || locale === 'he' ? 'rtl' : 'ltr';
}

const initialState = {
lang: DEFAULT_LANG,
lang: getDefaultLang(APP_LANGS),
dir: 'ltr',
langs: [],
localLangs: [],
Expand Down

0 comments on commit a5db2fb

Please sign in to comment.