Aimeos\ShopBundle\Service\I18n::get PHP Method

get() public method

Creates new translation objects.
public get ( array $languageIds ) : Aimeos\MW\Translation\Interface[]
$languageIds array List of two letter ISO language IDs
return Aimeos\MW\Translation\Interface[] List of translation objects
    public function get(array $languageIds)
    {
        $i18nPaths = $this->container->get('aimeos')->get()->getI18nPaths();
        foreach ($languageIds as $langid) {
            if (!isset($this->i18n[$langid])) {
                $i18n = new \Aimeos\MW\Translation\Gettext($i18nPaths, $langid);
                $apc = (bool) $this->container->getParameter('aimeos_shop.apc_enable');
                $prefix = $this->container->getParameter('aimeos_shop.apc_prefix');
                if (function_exists('apc_store') === true && $apc === true) {
                    $i18n = new \Aimeos\MW\Translation\Decorator\APC($i18n, $prefix);
                }
                $translations = $this->container->getParameter('aimeos_shop.i18n');
                if (isset($translations[$langid])) {
                    $i18n = new \Aimeos\MW\Translation\Decorator\Memory($i18n, $translations[$langid]);
                }
                $this->i18n[$langid] = $i18n;
            }
        }
        return $this->i18n;
    }