| @@ 26-36 (lines=11) @@ | ||
| 23 | ||
| 24 | private $currencyFormatter; |
|
| 25 | ||
| 26 | public function __construct(\NumberFormatter $currencyFormatter = null) |
|
| 27 | { |
|
| 28 | if (!$currencyFormatter) { |
|
| 29 | $currencyFormatter = new \NumberFormatter('en', \NumberFormatter::CURRENCY); |
|
| 30 | $currencyFormatter->setSymbol(\NumberFormatter::CURRENCY_SYMBOL, ''); |
|
| 31 | $currencyFormatter->setSymbol(\NumberFormatter::INTL_CURRENCY_SYMBOL, ''); |
|
| 32 | $currencyFormatter->setTextAttribute(\NumberFormatter::NEGATIVE_PREFIX, "-"); |
|
| 33 | } |
|
| 34 | ||
| 35 | $this->currencyFormatter = $currencyFormatter; |
|
| 36 | } |
|
| 37 | ||
| 38 | public function translate($string) |
|
| 39 | { |
|
| @@ 45-55 (lines=11) @@ | ||
| 42 | ||
| 43 | private $currencyFormatter; |
|
| 44 | ||
| 45 | public function __construct(\NumberFormatter $currencyFormatter = null) |
|
| 46 | { |
|
| 47 | if (!$currencyFormatter) { |
|
| 48 | $currencyFormatter = new \NumberFormatter('sv', \NumberFormatter::CURRENCY); |
|
| 49 | $currencyFormatter->setSymbol(\NumberFormatter::CURRENCY_SYMBOL, ''); |
|
| 50 | $currencyFormatter->setSymbol(\NumberFormatter::INTL_CURRENCY_SYMBOL, ''); |
|
| 51 | $currencyFormatter->setTextAttribute(\NumberFormatter::NEGATIVE_PREFIX, "-"); |
|
| 52 | } |
|
| 53 | ||
| 54 | $this->currencyFormatter = $currencyFormatter; |
|
| 55 | } |
|
| 56 | ||
| 57 | public function translate($string) |
|
| 58 | { |
|