From 580c3f4ffe9608d2beb56d418c68b3b112420e76 Mon Sep 17 00:00:00 2001 From: Mario Date: Sun, 10 Nov 2019 12:49:51 +0000 Subject: another bulk of composer updates (cherry picked from commit 6685381fd8db507493c3d7c1793f8c05c681bbce) --- .../intl/scripts/number_format/generate.php | 132 --------------------- 1 file changed, 132 deletions(-) delete mode 100644 vendor/commerceguys/intl/scripts/number_format/generate.php (limited to 'vendor/commerceguys/intl/scripts/number_format/generate.php') diff --git a/vendor/commerceguys/intl/scripts/number_format/generate.php b/vendor/commerceguys/intl/scripts/number_format/generate.php deleted file mode 100644 index 6809c980f..000000000 --- a/vendor/commerceguys/intl/scripts/number_format/generate.php +++ /dev/null @@ -1,132 +0,0 @@ - $numberingSystem, - 'decimal_pattern' => $data['decimalFormats-numberSystem-' . $numberingSystem]['standard'], - 'percent_pattern' => $data['percentFormats-numberSystem-' . $numberingSystem]['standard'], - 'currency_pattern' => $data['currencyFormats-numberSystem-' . $numberingSystem]['standard'], - 'accounting_currency_pattern' => $data['currencyFormats-numberSystem-' . $numberingSystem]['accounting'], - ]; - - // Add the symbols only if they're different from the default data. - $decimalSeparator = $data['symbols-numberSystem-' . $numberingSystem]['decimal']; - $groupingSeparator = $data['symbols-numberSystem-' . $numberingSystem]['group']; - $plusSign = $data['symbols-numberSystem-' . $numberingSystem]['plusSign']; - $minusSign = $data['symbols-numberSystem-' . $numberingSystem]['minusSign']; - $percentSign = $data['symbols-numberSystem-' . $numberingSystem]['percentSign']; - if ($decimalSeparator != '.') { - $numberFormats[$locale]['decimal_separator'] = $decimalSeparator; - } - if ($groupingSeparator != ',') { - $numberFormats[$locale]['grouping_separator'] = $groupingSeparator; - } - if ($plusSign != '+') { - $numberFormats[$locale]['plus_sign'] = $plusSign; - } - if ($minusSign != '-') { - $numberFormats[$locale]['minus_sign'] = $minusSign; - } - if ($percentSign != '%') { - $numberFormats[$locale]['percent_sign'] = $percentSign; - } -} - -// Identify localizations that are the same as the ones for the parent locale. -// For example, "fr-FR" if "fr" has the same data. -$duplicates = []; -foreach ($numberFormats as $locale => $formatData) { - if (strpos($locale, '-') !== false) { - $localeParts = explode('-', $locale); - array_pop($localeParts); - $parentLocale = implode('-', $localeParts); - $diff = array_diff_assoc($formatData, $numberFormats[$parentLocale]); - - if (empty($diff)) { - // The duplicates are not removed right away because they might - // still be needed for other duplicate checks (for example, - // when there are locales like bs-Latn-BA, bs-Latn, bs). - $duplicates[] = $locale; - } - } -} -// Remove the duplicates. -foreach ($duplicates as $locale) { - unset($numberFormats[$locale]); -} - -// Write out the data. -foreach ($numberFormats as $locale => $numberFormat) { - file_put_json($locale . '.json', $numberFormat); -} - -/** - * Converts the provided data into json and writes it to the disk. - */ -function file_put_json($filename, $data) -{ - $data = json_encode($data, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE); - // Indenting with tabs instead of 4 spaces gives us 20% smaller files. - $data = str_replace(' ', "\t", $data); - file_put_contents($filename, $data); -} -- cgit v1.2.3