diff options
author | RedMatrix <info@friendica.com> | 2014-12-31 10:44:49 +1100 |
---|---|---|
committer | RedMatrix <info@friendica.com> | 2014-12-31 10:44:49 +1100 |
commit | a54f168463abd0657d28bd0223b1b6907fd7bdb3 (patch) | |
tree | fdf7577c0b602a1f8b86401572e53cfe90cf2474 /library/intl/src/NumberFormat | |
parent | ae9d08267c632cae36a4ebd34c2077fd0051e0e7 (diff) | |
parent | 4f35efa0bad4ae6489b63f3eebafe6542d654094 (diff) | |
download | volse-hubzilla-a54f168463abd0657d28bd0223b1b6907fd7bdb3.tar.gz volse-hubzilla-a54f168463abd0657d28bd0223b1b6907fd7bdb3.tar.bz2 volse-hubzilla-a54f168463abd0657d28bd0223b1b6907fd7bdb3.zip |
Merge pull request #798 from friendica/revert-794-lang
Revert "Language names via intl library."
Diffstat (limited to 'library/intl/src/NumberFormat')
4 files changed, 0 insertions, 560 deletions
diff --git a/library/intl/src/NumberFormat/NumberFormat.php b/library/intl/src/NumberFormat/NumberFormat.php deleted file mode 100644 index 0c512b7ab..000000000 --- a/library/intl/src/NumberFormat/NumberFormat.php +++ /dev/null @@ -1,269 +0,0 @@ -<?php - -namespace CommerceGuys\Intl\NumberFormat; - -class NumberFormat implements NumberFormatInterface -{ - /** - * The locale (i.e. "en_US"). - * - * @var string - */ - protected $locale; - - /** - * The numbering system. - * - * @var string - */ - protected $numberingSystem = array(); - - /** - * The decimal separator. - * - * @var string - */ - protected $decimalSeparator = array(); - - /** - * The grouping separator. - * - * @var string - */ - protected $groupingSeparator = array(); - - /** - * The plus sign. - * - * @var string - */ - protected $plusSign = array(); - - /** - * The number symbols. - * - * @var string - */ - protected $minusSign = array(); - - /** - * The percent sign. - * - * @var string - */ - protected $percentSign = array(); - - /** - * The number pattern used to format decimal numbers. - * - * @var string - */ - protected $decimalPattern; - - /** - * The number pattern used to format percentages. - * - * @var string - */ - protected $percentPattern; - - /** - * The number pattern used to format currency amounts. - * - * @var string - */ - protected $currencyPattern; - - /** - * The number pattern used to format accounting currency amounts. - * - * @var string - */ - protected $accountingCurrencyPattern; - - /** - * {@inheritdoc} - */ - public function getLocale() - { - return $this->locale; - } - - /** - * {@inheritdoc} - */ - public function setLocale($locale) - { - $this->locale = $locale; - - return $this; - } - - /** - * {@inheritdoc} - */ - public function getNumberingSystem() - { - return $this->numberingSystem; - } - - /** - * {@inheritdoc} - */ - public function setNumberingSystem($numberingSystem) - { - $this->numberingSystem = $numberingSystem; - } - - /** - * {@inheritdoc} - */ - public function getDecimalSeparator() - { - return $this->decimalSeparator; - } - - /** - * {@inheritdoc} - */ - public function setDecimalSeparator($decimalSeparator) - { - $this->decimalSeparator = $decimalSeparator; - } - - /** - * {@inheritdoc} - */ - public function getGroupingSeparator() - { - return $this->groupingSeparator; - } - - /** - * {@inheritdoc} - */ - public function setGroupingSeparator($groupingSeparator) - { - $this->groupingSeparator = $groupingSeparator; - } - - /** - * {@inheritdoc} - */ - public function getPlusSign() - { - return $this->plusSign; - } - - /** - * {@inheritdoc} - */ - public function setPlusSign($plusSign) - { - $this->plusSign = $plusSign; - } - - /** - * {@inheritdoc} - */ - public function getMinusSign() - { - return $this->minusSign; - } - - /** - * {@inheritdoc} - */ - public function setMinusSign($minusSign) - { - $this->minusSign = $minusSign; - } - - /** - * {@inheritdoc} - */ - public function getPercentSign() - { - return $this->percentSign; - } - - /** - * {@inheritdoc} - */ - public function setPercentSign($percentSign) - { - $this->percentSign = $percentSign; - } - - /** - * {@inheritdoc} - */ - public function getDecimalPattern() - { - return $this->decimalPattern; - } - - /** - * {@inheritdoc} - */ - public function setDecimalPattern($decimalPattern) - { - $this->decimalPattern = $decimalPattern; - - return $this; - } - - /** - * {@inheritdoc} - */ - public function getPercentPattern() - { - return $this->percentPattern; - } - - /** - * {@inheritdoc} - */ - public function setPercentPattern($percentPattern) - { - $this->percentPattern = $percentPattern; - - return $this; - } - - /** - * {@inheritdoc} - */ - public function getCurrencyPattern() - { - return $this->currencyPattern; - } - - /** - * {@inheritdoc} - */ - public function setCurrencyPattern($currencyPattern) - { - $this->currencyPattern = $currencyPattern; - - return $this; - } - - /** - * {@inheritdoc} - */ - public function getAccountingCurrencyPattern() - { - return $this->accountingCurrencyPattern; - } - - /** - * {@inheritdoc} - */ - public function setAccountingCurrencyPattern($accountingCurrencyPattern) - { - $this->accountingCurrencyPattern = $accountingCurrencyPattern; - - return $this; - } -} diff --git a/library/intl/src/NumberFormat/NumberFormatInterface.php b/library/intl/src/NumberFormat/NumberFormatInterface.php deleted file mode 100644 index fa382df70..000000000 --- a/library/intl/src/NumberFormat/NumberFormatInterface.php +++ /dev/null @@ -1,185 +0,0 @@ -<?php - -namespace CommerceGuys\Intl\NumberFormat; - -interface NumberFormatInterface -{ - // Arabic-Indic digits. - const NUMBERING_SYSTEM_ARABIC = 'arab'; - // Extended Arabic-Indic digits. - const NUMBERING_SYSTEM_ARABIC_EXTENDED = 'arabext'; - // Bengali digits. - const NUMBERING_SYSTEM_BENGALI = 'beng'; - // Devanagari digits. - const NUMBERING_SYSTEM_DEVANAGARI = 'deva'; - // Latin digits - const NUMBERING_SYSTEM_LATIN = 'latn'; - - /** - * Gets the locale. - * - * @return string - */ - public function getLocale(); - - /** - * Sets the locale. - * - * @param string $locale The locale (i.e. "en_US"). - */ - public function setLocale($locale); - - /** - * Gets the numbering system. - * - * The value is one of the NUMBERING_SYSTEM_ constants. - * - * @return string - */ - public function getNumberingSystem(); - - /** - * Sets the numbering system. - * - * @param string $numberingSystem One of the NUMBERING_SYSTEM_ constants. - */ - public function setNumberingSystem($numberingSystem); - - /** - * Gets the decimal separator. - * - * @return string - */ - public function getDecimalSeparator(); - - /** - * Sets the decimal separator. - * - * @var string $decimalSeparator - */ - public function setDecimalSeparator($decimalSeparator); - - /** - * Gets the grouping separator. - * - * @return string - */ - public function getGroupingSeparator(); - - /** - * Sets the grouping separator. - * - * @var string $groupingSeparator - */ - public function setGroupingSeparator($groupingSeparator); - - /** - * Gets the plus sign. - * - * @return string - */ - public function getPlusSign(); - - /** - * Sets the plus sign. - * - * @var string $plusSign - */ - public function setPlusSign($plusSign); - - /** - * Gets the minus sign. - * - * @return string - */ - public function getMinusSign(); - - /** - * Sets the minus sign. - * - * @var string $minusSign - */ - public function setMinusSign($minusSign); - - /** - * Gets the percent sign. - * - * @return string - */ - public function getPercentSign(); - - /** - * Sets the percent sign. - * - * @var string $percentSign - */ - public function setPercentSign($percentSign); - - /** - * Gets the number pattern used to format decimal numbers. - * - * @return string - * - * @see http://cldr.unicode.org/translation/number-patterns - */ - public function getDecimalPattern(); - - /** - * Sets the number pattern used to format decimal numbers. - * - * @param string $decimalPattern The decimal pattern. - */ - public function setDecimalPattern($decimalPattern); - - /** - * Gets the number pattern used to format percentages. - * - * @return string - * - * @see http://cldr.unicode.org/translation/number-patterns - */ - public function getPercentPattern(); - - /** - * Sets the number pattern used to format percentages. - * - * @param string $percentPattern The percent pattern. - */ - public function setPercentPattern($percentPattern); - - /** - * Gets the number pattern used to format currency amounts. - * - * @return string - * - * @see http://cldr.unicode.org/translation/number-patterns - */ - public function getCurrencyPattern(); - - /** - * Sets the number pattern used to format currency amounts. - * - * @param string $currencyPattern The currency pattern. - */ - public function setCurrencyPattern($currencyPattern); - - /** - * Gets the number pattern used to format accounting currency amounts. - * - * Most commonly used when formatting amounts on invoices. - * - * @return string - * - * @see http://cldr.unicode.org/translation/number-patterns - */ - public function getAccountingCurrencyPattern(); - - /** - * Sets the number pattern used to format accounting currency amounts. - * - * Most commonly used when formatting amounts on invoices. - * - * @param string $accountingCurrencyPattern The accounting currency pattern. - */ - public function setAccountingCurrencyPattern($accountingCurrencyPattern); -} diff --git a/library/intl/src/NumberFormat/NumberFormatRepository.php b/library/intl/src/NumberFormat/NumberFormatRepository.php deleted file mode 100644 index 29a597906..000000000 --- a/library/intl/src/NumberFormat/NumberFormatRepository.php +++ /dev/null @@ -1,87 +0,0 @@ -<?php - -namespace CommerceGuys\Intl\NumberFormat; - -use CommerceGuys\Intl\LocaleResolverTrait; - -/** - * Repository for number formats based on JSON definitions. - */ -class NumberFormatRepository implements NumberFormatRepositoryInterface -{ - use LocaleResolverTrait; - - /** - * Number format definitions. - * - * @var array - */ - protected $definitions = array(); - - /** - * Creates a NumberFormatRepository instance. - * - * @param string $definitionPath The path to the number format definitions. - * Defaults to 'resources/number_format'. - */ - public function __construct($definitionPath = null) - { - $this->definitionPath = $definitionPath ? $definitionPath : __DIR__ . '/../../resources/number_format/'; - } - - /** - * {@inheritdoc} - */ - public function get($locale, $fallbackLocale = null) - { - $locale = $this->resolveLocale($locale, $fallbackLocale); - if (!isset($this->definitions[$locale])) { - $filename = $this->definitionPath . $locale . '.json'; - $this->definitions[$locale] = json_decode(file_get_contents($filename), true); - } - - return $this->createNumberFormatFromDefinition($this->definitions[$locale], $locale); - } - - /** - * Creates a number format object from the provided definition. - * - * @param array $definition The number format definition. - * @param string $locale The locale of the number format definition. - * - * @return NumberFormat - */ - protected function createNumberFormatFromDefinition(array $definition, $locale) - { - if (!isset($definition['decimal_separator'])) { - $definition['decimal_separator'] = '.'; - } - if (!isset($definition['grouping_separator'])) { - $definition['grouping_separator'] = ','; - } - if (!isset($definition['plus_sign'])) { - $definition['plus_sign'] = '+'; - } - if (!isset($definition['minus_sign'])) { - $definition['minus_sign'] = '-'; - } - if (!isset($definition['percent_sign'])) { - $definition['percent_sign'] = '%'; - } - - $numberFormat = new NumberFormat(); - $numberFormat->setLocale($locale); - $numberFormat->setNumberingSystem($definition['numbering_system']); - $numberFormat->setDecimalSeparator($definition['decimal_separator']); - $numberFormat->setGroupingSeparator($definition['grouping_separator']); - $numberFormat->setPlusSign($definition['plus_sign']); - $numberFormat->setMinusSign($definition['minus_sign']); - $numberFormat->setPercentSign($definition['percent_sign']); - $numberFormat->setDecimalPattern($definition['decimal_pattern']); - $numberFormat->setPercentPattern($definition['percent_pattern']); - $numberFormat->setCurrencyPattern($definition['currency_pattern']); - $numberFormat->setAccountingCurrencyPattern($definition['accounting_currency_pattern']); - - return $numberFormat; - } -} diff --git a/library/intl/src/NumberFormat/NumberFormatRepositoryInterface.php b/library/intl/src/NumberFormat/NumberFormatRepositoryInterface.php deleted file mode 100644 index ff162b522..000000000 --- a/library/intl/src/NumberFormat/NumberFormatRepositoryInterface.php +++ /dev/null @@ -1,19 +0,0 @@ -<?php - -namespace CommerceGuys\Intl\NumberFormat; - -/** - * Number format repository interface. - */ -interface NumberFormatRepositoryInterface -{ - /** - * Returns a number format instance for the provided locale. - * - * @param string $locale The locale (i.e. fr-FR). - * @param string $fallbackLocale A fallback locale (i.e "en"). - * - * @return NumberFormatInterface - */ - public function get($locale, $fallbackLocale = null); -} |