Skip to content

Commit

Permalink
Merge pull request #1759 from jacobmcgowan/feature/use-system-languag…
Browse files Browse the repository at this point in the history
…e-as-default

Gets system language and sets it as default on first launch
  • Loading branch information
martinbedouret authored Dec 13, 2024
2 parents 7e4c1c5 + a5db2fb commit 81f79a6
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 81f79a6

Please sign in to comment.