mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Add windows locale support #3519
This commit is contained in:
parent
7017d33b87
commit
d49743031f
@ -121,7 +121,7 @@ class Amount
|
|||||||
*/
|
*/
|
||||||
public function getJsConfig(): array
|
public function getJsConfig(): array
|
||||||
{
|
{
|
||||||
$config = $this->getLocaleInfo();
|
$config = $this->getLocaleInfo();
|
||||||
$negative = self::getAmountJsConfig($config['n_sep_by_space'], $config['n_sign_posn'], $config['negative_sign'], $config['n_cs_precedes']);
|
$negative = self::getAmountJsConfig($config['n_sep_by_space'], $config['n_sign_posn'], $config['negative_sign'], $config['n_cs_precedes']);
|
||||||
$positive = self::getAmountJsConfig($config['p_sep_by_space'], $config['p_sign_posn'], $config['positive_sign'], $config['p_cs_precedes']);
|
$positive = self::getAmountJsConfig($config['p_sep_by_space'], $config['p_sign_posn'], $config['positive_sign'], $config['p_cs_precedes']);
|
||||||
|
|
||||||
@ -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);
|
||||||
|
@ -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.
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user