Adds locale currency data.

@param MShop_Common_Manager_Interface $localeManager Locale manager
@param array $data Associative list of locale currency data
196565
protected function _addLocaleCurrencyData( MShop_Common_Manager_Interface $localeManager, array $data )
	{
		$this->_msg( 'Adding data for MShop locale currencies', 1 );

		$currencyItemManager = $localeManager->getSubManager( 'currency', 'Default' );

		$num = $total = 0;

		foreach( $data as $key => $dataset )
		{
			$total++;

			$currencyItem = $currencyItemManager->createItem();
			$currencyItem->setCode( $dataset['id'] );
			$currencyItem->setLabel( $dataset['label'] );
			$currencyItem->setStatus( $dataset['status'] );

			try {
				$currencyItemManager->saveItem($currencyItem);
				$num++;
			} catch( Exception $e ) { ; } // if currency was already available
		}

		$this->_status( $num > 0 ? $num . '/' . $total : 'OK' );
	}
37860
public function addProduct($data, $user = null, $locale = null)
    {
        //TODO: locale
        // get cart
        $cart = $this->getUserCart($user, $locale, null, true);
        // define user-id
        $userId = $user ? $user->getId() : null;

        $item = $this->orderManager->addItem($data, $locale, $userId, $cart);

        $this->validateIfItemProductActive($item->getEntity());

        $this->orderManager->updateApiEntity($cart, $locale);

        return $cart;
    }
1295467
private function setLocale($locale)
    {
        if($locale != null)
        {
            \Locale::setDefault($locale);
        }
        else 
        {
           \Locale::setDefault(self::CURRENCY_DEFAULT_LOCALE); 
        }
        
        $this->locale = \Locale::getDefault();
    }
637658
public function addPriorityLocale(PriorityLocale $locale)
    {
        $this->priorityLocaleList[$locale->getLocale()] = $locale->getLocaleList();

        return $this;
    }
1217995
public void setLocale(Locale locale)
  {
    if(locale != null && report != null && report instanceof LocalizableReport) 
    {
      ((LocalizableReport) report).setLocale(locale); 
    }
  }
509692
public function setLocale(User $user, $locale = 'en')
    {
        $user->setLocale($locale);
        $this->objectManager->persist($user);
        $this->objectManager->flush();
    }
1278911
void addRate(CurrencyUnit term, LocalDate localDate, Number rate) {
        RateType rateType = RateType.HISTORIC;
        ExchangeRateBuilder builder;
        if (Objects.nonNull(localDate)) {
            // TODO check/test!
            if (localDate.equals(LocalDate.now())) {
                rateType = RateType.DEFERRED;
            }
            builder = new ExchangeRateBuilder(
                    ConversionContextBuilder.create(context, rateType).set(localDate).build());
        } else {
            builder = new ExchangeRateBuilder(ConversionContextBuilder.create(context, rateType).build());
        }
        builder.setBase(ECBHistoricRateProvider.BASE_CURRENCY);
        builder.setTerm(term);
        builder.setFactor(DefaultNumberValue.of(rate));
        ExchangeRate exchangeRate = builder.build();
        Map<String, ExchangeRate> rateMap = this.historicRates.get(localDate);
        if (Objects.isNull(rateMap)) {
            synchronized (this.historicRates) {
                rateMap = Optional.ofNullable(this.historicRates.get(localDate)).orElse(new ConcurrentHashMap<>());
                this.historicRates.putIfAbsent(localDate, rateMap);

            }
        }
        rateMap.put(term.getCurrencyCode(), exchangeRate);
    }
518187
public function addMap($locale, $map)
    {
        // Get sanitized locale
        $locale = Locale::sanitizeLocale($locale);

        $this->maps[$locale] = $map;

        return $this;
    }
304201
public static MonetaryAmountDecimalFormatBuilder of(Locale locale) {
        MonetaryAmountDecimalFormatBuilder builder = new MonetaryAmountDecimalFormatBuilder();
        builder.decimalFormat = (DecimalFormat) NumberFormat.getCurrencyInstance(locale);
        builder.locale = locale;
        return builder;
    }
1004825
public function setUserLocale($locale)
    {
        $locales = $this->getAvailableLocales();
        $this->userManager->setLocale($this->getCurrentUser(), $locale);
    }
685258
protected function addResourceArray(array $resource): void
    {
        foreach ($resource as $locale => $value) {
            if ($locale === '@metadata') {
                $this->parseMetadata($value);
                continue;
            }
            $this->addSubresource($value, $locale);
        }
    }
783069
public function setLocale( MShop_Locale_Item_Interface $locale )
	{
		$this->_notifyListeners( 'setLocale.before', $locale );

		$this->_locale = clone $locale;
		$this->_modified = true;

		$this->_notifyListeners( 'setLocale.after', $locale );
	}
972684
public function addDictionary(string $locale, $callbackOrArray): \BearFramework\Localization
    {
        if (!isset($this->dictionaries[$locale])) {
            $this->dictionaries[$locale] = [];
        }
        $this->dictionaries[$locale][] = $callbackOrArray;
        return $this;
    }
13024
public static String formatCurrency(Object data, String currencyCode, Locale locale) {
        return formatCurrency(null, data, currencyCode, locale);
    }
624549
public function locale(Request $request, Response $response, array $data)
    {
        $this->localeManager->setLocale(new Locale($data['locale']));

        return $response->withRedirect($this->container->get('router')->pathFor('index'));
    }
885706
private void addToLocaleList(List localeList, List<Locale> locales) {
        if (locales != null) {
            for (Locale locale : locales) {
                if (locale != null && !localeList.contains(locale)) localeList.add(locale);
            }
        }
    }
95723
private function add($data, $language) {
        $parts = explode('-', $language); // To manage language with region (fr-CI, en-US, etc.)
        foreach($data as $key => $translation) {
            if (count($parts) == 1) {
                $this->translations[$language][$key] = $translation;
            } elseif (count($parts) == 2) {
                $this->translations[$parts[0]][$parts[1]][$key] = $translation;
            } else {
                throw new TranslationException('Invalid language');
            }
        }
    }