Skip to content

Commit

Permalink
refactor: use locale values directly
Browse files Browse the repository at this point in the history
  • Loading branch information
seekshiva committed Mar 28, 2024
1 parent c812af4 commit d3ce99f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 17 deletions.
16 changes: 11 additions & 5 deletions src/CardTheme.res
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,21 @@ type recoilConfig = {
showLoader: bool,
}
let getLocaleObject = string => {
let val = if string == "auto" {
let locale = if string == "auto" {
navigator["language"]
} else {
string
}
LocaleString.localeStrings
->Array.filter(item => item.locale == val)
->Array.get(0)
->Option.getOr(LocaleString.defaultLocale)
switch locale {
| "en" => EnglishLocale2.localeStrings
| "he" => HebrewLocale.localeStrings
| "fr" => FrenchLocale.localeStrings
| "en-GB" => EnglishGBLocale.localeStrings
| "ar" => ArabicLocale.localeStrings
| "ja" => JapaneseLocale.localeStrings
| "de" => DeutschLocale.localeStrings
| _ => EnglishLocale.localeStrings
}
}
let defaultRecoilConfig: recoilConfig = {
config: defaultConfig,
Expand Down
12 changes: 0 additions & 12 deletions src/LocaleStrings/LocaleString.res

This file was deleted.

0 comments on commit d3ce99f

Please sign in to comment.