diff --git a/core/NumberFormatter.php b/core/NumberFormatter.php index 0839cb4ba7ec0bb6676e5c56b1e55c030890d04d..5324b552a06e1f02316121556c507a139bdb22a0 100644 --- a/core/NumberFormatter.php +++ b/core/NumberFormatter.php @@ -17,11 +17,8 @@ use Piwik\Container\StaticContainer; */ class NumberFormatter extends Singleton { - /** @var string language specific pattern for positive numbers */ - protected $patternPositive; - - /** @var string language specific pattern for negative numbers */ - protected $patternNegative; + /** @var string language specific patterns for numbers */ + protected $patternNumber; /** @var string language specific pattern for percent numbers */ protected $patternPercent; @@ -50,39 +47,34 @@ class NumberFormatter extends Singleton /** @var int language specific size for secondary group numbers */ protected $secondaryGroupSize; - /** - * @return NumberFormatter - */ - public static function getInstance() - { - return StaticContainer::get('Piwik\NumberFormatter'); - } - /** * Loads all required data from Intl plugin */ public function __construct() { - $this->patternPositive = Piwik::translate('Intl_NumberFormat'); - $this->patternNegative = Piwik::translate('Intl_NumberFormatNegative'); + $this->patternNumber = Piwik::translate('Intl_NumberFormatNumber'); $this->patternPercent = Piwik::translate('Intl_NumberFormatPercent'); $this->symbolPlus = Piwik::translate('Intl_NumberSymbolPlus'); $this->symbolMinus = Piwik::translate('Intl_NumberSymbolMinus'); $this->symbolPercent = Piwik::translate('Intl_NumberSymbolPercent'); $this->symbolGroup = Piwik::translate('Intl_NumberSymbolGroup'); $this->symbolDecimal = Piwik::translate('Intl_NumberSymbolDecimal'); + } - $this->usesGrouping = (strpos($this->patternPositive, ',') !== false); - // if pattern has number groups, parse them. - if ($this->usesGrouping) { - preg_match('/#+0/', $this->patternPositive, $primaryGroupMatches); - $this->primaryGroupSize = $this->secondaryGroupSize = strlen($primaryGroupMatches[0]); - $numberGroups = explode(',', $this->patternPositive); - // check for distinct secondary group size. - if (count($numberGroups) > 2) { - $this->secondaryGroupSize = strlen($numberGroups[1]); - } + /** + * Parses the given pattern and returns patterns for positive and negative numbers + * + * @param string $pattern + * @return array + */ + protected function parsePattern($pattern) + { + $patterns = explode(';', $pattern); + if (!isset($patterns[1])) { + // No explicit negative pattern was provided, construct it. + $patterns[1] = '-' . $patterns[0]; } + return $patterns; } /** @@ -95,8 +87,14 @@ class NumberFormatter extends Singleton */ public function format($value, $maximumFractionDigits=0, $minimumFractionDigits=0) { + static $positivePattern, $negativePattern; + + if (empty($positivePatter) || empty($negativePattern)) { + list($positivePattern, $negativePattern) = $this->parsePattern($this->patternNumber); + } $negative = (bccomp('0', $value, 12) == 1); - $pattern = $negative ? $this->patternNegative : $this->patternPositive; + $pattern = $negative ? $negativePattern : $positivePattern; + return $this->formatNumberWithPattern($pattern, $value, $maximumFractionDigits, $minimumFractionDigits); } @@ -124,11 +122,21 @@ class NumberFormatter extends Singleton */ public function formatPercent($value, $maximumFractionDigits=0, $minimumFractionDigits=0) { + static $positivePattern, $negativePattern; + + if (empty($positivePatter) || empty($negativePattern)) { + list($positivePattern, $negativePattern) = $this->parsePattern($this->patternPercent); + } + $newValue = trim($value, " \0\x0B%"); if (!is_numeric($newValue)) { return $value; } - return $this->formatNumberWithPattern($this->patternPercent, $newValue, $maximumFractionDigits, $minimumFractionDigits); + + $negative = (bccomp('0', $value, 12) == 1); + $pattern = $negative ? $negativePattern : $positivePattern; + + return $this->formatNumberWithPattern($pattern, $newValue, $maximumFractionDigits, $minimumFractionDigits); } /** @@ -145,6 +153,19 @@ class NumberFormatter extends Singleton if (!is_numeric($value)) { return $value; } + + $this->usesGrouping = (strpos($pattern, ',') !== false); + // if pattern has number groups, parse them. + if ($this->usesGrouping) { + preg_match('/#+0/', $pattern, $primaryGroupMatches); + $this->primaryGroupSize = $this->secondaryGroupSize = strlen($primaryGroupMatches[0]); + $numberGroups = explode(',', $pattern); + // check for distinct secondary group size. + if (count($numberGroups) > 2) { + $this->secondaryGroupSize = strlen($numberGroups[1]); + } + } + // Ensure that the value is positive and has the right number of digits. $negative = (bccomp('0', $value, 12) == 1); $signMultiplier = $negative ? '-1' : '1'; diff --git a/plugins/CoreVisualizations/javascripts/jqplot.js b/plugins/CoreVisualizations/javascripts/jqplot.js index 6d55feb023fd0c1f2ead234539f3e22a110f74a2..fac656f5ae33fd9188835c8136cdbfb97fa4bb54 100644 --- a/plugins/CoreVisualizations/javascripts/jqplot.js +++ b/plugins/CoreVisualizations/javascripts/jqplot.js @@ -753,19 +753,6 @@ RowEvolutionSeriesToggle.prototype.beforeReplot = function () { // ------------------------------------------------------------ (function($){ - var usesGrouping = (piwik.numbers.patternPositive.indexOf(',') != -1); - // if pattern has number groups, parse them. - if (usesGrouping) { - var primaryGroupMatches = piwik.numbers.patternPositive.match(/#+0/); - var primaryGroupSize = primaryGroupMatches[0].length; - var secondaryGroupSize = primaryGroupMatches[0].length; - var numberGroups = piwik.numbers.patternPositive.split(','); - // check for distinct secondary group size. - if (numberGroups.length > 2) { - secondaryGroupSize = numberGroups[1].length; - } - } - function replaceSymbols(value) { var replacements = { '.': piwik.numbers.symbolDecimal, @@ -799,9 +786,31 @@ RowEvolutionSeriesToggle.prototype.beforeReplot = function () { if (!$.isNumeric(value)) { return format.replace(/%s/, value); } + pattern = pattern || piwik.numbers.patternNumber; + + var patterns = pattern.split(';'); + if (patterns.length == 1) { + // No explicit negative pattern was provided, construct it. + patterns.push('-' + patterns[0]) + } + // Ensure that the value is positive and has the right number of digits. var negative = value < 0; - pattern = pattern || (negative ? piwik.numbers.patternNegative : piwik.numbers.patternPositive); + pattern = negative ? patterns[1] : patterns[0]; + + var usesGrouping = (pattern.indexOf(',') != -1); + // if pattern has number groups, parse them. + if (usesGrouping) { + var primaryGroupMatches = pattern.match(/#+0/); + var primaryGroupSize = primaryGroupMatches[0].length; + var secondaryGroupSize = primaryGroupMatches[0].length; + var numberGroups = pattern.split(','); + // check for distinct secondary group size. + if (numberGroups.length > 2) { + secondaryGroupSize = numberGroups[1].length; + } + } + var signMultiplier = negative ? '-1' : '1'; value = value * signMultiplier; // Split the number into major and minor digits. diff --git a/plugins/Intl/Commands/GenerateIntl.php b/plugins/Intl/Commands/GenerateIntl.php index 42195ea969e86b4fbb8749a4012640ffe049fb5a..97a00792ccef76b3fdc61730c8dfa6bf3d41e6bd 100644 --- a/plugins/Intl/Commands/GenerateIntl.php +++ b/plugins/Intl/Commands/GenerateIntl.php @@ -335,15 +335,13 @@ class GenerateIntl extends ConsoleCommand $unitsData = $unitsData['main'][$requestLangCode]['numbers']; $numberingSystem = $unitsData['defaultNumberingSystem']; - $numberFormats = explode(';', $unitsData['decimalFormats-numberSystem-' . $numberingSystem]['standard']); $translations['Intl']['NumberSymbolDecimal'] = $unitsData['symbols-numberSystem-' . $numberingSystem]['decimal']; $translations['Intl']['NumberSymbolGroup'] = $unitsData['symbols-numberSystem-' . $numberingSystem]['group']; $translations['Intl']['NumberSymbolPercent'] = $unitsData['symbols-numberSystem-' . $numberingSystem]['percentSign']; $translations['Intl']['NumberSymbolPlus'] = $unitsData['symbols-numberSystem-' . $numberingSystem]['plusSign']; $translations['Intl']['NumberSymbolMinus'] = $unitsData['symbols-numberSystem-' . $numberingSystem]['minusSign']; - $translations['Intl']['NumberFormat'] = $numberFormats[0]; - $translations['Intl']['NumberFormatNegative'] = isset($numberFormats[1]) ? $numberFormats[1] : ('-'.$numberFormats[0]); + $translations['Intl']['NumberFormatNumber'] = $unitsData['decimalFormats-numberSystem-' . $numberingSystem]['standard']; $translations['Intl']['NumberFormatPercent'] = $unitsData['percentFormats-numberSystem-' . $numberingSystem]['standard']; $output->writeln('Saved number formatting data for ' . $langCode); diff --git a/plugins/Intl/lang/am.json b/plugins/Intl/lang/am.json index 88d84d3d112b33ec3d683b4f18598ee0e4edd4e7..04f60fcd0ac57b992ab3b90c6d90937e9d42c34b 100644 --- a/plugins/Intl/lang/am.json +++ b/plugins/Intl/lang/am.json @@ -539,8 +539,7 @@ "NMinutesShort": "%s ደቂቃ", "NSeconds": "%s ሰከንዶች", "NSecondsShort": "%s ሰ", - "NumberFormat": "#,##0.###", - "NumberFormatNegative": "-#,##0.###", + "NumberFormatNumber": "#,##0.###", "NumberFormatPercent": "#,##0%", "NumberSymbolDecimal": ".", "NumberSymbolGroup": ",", diff --git a/plugins/Intl/lang/ar.json b/plugins/Intl/lang/ar.json index a951704ccec4be93eff85b6dfb1c0831c224cbf4..e0fe35ab53921285021bf63b5344d447cac13e19 100644 --- a/plugins/Intl/lang/ar.json +++ b/plugins/Intl/lang/ar.json @@ -555,8 +555,7 @@ "NMinutesShort": "%s د", "NSeconds": "%s ثانية", "NSecondsShort": "%s Ø«", - "NumberFormat": "#,##0.###", - "NumberFormatNegative": "-#,##0.###", + "NumberFormatNumber": "#,##0.###", "NumberFormatPercent": "#,##0%", "NumberSymbolDecimal": "Ù«", "NumberSymbolGroup": "Ù¬", diff --git a/plugins/Intl/lang/be.json b/plugins/Intl/lang/be.json index fa8a8a638fc07ed3d6cc3e25690b35013a5c0034..9b23011830452b38a07df6405b7fcacf20fd0d1d 100644 --- a/plugins/Intl/lang/be.json +++ b/plugins/Intl/lang/be.json @@ -516,8 +516,7 @@ "NMinutesShort": "%s хв.", "NSeconds": "%s Ñекунды", "NSecondsShort": "%sÑ", - "NumberFormat": "#,##0.###", - "NumberFormatNegative": "-#,##0.###", + "NumberFormatNumber": "#,##0.###", "NumberFormatPercent": "#,##0 %", "NumberSymbolDecimal": ",", "NumberSymbolGroup": " ", diff --git a/plugins/Intl/lang/bg.json b/plugins/Intl/lang/bg.json index 36fedf34ff5f028f5286e46c7a88e4e418fc5b7d..ea11785a82494d074e9c8ded46f6ff1d5dba177b 100644 --- a/plugins/Intl/lang/bg.json +++ b/plugins/Intl/lang/bg.json @@ -555,8 +555,7 @@ "NMinutesShort": "%s min", "NSeconds": "%s Ñекунди", "NSecondsShort": "%s s", - "NumberFormat": "#,##0.###", - "NumberFormatNegative": "-#,##0.###", + "NumberFormatNumber": "#,##0.###", "NumberFormatPercent": "#,##0%", "NumberSymbolDecimal": ",", "NumberSymbolGroup": " ", diff --git a/plugins/Intl/lang/bn.json b/plugins/Intl/lang/bn.json index ec55e36ec2749238eae17c235d17031bf4c9666e..316a8c1a6568416dabf40092739dd00b6e3343eb 100644 --- a/plugins/Intl/lang/bn.json +++ b/plugins/Intl/lang/bn.json @@ -555,8 +555,7 @@ "NMinutesShort": "%s মিনিট", "NSeconds": "%s সেকেনà§à¦¡", "NSecondsShort": "%s সেকেনà§à¦¡", - "NumberFormat": "#,##,##0.###", - "NumberFormatNegative": "-#,##,##0.###", + "NumberFormatNumber": "#,##,##0.###", "NumberFormatPercent": "#,##,##0%", "NumberSymbolDecimal": ".", "NumberSymbolGroup": ",", diff --git a/plugins/Intl/lang/bs.json b/plugins/Intl/lang/bs.json index 7b10e44f992b173a9c00ac53655750b87de8063b..a924c94b9edf4148ca3886282a9c520914a97d30 100644 --- a/plugins/Intl/lang/bs.json +++ b/plugins/Intl/lang/bs.json @@ -555,8 +555,7 @@ "NMinutesShort": "%s min", "NSeconds": "%s sekundi", "NSecondsShort": "%s sek", - "NumberFormat": "#,##0.###", - "NumberFormatNegative": "-#,##0.###", + "NumberFormatNumber": "#,##0.###", "NumberFormatPercent": "#,##0%", "NumberSymbolDecimal": ",", "NumberSymbolGroup": ".", diff --git a/plugins/Intl/lang/ca.json b/plugins/Intl/lang/ca.json index d71fe0c7c969c14317be6e2db2a57daa767649ef..76d45c21ea3d71aed86ead8d998078d29484a387 100644 --- a/plugins/Intl/lang/ca.json +++ b/plugins/Intl/lang/ca.json @@ -555,8 +555,7 @@ "NMinutesShort": "%s min", "NSeconds": "%s segons", "NSecondsShort": "%s s", - "NumberFormat": "#,##0.###", - "NumberFormatNegative": "-#,##0.###", + "NumberFormatNumber": "#,##0.###", "NumberFormatPercent": "#,##0%", "NumberSymbolDecimal": ",", "NumberSymbolGroup": ".", diff --git a/plugins/Intl/lang/cs.json b/plugins/Intl/lang/cs.json index db73f1f53995e02cb92bcfe2305fd0cb40dadf8f..a033223a2372afebf62dab2dff8b5ffc43bd391b 100644 --- a/plugins/Intl/lang/cs.json +++ b/plugins/Intl/lang/cs.json @@ -555,8 +555,7 @@ "NMinutesShort": "%s min", "NSeconds": "%s sekund", "NSecondsShort": "%s s", - "NumberFormat": "#,##0.###", - "NumberFormatNegative": "-#,##0.###", + "NumberFormatNumber": "#,##0.###", "NumberFormatPercent": "#,##0 %", "NumberSymbolDecimal": ",", "NumberSymbolGroup": " ", diff --git a/plugins/Intl/lang/cy.json b/plugins/Intl/lang/cy.json index f06ab8923a73f941e96ce47c29b94a33628d4d50..decf4b5bf017cc9f87d6936043aa2104ac4e6a71 100644 --- a/plugins/Intl/lang/cy.json +++ b/plugins/Intl/lang/cy.json @@ -549,8 +549,7 @@ "NMinutesShort": "%s mun", "NSeconds": "%s eiliad", "NSecondsShort": "%s eil", - "NumberFormat": "#,##0.###", - "NumberFormatNegative": "-#,##0.###", + "NumberFormatNumber": "#,##0.###", "NumberFormatPercent": "#,##0%", "NumberSymbolDecimal": ".", "NumberSymbolGroup": ",", diff --git a/plugins/Intl/lang/da.json b/plugins/Intl/lang/da.json index 38e0271cca566a90d3646b5ec0c85d78b406c67c..cf46661588d3cab1c875828fad645d9a8ff665a1 100644 --- a/plugins/Intl/lang/da.json +++ b/plugins/Intl/lang/da.json @@ -555,8 +555,7 @@ "NMinutesShort": "%s min.", "NSeconds": "%s sekunder", "NSecondsShort": "%s s", - "NumberFormat": "#,##0.###", - "NumberFormatNegative": "-#,##0.###", + "NumberFormatNumber": "#,##0.###", "NumberFormatPercent": "#,##0 %", "NumberSymbolDecimal": ",", "NumberSymbolGroup": ".", diff --git a/plugins/Intl/lang/de.json b/plugins/Intl/lang/de.json index b77dd668edc71b2804dcd8e28432f685b2ca1bdb..b2ebb8f027f38feedabb52a71efd20e3737578f7 100644 --- a/plugins/Intl/lang/de.json +++ b/plugins/Intl/lang/de.json @@ -555,8 +555,7 @@ "NMinutesShort": "%s Min.", "NSeconds": "%s Sekunden", "NSecondsShort": "%s s", - "NumberFormat": "#,##0.###", - "NumberFormatNegative": "-#,##0.###", + "NumberFormatNumber": "#,##0.###", "NumberFormatPercent": "#,##0 %", "NumberSymbolDecimal": ",", "NumberSymbolGroup": ".", diff --git a/plugins/Intl/lang/el.json b/plugins/Intl/lang/el.json index e83407ad6c9dced78cc9a1233ba4743a8166ad6b..7ec469b2ec0a2c04f5d5dfd747a4ce14a10da4ea 100644 --- a/plugins/Intl/lang/el.json +++ b/plugins/Intl/lang/el.json @@ -555,8 +555,7 @@ "NMinutesShort": "%s λεπ.", "NSeconds": "%s δευτεÏόλεπτα", "NSecondsShort": "%s δ", - "NumberFormat": "#,##0.###", - "NumberFormatNegative": "-#,##0.###", + "NumberFormatNumber": "#,##0.###", "NumberFormatPercent": "#,##0%", "NumberSymbolDecimal": ",", "NumberSymbolGroup": ".", diff --git a/plugins/Intl/lang/en.json b/plugins/Intl/lang/en.json index 9847168eead8fcbb6940731c51c834199a54acdc..5703605403c94fd456dc7405aa5fcbca71566909 100644 --- a/plugins/Intl/lang/en.json +++ b/plugins/Intl/lang/en.json @@ -555,8 +555,7 @@ "NMinutesShort": "%s min", "NSeconds": "%s seconds", "NSecondsShort": "%ss", - "NumberFormat": "#,##0.###", - "NumberFormatNegative": "-#,##0.###", + "NumberFormatNumber": "#,##0.###", "NumberFormatPercent": "#,##0%", "NumberSymbolDecimal": ".", "NumberSymbolGroup": ",", diff --git a/plugins/Intl/lang/es.json b/plugins/Intl/lang/es.json index 8f8c5dbb641026ee6f73eab48c5594d83cb48546..dd795468a0e19c28864df43c7de3e57663e1b441 100644 --- a/plugins/Intl/lang/es.json +++ b/plugins/Intl/lang/es.json @@ -555,8 +555,7 @@ "NMinutesShort": "%s min", "NSeconds": "%s segundos", "NSecondsShort": "%ss", - "NumberFormat": "#,##0.###", - "NumberFormatNegative": "-#,##0.###", + "NumberFormatNumber": "#,##0.###", "NumberFormatPercent": "#,##0 %", "NumberSymbolDecimal": ",", "NumberSymbolGroup": ".", diff --git a/plugins/Intl/lang/et.json b/plugins/Intl/lang/et.json index 0898d97706040b3faf6618c2f80722f2217a7617..2455275a6c793a641f70e86aee0d5d70c320941e 100644 --- a/plugins/Intl/lang/et.json +++ b/plugins/Intl/lang/et.json @@ -555,8 +555,7 @@ "NMinutesShort": "%s min", "NSeconds": "%s sekundit", "NSecondsShort": "%s s", - "NumberFormat": "#,##0.###", - "NumberFormatNegative": "-#,##0.###", + "NumberFormatNumber": "#,##0.###", "NumberFormatPercent": "#,##0%", "NumberSymbolDecimal": ",", "NumberSymbolGroup": " ", diff --git a/plugins/Intl/lang/eu.json b/plugins/Intl/lang/eu.json index 9129f21c2048c061a544ffd3f5896969c83f6980..c544e2ad4e3d9dff8aeecf0490161aa2edf67237 100644 --- a/plugins/Intl/lang/eu.json +++ b/plugins/Intl/lang/eu.json @@ -525,8 +525,7 @@ "NMinutesShort": "%s min", "NSeconds": "%s segundo", "NSecondsShort": "%s s", - "NumberFormat": "#,##0.###", - "NumberFormatNegative": "-#,##0.###", + "NumberFormatNumber": "#,##0.###", "NumberFormatPercent": "% #,##0", "NumberSymbolDecimal": ",", "NumberSymbolGroup": ".", diff --git a/plugins/Intl/lang/fa.json b/plugins/Intl/lang/fa.json index 0267f1cbee4a4d097c4b0418d123712bfd8c7a55..11132366e8f6f93c1d288f36aa247ff7d27bb80c 100644 --- a/plugins/Intl/lang/fa.json +++ b/plugins/Intl/lang/fa.json @@ -555,8 +555,7 @@ "NMinutesShort": "%s دقیقه", "NSeconds": "%s ثانیه", "NSecondsShort": "%s Ø«", - "NumberFormat": "#,##0.###", - "NumberFormatNegative": "-#,##0.###", + "NumberFormatNumber": "#,##0.###", "NumberFormatPercent": "#,##0%", "NumberSymbolDecimal": "Ù«", "NumberSymbolGroup": "Ù¬", diff --git a/plugins/Intl/lang/fi.json b/plugins/Intl/lang/fi.json index 5777563f9c1c69bfca9b3ec2c22b30d9d88fbcb2..92dde341a1f5dd3afc810ca33928557a94e5de65 100644 --- a/plugins/Intl/lang/fi.json +++ b/plugins/Intl/lang/fi.json @@ -555,8 +555,7 @@ "NMinutesShort": "%s min", "NSeconds": "%s sekuntia", "NSecondsShort": "%ss", - "NumberFormat": "#,##0.###", - "NumberFormatNegative": "-#,##0.###", + "NumberFormatNumber": "#,##0.###", "NumberFormatPercent": "#,##0 %", "NumberSymbolDecimal": ",", "NumberSymbolGroup": " ", diff --git a/plugins/Intl/lang/fr.json b/plugins/Intl/lang/fr.json index c96ac9964e66dec9cdcbb155cb326e28254a7b21..fd86bb49e49952cb8c3868bc0b87d670ed853720 100644 --- a/plugins/Intl/lang/fr.json +++ b/plugins/Intl/lang/fr.json @@ -555,8 +555,7 @@ "NMinutesShort": "%s min", "NSeconds": "%s secondes", "NSecondsShort": "%ss", - "NumberFormat": "#,##0.###", - "NumberFormatNegative": "-#,##0.###", + "NumberFormatNumber": "#,##0.###", "NumberFormatPercent": "#,##0 %", "NumberSymbolDecimal": ",", "NumberSymbolGroup": " ", diff --git a/plugins/Intl/lang/gl.json b/plugins/Intl/lang/gl.json index 53af791d8422cac26bfbbcff28e37d4808382417..d2559979c10db869f3e464c720ac19b7e3e38598 100644 --- a/plugins/Intl/lang/gl.json +++ b/plugins/Intl/lang/gl.json @@ -523,8 +523,7 @@ "NMinutesShort": "%s min", "NSeconds": "%s segundos", "NSecondsShort": "%s s", - "NumberFormat": "#,##0.###", - "NumberFormatNegative": "-#,##0.###", + "NumberFormatNumber": "#,##0.###", "NumberFormatPercent": "#,##0%", "NumberSymbolDecimal": ",", "NumberSymbolGroup": ".", diff --git a/plugins/Intl/lang/he.json b/plugins/Intl/lang/he.json index ccd7181960fd007acf7aca088a06fb82b594b189..cbd03f933bc7e6c56b3ad6b7bfa8fa76847dbaa4 100644 --- a/plugins/Intl/lang/he.json +++ b/plugins/Intl/lang/he.json @@ -555,8 +555,7 @@ "NMinutesShort": "%s דק׳", "NSeconds": "%s ×©× ×™×•×ª", "NSecondsShort": "%s ×©× ×³", - "NumberFormat": "#,##0.###", - "NumberFormatNegative": "-#,##0.###", + "NumberFormatNumber": "#,##0.###", "NumberFormatPercent": "#,##0%", "NumberSymbolDecimal": ".", "NumberSymbolGroup": ",", diff --git a/plugins/Intl/lang/hi.json b/plugins/Intl/lang/hi.json index e820bc4517aae009b08f80fb6668bc626973730a..f8b107a2934c60404e85d92ece46a62db20e8eeb 100644 --- a/plugins/Intl/lang/hi.json +++ b/plugins/Intl/lang/hi.json @@ -555,8 +555,7 @@ "NMinutesShort": "%s मि.", "NSeconds": "%s सेकंड", "NSecondsShort": "%sसे.", - "NumberFormat": "#,##,##0.###", - "NumberFormatNegative": "-#,##,##0.###", + "NumberFormatNumber": "#,##,##0.###", "NumberFormatPercent": "#,##,##0%", "NumberSymbolDecimal": ".", "NumberSymbolGroup": ",", diff --git a/plugins/Intl/lang/hr.json b/plugins/Intl/lang/hr.json index bb1881be4ebdb80d08415e4acd0c5ff3bc62e166..631a993b190fcf3cace1f365d6d72d7fc3da67fe 100644 --- a/plugins/Intl/lang/hr.json +++ b/plugins/Intl/lang/hr.json @@ -555,8 +555,7 @@ "NMinutesShort": "%s min", "NSeconds": "%s sekundi", "NSecondsShort": "%s s", - "NumberFormat": "#,##0.###", - "NumberFormatNegative": "-#,##0.###", + "NumberFormatNumber": "#,##0.###", "NumberFormatPercent": "#,##0%", "NumberSymbolDecimal": ",", "NumberSymbolGroup": ".", diff --git a/plugins/Intl/lang/hu.json b/plugins/Intl/lang/hu.json index d3176ed4ee2e481dd1fc046b5b94d454432246e3..289f60dfcb6dfd557e95fec9c5dcfdc5890e0f4e 100644 --- a/plugins/Intl/lang/hu.json +++ b/plugins/Intl/lang/hu.json @@ -555,8 +555,7 @@ "NMinutesShort": "%s min", "NSeconds": "%s másodperc", "NSecondsShort": "%s s", - "NumberFormat": "#,##0.###", - "NumberFormatNegative": "-#,##0.###", + "NumberFormatNumber": "#,##0.###", "NumberFormatPercent": "#,##0%", "NumberSymbolDecimal": ",", "NumberSymbolGroup": " ", diff --git a/plugins/Intl/lang/id.json b/plugins/Intl/lang/id.json index caec4e10b83fec2241238cb0896d0989cbd1f2a3..702377c9c7d55f12f4c4581d191cd3918c0f2dc2 100644 --- a/plugins/Intl/lang/id.json +++ b/plugins/Intl/lang/id.json @@ -555,8 +555,7 @@ "NMinutesShort": "%s mnt", "NSeconds": "%s detik", "NSecondsShort": "%s dtk", - "NumberFormat": "#,##0.###", - "NumberFormatNegative": "-#,##0.###", + "NumberFormatNumber": "#,##0.###", "NumberFormatPercent": "#,##0%", "NumberSymbolDecimal": ",", "NumberSymbolGroup": ".", diff --git a/plugins/Intl/lang/is.json b/plugins/Intl/lang/is.json index 716de6a460daca455de1124477b50ca28f12d028..179a3a5ad70cc00627673c04024c61b853c365d8 100644 --- a/plugins/Intl/lang/is.json +++ b/plugins/Intl/lang/is.json @@ -553,8 +553,7 @@ "NMinutesShort": "%s mÃn.", "NSeconds": "%s sekúndur", "NSecondsShort": "%s sek.", - "NumberFormat": "#,##0.###", - "NumberFormatNegative": "-#,##0.###", + "NumberFormatNumber": "#,##0.###", "NumberFormatPercent": "#,##0%", "NumberSymbolDecimal": ",", "NumberSymbolGroup": ".", diff --git a/plugins/Intl/lang/it.json b/plugins/Intl/lang/it.json index 2c57a591b806fe168e249086abbf37c502a53750..d4106a67e449caba5966394f8ed29d34164a2cce 100644 --- a/plugins/Intl/lang/it.json +++ b/plugins/Intl/lang/it.json @@ -555,8 +555,7 @@ "NMinutesShort": "%s min", "NSeconds": "%s secondi", "NSecondsShort": "%ss", - "NumberFormat": "#,##0.###", - "NumberFormatNegative": "-#,##0.###", + "NumberFormatNumber": "#,##0.###", "NumberFormatPercent": "#,##0%", "NumberSymbolDecimal": ",", "NumberSymbolGroup": ".", diff --git a/plugins/Intl/lang/ja.json b/plugins/Intl/lang/ja.json index 96c3981f50fa486f69063e59ca13c4df33052ef1..1237b0837b210164eec280fd50e010882827bd27 100644 --- a/plugins/Intl/lang/ja.json +++ b/plugins/Intl/lang/ja.json @@ -555,8 +555,7 @@ "NMinutesShort": "%s 分", "NSeconds": "%s ç§’", "NSecondsShort": "%sç§’", - "NumberFormat": "#,##0.###", - "NumberFormatNegative": "-#,##0.###", + "NumberFormatNumber": "#,##0.###", "NumberFormatPercent": "#,##0%", "NumberSymbolDecimal": ".", "NumberSymbolGroup": ",", diff --git a/plugins/Intl/lang/ka.json b/plugins/Intl/lang/ka.json index d719ed4b69f30278452adf931b97dc96a42ab87d..2bcae0c62c83e460c4ba9ce499891e1fc3cee9fa 100644 --- a/plugins/Intl/lang/ka.json +++ b/plugins/Intl/lang/ka.json @@ -536,8 +536,7 @@ "NMinutesShort": "%s წთ", "NSeconds": "%s წáƒáƒ›áƒ˜", "NSecondsShort": "%sწმ", - "NumberFormat": "#,##0.###", - "NumberFormatNegative": "-#,##0.###", + "NumberFormatNumber": "#,##0.###", "NumberFormatPercent": "#,##0 %", "NumberSymbolDecimal": ",", "NumberSymbolGroup": " ", diff --git a/plugins/Intl/lang/ko.json b/plugins/Intl/lang/ko.json index 7b2845c0d48a75949fca4aab0ca6d272b39110ad..e42483c59fdedd3cd81fbb489d0e0f990959ce62 100644 --- a/plugins/Intl/lang/ko.json +++ b/plugins/Intl/lang/ko.json @@ -555,8 +555,7 @@ "NMinutesShort": "%së¶„", "NSeconds": "%sì´ˆ", "NSecondsShort": "%sì´ˆ", - "NumberFormat": "#,##0.###", - "NumberFormatNegative": "-#,##0.###", + "NumberFormatNumber": "#,##0.###", "NumberFormatPercent": "#,##0%", "NumberSymbolDecimal": ".", "NumberSymbolGroup": ",", diff --git a/plugins/Intl/lang/lt.json b/plugins/Intl/lang/lt.json index bcef2fe9d8606d7871919d329238296fca30ebac..d49c6ad54e607dec0908a74f821de9318cc6b65c 100644 --- a/plugins/Intl/lang/lt.json +++ b/plugins/Intl/lang/lt.json @@ -555,8 +555,7 @@ "NMinutesShort": "%s min.", "NSeconds": "%s sekundžių", "NSecondsShort": "%s s", - "NumberFormat": "#,##0.###", - "NumberFormatNegative": "-#,##0.###", + "NumberFormatNumber": "#,##0.###", "NumberFormatPercent": "#,##0 %", "NumberSymbolDecimal": ",", "NumberSymbolGroup": " ", diff --git a/plugins/Intl/lang/lv.json b/plugins/Intl/lang/lv.json index 939de3e33270bc773866be6e7b7af31d883e125a..e5030263554e9e158ba79c27eb763028ca064d6a 100644 --- a/plugins/Intl/lang/lv.json +++ b/plugins/Intl/lang/lv.json @@ -555,8 +555,7 @@ "NMinutesShort": "%s min.", "NSeconds": "%s sekundes", "NSecondsShort": "%ss", - "NumberFormat": "#,##0.###", - "NumberFormatNegative": "-#,##0.###", + "NumberFormatNumber": "#,##0.###", "NumberFormatPercent": "#,##0%", "NumberSymbolDecimal": ",", "NumberSymbolGroup": " ", diff --git a/plugins/Intl/lang/nb.json b/plugins/Intl/lang/nb.json index 4ef7090326d3f50a1b95fa16c588241f30aa4cfc..47699e558ae5a33da638487789bf4faa533b18d9 100644 --- a/plugins/Intl/lang/nb.json +++ b/plugins/Intl/lang/nb.json @@ -555,8 +555,7 @@ "NMinutesShort": "%s min", "NSeconds": "%s sekunder", "NSecondsShort": "%ss", - "NumberFormat": "#,##0.###", - "NumberFormatNegative": "-#,##0.###", + "NumberFormatNumber": "#,##0.###", "NumberFormatPercent": "#,##0 %", "NumberSymbolDecimal": ",", "NumberSymbolGroup": " ", diff --git a/plugins/Intl/lang/nl.json b/plugins/Intl/lang/nl.json index 78df9a1aebbbb6492da4a1f3871ae2a42b6b5832..8ea4f8f24d258279fce39d9ceec9ed570c8af824 100644 --- a/plugins/Intl/lang/nl.json +++ b/plugins/Intl/lang/nl.json @@ -555,8 +555,7 @@ "NMinutesShort": "%s min", "NSeconds": "%s seconden", "NSecondsShort": "%s s", - "NumberFormat": "#,##0.###", - "NumberFormatNegative": "-#,##0.###", + "NumberFormatNumber": "#,##0.###", "NumberFormatPercent": "#,##0%", "NumberSymbolDecimal": ",", "NumberSymbolGroup": ".", diff --git a/plugins/Intl/lang/nn.json b/plugins/Intl/lang/nn.json index 243b16bddb36b4c132bbd950e923d156e3b654ef..2bbaa39b18a7676d45edc1d1b8e12b28ce54d40d 100644 --- a/plugins/Intl/lang/nn.json +++ b/plugins/Intl/lang/nn.json @@ -551,8 +551,7 @@ "NMinutesShort": "%s min", "NSeconds": "%s s", "NSecondsShort": "%s s", - "NumberFormat": "#,##0.###", - "NumberFormatNegative": "-#,##0.###", + "NumberFormatNumber": "#,##0.###", "NumberFormatPercent": "#,##0 %", "NumberSymbolDecimal": ",", "NumberSymbolGroup": " ", diff --git a/plugins/Intl/lang/pl.json b/plugins/Intl/lang/pl.json index a4dc8c2777a72236c370b11504a8c3bd7e0785c2..779af3f6b253d0e2bce665bf06f558fca0b76029 100644 --- a/plugins/Intl/lang/pl.json +++ b/plugins/Intl/lang/pl.json @@ -555,8 +555,7 @@ "NMinutesShort": "%s min", "NSeconds": "%s sekundy", "NSecondsShort": "%s s", - "NumberFormat": "#,##0.###", - "NumberFormatNegative": "-#,##0.###", + "NumberFormatNumber": "#,##0.###", "NumberFormatPercent": "#,##0%", "NumberSymbolDecimal": ",", "NumberSymbolGroup": " ", diff --git a/plugins/Intl/lang/pt-br.json b/plugins/Intl/lang/pt-br.json index 53e2a69cffb516901a2562a295ad8fd6d0d85a1e..2fb5c928d62e2ce734b348c7898f3ca422384839 100644 --- a/plugins/Intl/lang/pt-br.json +++ b/plugins/Intl/lang/pt-br.json @@ -555,8 +555,7 @@ "NMinutesShort": "%s min", "NSeconds": "%s segundos", "NSecondsShort": "%s s", - "NumberFormat": "#,##0.###", - "NumberFormatNegative": "-#,##0.###", + "NumberFormatNumber": "#,##0.###", "NumberFormatPercent": "#,##0%", "NumberSymbolDecimal": ",", "NumberSymbolGroup": ".", diff --git a/plugins/Intl/lang/pt.json b/plugins/Intl/lang/pt.json index efb466668863180ee9e766dc3ba3ae30091895bc..5391e1548713281ebdfce3c211a98c1b4d4699df 100644 --- a/plugins/Intl/lang/pt.json +++ b/plugins/Intl/lang/pt.json @@ -555,8 +555,7 @@ "NMinutesShort": "%s min", "NSeconds": "%s segundos", "NSecondsShort": "%s s", - "NumberFormat": "#,##0.###", - "NumberFormatNegative": "-#,##0.###", + "NumberFormatNumber": "#,##0.###", "NumberFormatPercent": "#,##0%", "NumberSymbolDecimal": ",", "NumberSymbolGroup": " ", diff --git a/plugins/Intl/lang/ro.json b/plugins/Intl/lang/ro.json index 74f4db292a56ea1e3c5fa88765c2261b2c8d792a..90d7a0bf0de1c3ab3bb4f51aafa84b8f2e31e708 100644 --- a/plugins/Intl/lang/ro.json +++ b/plugins/Intl/lang/ro.json @@ -555,8 +555,7 @@ "NMinutesShort": "%s min.", "NSeconds": "%s de secunde", "NSecondsShort": "%s s", - "NumberFormat": "#,##0.###", - "NumberFormatNegative": "-#,##0.###", + "NumberFormatNumber": "#,##0.###", "NumberFormatPercent": "#,##0 %", "NumberSymbolDecimal": ",", "NumberSymbolGroup": ".", diff --git a/plugins/Intl/lang/ru.json b/plugins/Intl/lang/ru.json index 2c3cc02555483d7196392aca5188e342bf1a103e..e4f78b451336538594ed980865979eb9572a31eb 100644 --- a/plugins/Intl/lang/ru.json +++ b/plugins/Intl/lang/ru.json @@ -555,8 +555,7 @@ "NMinutesShort": "%s мин", "NSeconds": "%s Ñекунды", "NSecondsShort": "%s Ñ", - "NumberFormat": "#,##0.###", - "NumberFormatNegative": "-#,##0.###", + "NumberFormatNumber": "#,##0.###", "NumberFormatPercent": "#,##0 %", "NumberSymbolDecimal": ",", "NumberSymbolGroup": " ", diff --git a/plugins/Intl/lang/sk.json b/plugins/Intl/lang/sk.json index 0b18395e651da8d420fa19f2a0542a8eb1847add..2dd65c73976cb95a803d4282b6c78c0e893698cb 100644 --- a/plugins/Intl/lang/sk.json +++ b/plugins/Intl/lang/sk.json @@ -555,8 +555,7 @@ "NMinutesShort": "%s min", "NSeconds": "%s sekúnd", "NSecondsShort": "%s s", - "NumberFormat": "#,##0.###", - "NumberFormatNegative": "-#,##0.###", + "NumberFormatNumber": "#,##0.###", "NumberFormatPercent": "#,##0 %", "NumberSymbolDecimal": ",", "NumberSymbolGroup": " ", diff --git a/plugins/Intl/lang/sl.json b/plugins/Intl/lang/sl.json index 8eb7e00cfef6acfaad33a6fad2965018a0c1272b..748bbc35923da02e9c512bb22e4f83d54cf5adce 100644 --- a/plugins/Intl/lang/sl.json +++ b/plugins/Intl/lang/sl.json @@ -553,8 +553,7 @@ "NMinutesShort": "%s min", "NSeconds": "%s sekund", "NSecondsShort": "%s s", - "NumberFormat": "#,##0.###", - "NumberFormatNegative": "-#,##0.###", + "NumberFormatNumber": "#,##0.###", "NumberFormatPercent": "#,##0%", "NumberSymbolDecimal": ",", "NumberSymbolGroup": ".", diff --git a/plugins/Intl/lang/sq.json b/plugins/Intl/lang/sq.json index 22d4471d399770b2448a57baec0e6c76459ae062..b54d001958066e765b5c72452c33e408aabb0b2b 100644 --- a/plugins/Intl/lang/sq.json +++ b/plugins/Intl/lang/sq.json @@ -507,8 +507,7 @@ "NMinutesShort": "%s min.", "NSeconds": "%s sekonda", "NSecondsShort": "%s sek.", - "NumberFormat": "#,##0.###", - "NumberFormatNegative": "-#,##0.###", + "NumberFormatNumber": "#,##0.###", "NumberFormatPercent": "#,##0%", "NumberSymbolDecimal": ",", "NumberSymbolGroup": " ", diff --git a/plugins/Intl/lang/sr.json b/plugins/Intl/lang/sr.json index b5c090b680479597813acb53cec22ca06856cb0f..8d9ef651003c271d813572f6858c350d1d273be6 100644 --- a/plugins/Intl/lang/sr.json +++ b/plugins/Intl/lang/sr.json @@ -555,8 +555,7 @@ "NMinutesShort": "%s мин", "NSeconds": "%s Ñекунди", "NSecondsShort": "%s Ñек", - "NumberFormat": "#,##0.###", - "NumberFormatNegative": "-#,##0.###", + "NumberFormatNumber": "#,##0.###", "NumberFormatPercent": "#,##0%", "NumberSymbolDecimal": ",", "NumberSymbolGroup": ".", diff --git a/plugins/Intl/lang/sv.json b/plugins/Intl/lang/sv.json index 5188d9eb886cc9cc45a160411dceb1736f5419e1..c92a3e1ebfb1613021aaf18c03e434c874bb95e0 100644 --- a/plugins/Intl/lang/sv.json +++ b/plugins/Intl/lang/sv.json @@ -555,8 +555,7 @@ "NMinutesShort": "%s min", "NSeconds": "%s sekunder", "NSecondsShort": "%ss", - "NumberFormat": "#,##0.###", - "NumberFormatNegative": "-#,##0.###", + "NumberFormatNumber": "#,##0.###", "NumberFormatPercent": "#,##0 %", "NumberSymbolDecimal": ",", "NumberSymbolGroup": " ", diff --git a/plugins/Intl/lang/ta.json b/plugins/Intl/lang/ta.json index 8b5a6cb4f5a035dd7a02a3273d650a548a11d51f..477950426beac6533cd0da9a23b7a845ef67e7eb 100644 --- a/plugins/Intl/lang/ta.json +++ b/plugins/Intl/lang/ta.json @@ -555,8 +555,7 @@ "NMinutesShort": "%s நிமிட", "NSeconds": "%s விநாடிகளà¯", "NSecondsShort": "%s வி.", - "NumberFormat": "#,##,##0.###", - "NumberFormatNegative": "-#,##,##0.###", + "NumberFormatNumber": "#,##,##0.###", "NumberFormatPercent": "#,##,##0%", "NumberSymbolDecimal": ".", "NumberSymbolGroup": ",", diff --git a/plugins/Intl/lang/te.json b/plugins/Intl/lang/te.json index d7d87bba08f20ca31fec7992bdad28dff1b8fc58..fc54933b619d019e93a40e25e995e67619ecf5aa 100644 --- a/plugins/Intl/lang/te.json +++ b/plugins/Intl/lang/te.json @@ -555,8 +555,7 @@ "NMinutesShort": "%s నిమి.", "NSeconds": "%s సెకనà±à°²à±", "NSecondsShort": "%sసె", - "NumberFormat": "#,##,##0.###", - "NumberFormatNegative": "-#,##,##0.###", + "NumberFormatNumber": "#,##,##0.###", "NumberFormatPercent": "#,##0%", "NumberSymbolDecimal": ".", "NumberSymbolGroup": ",", diff --git a/plugins/Intl/lang/th.json b/plugins/Intl/lang/th.json index 68ff72125a561775556d7e316883c3e6e7e2ffd1..0f827fac7260c1e54bf430806f7ba7594f1ecae1 100644 --- a/plugins/Intl/lang/th.json +++ b/plugins/Intl/lang/th.json @@ -555,8 +555,7 @@ "NMinutesShort": "%s นาที", "NSeconds": "%s วินาที", "NSecondsShort": "%sวิ", - "NumberFormat": "#,##0.###", - "NumberFormatNegative": "-#,##0.###", + "NumberFormatNumber": "#,##0.###", "NumberFormatPercent": "#,##0%", "NumberSymbolDecimal": ".", "NumberSymbolGroup": ",", diff --git a/plugins/Intl/lang/tl.json b/plugins/Intl/lang/tl.json index 467e9e36e640580c7c5d0a0b868ecab74b9af089..71abdf6151d2d47486bc44545537e0d55ac5f548 100644 --- a/plugins/Intl/lang/tl.json +++ b/plugins/Intl/lang/tl.json @@ -525,8 +525,7 @@ "NMinutesShort": "%s min.", "NSeconds": "%s na segundo", "NSecondsShort": "%ss", - "NumberFormat": "#,##0.###", - "NumberFormatNegative": "-#,##0.###", + "NumberFormatNumber": "#,##0.###", "NumberFormatPercent": "#,##0%", "NumberSymbolDecimal": ".", "NumberSymbolGroup": ",", diff --git a/plugins/Intl/lang/tr.json b/plugins/Intl/lang/tr.json index 8540c8879709fb8bc24af15978895da49c3f4f59..7a0ae90c1ce1b8ed829aa9491a6d3630988ce5f0 100644 --- a/plugins/Intl/lang/tr.json +++ b/plugins/Intl/lang/tr.json @@ -555,8 +555,7 @@ "NMinutesShort": "%s dk.", "NSeconds": "%s saniye", "NSecondsShort": "%ssn", - "NumberFormat": "#,##0.###", - "NumberFormatNegative": "-#,##0.###", + "NumberFormatNumber": "#,##0.###", "NumberFormatPercent": "%#,##0", "NumberSymbolDecimal": ",", "NumberSymbolGroup": ".", diff --git a/plugins/Intl/lang/uk.json b/plugins/Intl/lang/uk.json index a0b5df3c274fb2ed07b78c28f7fa72b492472ec8..cdc38219de954d0a8e9fe9f449f60436af1bafb5 100644 --- a/plugins/Intl/lang/uk.json +++ b/plugins/Intl/lang/uk.json @@ -555,8 +555,7 @@ "NMinutesShort": "%s хв", "NSeconds": "%s Ñекунди", "NSecondsShort": "%s Ñ", - "NumberFormat": "#,##0.###", - "NumberFormatNegative": "-#,##0.###", + "NumberFormatNumber": "#,##0.###", "NumberFormatPercent": "#,##0%", "NumberSymbolDecimal": ",", "NumberSymbolGroup": " ", diff --git a/plugins/Intl/lang/vi.json b/plugins/Intl/lang/vi.json index 2510231ab3ce59d730c687ffa73eb2aa47484dd8..cfaa3366356fe0304fa79adc1414fd124030b7b9 100644 --- a/plugins/Intl/lang/vi.json +++ b/plugins/Intl/lang/vi.json @@ -555,8 +555,7 @@ "NMinutesShort": "%s phút", "NSeconds": "%s giây", "NSecondsShort": "%s giây", - "NumberFormat": "#,##0.###", - "NumberFormatNegative": "-#,##0.###", + "NumberFormatNumber": "#,##0.###", "NumberFormatPercent": "#,##0%", "NumberSymbolDecimal": ",", "NumberSymbolGroup": ".", diff --git a/plugins/Intl/lang/zh-cn.json b/plugins/Intl/lang/zh-cn.json index 414f9c0776f19bab981dcf0c45bbb8ba91b7de55..be2870510633560dc26155114addf40c945349e3 100644 --- a/plugins/Intl/lang/zh-cn.json +++ b/plugins/Intl/lang/zh-cn.json @@ -555,8 +555,7 @@ "NMinutesShort": "%s分钟", "NSeconds": "%sç§’é’Ÿ", "NSecondsShort": "%sç§’", - "NumberFormat": "#,##0.###", - "NumberFormatNegative": "-#,##0.###", + "NumberFormatNumber": "#,##0.###", "NumberFormatPercent": "#,##0%", "NumberSymbolDecimal": ".", "NumberSymbolGroup": ",", diff --git a/plugins/Intl/lang/zh-tw.json b/plugins/Intl/lang/zh-tw.json index 3ac8261ab0c5f44ce0ebf5765e0ade97d0b15de6..7084fe5d5998ceb0a6dc4d4c9b416e5e97549b9d 100644 --- a/plugins/Intl/lang/zh-tw.json +++ b/plugins/Intl/lang/zh-tw.json @@ -555,8 +555,7 @@ "NMinutesShort": "%s 分é˜", "NSeconds": "%s ç§’", "NSecondsShort": "%sç§’", - "NumberFormat": "#,##0.###", - "NumberFormatNegative": "-#,##0.###", + "NumberFormatNumber": "#,##0.###", "NumberFormatPercent": "#,##0%", "NumberSymbolDecimal": ".", "NumberSymbolGroup": ",", diff --git a/plugins/Morpheus/templates/_jsGlobalVariables.twig b/plugins/Morpheus/templates/_jsGlobalVariables.twig index ed38f98e67763172136b9f992548bd5496161faa..9602890c16870bd5253ae54fc4af782bbf1aac3c 100644 --- a/plugins/Morpheus/templates/_jsGlobalVariables.twig +++ b/plugins/Morpheus/templates/_jsGlobalVariables.twig @@ -5,8 +5,7 @@ piwik.cacheBuster = "{{ cacheBuster }}"; piwik.numbers = { - patternPositive: "{{ 'Intl_NumberFormat'|translate }}", - patternNegative: "{{ 'Intl_NumberFormatNegative'|translate }}", + patternNumber: "{{ 'Intl_NumberFormatNumber'|translate }}", patternPercent: "{{ 'Intl_NumberFormatPercent'|translate }}", symbolPlus: "{{ 'Intl_NumberSymbolPlus'|translate }}", symbolMinus: "{{ 'Intl_NumberSymbolMinus'|translate }}", diff --git a/plugins/MultiSites/tests/Integration/DashboardTest.php b/plugins/MultiSites/tests/Integration/DashboardTest.php index ca59b119d59332abc21e820359d78d846ac1cb78..7c79ce93e98d4fee0ba033bbe68ec146328a62b4 100644 --- a/plugins/MultiSites/tests/Integration/DashboardTest.php +++ b/plugins/MultiSites/tests/Integration/DashboardTest.php @@ -13,6 +13,7 @@ use Piwik\Period; use Piwik\Plugins\MultiSites\Dashboard; use Piwik\Tests\Framework\Fixture; use Piwik\Tests\Framework\TestCase\IntegrationTestCase; +use Piwik\Translate; /** * @group MultiSites @@ -37,6 +38,8 @@ class DashboardTest extends IntegrationTestCase Fixture::createWebsite('2012-12-12 00:00:00', $ecommerce = 0, 'Site ' . $i); } + Translate::loadAllTranslations(); + $this->dashboard = $this->getMockBuilder('Piwik\Plugins\MultiSites\Dashboard') ->setMethods(null) ->disableOriginalConstructor() diff --git a/tests/PHPUnit/Unit/Metrics/FormatterTest.php b/tests/PHPUnit/Unit/Metrics/FormatterTest.php index f0f1e618a9e84ec6456dfe1ef3ed3080ed4bed80..e0ecfacccd0982427e23ebe0c60a07e6e1c825cf 100644 --- a/tests/PHPUnit/Unit/Metrics/FormatterTest.php +++ b/tests/PHPUnit/Unit/Metrics/FormatterTest.php @@ -7,7 +7,7 @@ */ namespace Piwik\Tests\Unit\Metrics; -use Piwik\Intl\Locale; +use Piwik\Container\StaticContainer; use Piwik\Metrics\Formatter; use Piwik\Translate; use Piwik\Plugins\SitesManager\API as SitesManagerAPI; @@ -57,6 +57,7 @@ class FormatterTest extends \PHPUnit_Framework_TestCase public function tearDown() { + StaticContainer::get('Piwik\NumberFormatter')->unsetInstance(); Translate::reset(); $this->unsetSiteManagerApiMock(); } @@ -74,13 +75,8 @@ class FormatterTest extends \PHPUnit_Framework_TestCase */ public function test_getPrettyNumber_ReturnsCorrectResult_WhenLocaleIsEuropean($number, $expected) { - $locale = setlocale(LC_ALL, array('de-AT', 'de_DE', 'de', 'ge', 'de_DE.utf8')); - if (empty($locale)) { - $this->markTestSkipped("de_DE locale is not present on this system"); - } - + StaticContainer::get('Piwik\Translation\Translator')->setCurrentLanguage('de'); $this->assertEquals($expected, $this->formatter->getPrettyNumber($number, 2)); - Locale::setDefaultLocale(); } /** @@ -137,12 +133,11 @@ class FormatterTest extends \PHPUnit_Framework_TestCase public function getPrettyNumberLocaleTestData() { return array( - array(0.14, '0,14'), - array(0.14567, '0,15'), - array(100.1234, '100,12'), - // Those last two are commented because locales are platform dependent, on some platforms the separator is '' instead of '.' -// array(1000.45, '1.000,45'), -// array(23456789.00, '23.456.789,00'), + array(0.14, '0.14'), + array(0.14567, '0.15'), + array(100.1234, '100.12'), + array(1000.45, '1,000.45'), + array(23456789.00, '23,456,789.00'), ); }