Add windows locale support #3519

This commit is contained in:
James Cole 2020-07-27 07:13:39 +02:00
parent 7017d33b87
commit d49743031f
No known key found for this signature in database
GPG Key ID: B5669F9493CDE38D
2 changed files with 4 additions and 2 deletions

View File

@ -147,6 +147,7 @@ class Amount
setlocale(LC_MONETARY, $array); setlocale(LC_MONETARY, $array);
$info = localeconv(); $info = localeconv();
// correct variables // correct variables
$info['n_cs_precedes'] = $this->getLocaleField($info, 'n_cs_precedes'); $info['n_cs_precedes'] = $this->getLocaleField($info, 'n_cs_precedes');
$info['p_cs_precedes'] = $this->getLocaleField($info, 'p_cs_precedes'); $info['p_cs_precedes'] = $this->getLocaleField($info, 'p_cs_precedes');
@ -154,7 +155,7 @@ class Amount
$info['n_sep_by_space'] = $this->getLocaleField($info, 'n_sep_by_space'); $info['n_sep_by_space'] = $this->getLocaleField($info, 'n_sep_by_space');
$info['p_sep_by_space'] = $this->getLocaleField($info, 'p_sep_by_space'); $info['p_sep_by_space'] = $this->getLocaleField($info, 'p_sep_by_space');
$fmt = new NumberFormatter( $locale, NumberFormatter::CURRENCY ); $fmt = new NumberFormatter( $locale, NumberFormatter::CURRENCY);
$info['mon_decimal_point'] = $fmt->getSymbol(NumberFormatter::MONETARY_SEPARATOR_SYMBOL); $info['mon_decimal_point'] = $fmt->getSymbol(NumberFormatter::MONETARY_SEPARATOR_SYMBOL);
$info['mon_thousands_sep'] = $fmt->getSymbol(NumberFormatter::MONETARY_GROUPING_SEPARATOR_SYMBOL); $info['mon_thousands_sep'] = $fmt->getSymbol(NumberFormatter::MONETARY_GROUPING_SEPARATOR_SYMBOL);

View File

@ -625,6 +625,7 @@ class Steam
return [ return [
sprintf('%s.utf8', $locale), sprintf('%s.utf8', $locale),
sprintf('%s.UTF-8', $locale), sprintf('%s.UTF-8', $locale),
str_replace('_', '-', $locale), // for Windows.
]; ];
} }