mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Better localisation in charts.
This commit is contained in:
parent
32771fe7e1
commit
5e76488ae7
@ -34,7 +34,7 @@ abstract class Controller extends BaseController
|
||||
View::share('hideTags', false);
|
||||
|
||||
if (Auth::check()) {
|
||||
$pref = Preferences::get('language',env('DEFAULT_LANGUAGE','en_US'));
|
||||
$pref = Preferences::get('language', env('DEFAULT_LANGUAGE', 'en_US'));
|
||||
$lang = $pref->data;
|
||||
$this->monthFormat = Config::get('firefly.month.' . $lang);
|
||||
$this->monthAndDayFormat = Config::get('firefly.monthAndDay.' . $lang);
|
||||
@ -42,6 +42,7 @@ abstract class Controller extends BaseController
|
||||
View::share('monthFormat', $this->monthFormat);
|
||||
View::share('monthAndDayFormat', $this->monthAndDayFormat);
|
||||
View::share('language', $lang);
|
||||
View::share('localeconv', localeconv());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* globals $, Chart, currencySymbol */
|
||||
/* globals $, Chart, currencySymbol,mon_decimal_point ,accounting, mon_thousands_sep, frac_digits */
|
||||
|
||||
/*
|
||||
Make some colours:
|
||||
@ -29,16 +29,16 @@ accounting.settings = {
|
||||
currency: {
|
||||
symbol : currencySymbol, // default currency symbol is '$'
|
||||
format: "%s %v", // controls output: %s = symbol, %v = value/number (can be object: see below)
|
||||
decimal : ",", // decimal point separator
|
||||
thousand: ".", // thousands separator
|
||||
precision : 2 // decimal places
|
||||
decimal : mon_decimal_point, // decimal point separator
|
||||
thousand: mon_thousands_sep, // thousands separator
|
||||
precision : frac_digits // decimal places
|
||||
},
|
||||
number: {
|
||||
precision : 0, // default precision on numbers is 0
|
||||
thousand: ",",
|
||||
decimal : "."
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
var fillColors = [];
|
||||
|
@ -184,6 +184,10 @@
|
||||
var language = "{{ language }}";
|
||||
var currencyCode = '{{ getCurrencyCode() }}';
|
||||
var currencySymbol = '{{ getCurrencySymbol()|raw }}';
|
||||
var mon_decimal_point = "{{ localeconv.mon_decimal_point }}";
|
||||
var mon_thousands_sep = "{{ localeconv.mon_thousands_sep }}";
|
||||
var frac_digits = {{ localeconv.frac_digits }};
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user