Skip to content

Commit

Permalink
fix: locale string changes types added
Browse files Browse the repository at this point in the history
  • Loading branch information
Pritish Budhiraja committed Apr 4, 2024
1 parent c66f968 commit 96d9820
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 18 deletions.
35 changes: 17 additions & 18 deletions src/CardTheme.res
Original file line number Diff line number Diff line change
Expand Up @@ -75,24 +75,23 @@ let getLocaleObject = string => {
} else {
string
}
switch locale {
| "en" => EnglishLocale.localeStrings
| "he" => HebrewLocale.localeStrings
| "fr" => FrenchLocale.localeStrings
| "en-GB" => EnglishGBLocale.localeStrings
| "ar" => ArabicLocale.localeStrings
| "ja" => JapaneseLocale.localeStrings
| "de" => DeutschLocale.localeStrings
| "fr-BE" => FrenchBelgiumLocale.localeStrings
| "es" => SpanishLocale.localeStrings
| "ca" => CatalanLocale.localeStrings
| "pt" => PortugueseLocale.localeStrings
| "it" => ItalianLocale.localeStrings
| "pl" => PolishLocale.localeStrings
| "nl" => DutchLocale.localeStrings
| "sv" => SwedishLocale.localeStrings
| "ru" => RussianLocale.localeStrings
| _ => EnglishLocale.localeStrings
switch locale->LocaleStringHelper.mapLocalStringToTypeLocale {
| EN => EnglishLocale.localeStrings
| HE => HebrewLocale.localeStrings
| FR => FrenchLocale.localeStrings
| EN_GB => EnglishGBLocale.localeStrings
| AR => ArabicLocale.localeStrings
| JA => JapaneseLocale.localeStrings
| DE => DeutschLocale.localeStrings
| FR_BE => FrenchBelgiumLocale.localeStrings
| ES => SpanishLocale.localeStrings
| CA => CatalanLocale.localeStrings
| PT => PortugueseLocale.localeStrings
| IT => ItalianLocale.localeStrings
| PL => PolishLocale.localeStrings
| NL => DutchLocale.localeStrings
| SV => SwedishLocale.localeStrings
| RU => RussianLocale.localeStrings
}
}
let defaultRecoilConfig: recoilConfig = {
Expand Down
22 changes: 22 additions & 0 deletions src/LocaleStrings/LocaleStringHelper.res
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
open LocaleStringTypes
let mapLocalStringToTypeLocale = val => {
switch val {
| "en" => EN
| "he" => HE
| "fr" => FR
| "en-GB" => EN_GB
| "ar" => AR
| "ja" => JA
| "de" => DE
| "fr-BE" => FR_BE
| "es" => ES
| "ca" => CA
| "pt" => PT
| "it" => IT
| "pl" => PL
| "nl" => NL
| "sv" => SV
| "ru" => RU
| _ => EN
}
}
2 changes: 2 additions & 0 deletions src/LocaleStrings/LocaleStringTypes.res
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
type locale = EN | HE | FR | EN_GB | AR | JA | DE | FR_BE | ES | CA | PT | IT | PL | NL | SV | RU

type localeStrings = {
locale: string,
cardNumberLabel: string,
Expand Down

0 comments on commit 96d9820

Please sign in to comment.