Assign default values for eache language

@param array $aLanguages language array

@return array
960763
protected function _assignDefaultLangParams($aLanguages)
    {
        $aParams = [];
        $iBaseId = 0;

        foreach (array_keys($aLanguages) as $sOxId) {
            $aParams[$sOxId]['baseId'] = $iBaseId;
            $aParams[$sOxId]['active'] = 1;
            $aParams[$sOxId]['sort'] = $iBaseId + 1;

            $iBaseId++;
        }

        return $aParams;
    }
830984
public function getLanguageNames(array $languageCodes, $locale)
    {
        $apiCall = new ApiCall\GetLanguageNames($languageCodes, $locale);

        return $this->call($apiCall);
    }
1253019
public function getLanguageNames()
    {
        $aConfLanguages = \OxidEsales\Eshop\Core\Registry::getConfig()->getConfigParam('aLanguages');
        $aLangIds = $this->getLanguageIds();
        $aLanguages = [];
        foreach ($aLangIds as $iId => $sValue) {
            $aLanguages[$iId] = $aConfLanguages[$sValue];
        }

        return $aLanguages;
    }
6768
public function all($locale = null){

        if(!$locale){
            $locale = $this->getLocale();
        }

        $this->load($locale);

        $translations = collect([]);
        foreach($this->languages[$locale] as $key => $arg){
            $translations->put($key, $arg['value']);
        }

        return $translations;
    }
1007491
public function translateToAnyLanguageOf(array $languageCodes): self
    {
        foreach ($languageCodes as $languageCode) {
            if (!is_string($languageCode) || empty($languageCode)) {
                throw new InvalidArgumentException('$languageCodes', 'All language codes should be non-empty strings');
            }
        }

        $this->targetVersionProperties['allLanguageCodesList'] = $languageCodes;

        return $this;
    }
15869
protected function getLanguages(array $paths = [])
    {
        // Get language path
        $dir_lang = $this->getLangPath();

        // Only use the default locale
        if ($this->config('default_locale_only')) {
            return [
                $this->default_locale => "{$dir_lang}/{$this->default_locale}",
            ];
        }

        // Get all language paths
        foreach (glob("{$dir_lang}/*", GLOB_ONLYDIR) as $path) {
            $paths[basename($path)] = $path;
        }

        return $paths;
    }
769335
protected static function get_target_locales()
    {
        // if locales are explicitly set, use these
        if (is_array(self::config()->locales)) {
            return (array)self::config()->locales;
            // otherwise check the allowed locales. If these have been set, use these
        } else if (is_array(Translatable::get_allowed_locales())) {
            return (array)Translatable::get_allowed_locales();
        }

        // last resort is to take the existing content languages
        return array_keys(Translatable::get_existing_content_languages());
    }
405886
protected function normaliseMessages($messages, $locale)
    {
        foreach ($messages as $key => $value) {
            $messages[$key] = $this->normaliseMessage($key, $value, $locale);
        }
        return $messages;
    }
1222890
public function setLocalizations(array $localizations)
    {
        $this->localizations = new ArrayIterator();

        foreach ($localizations as $ident => $translations) {
            $this->addLocalization($ident, $translations);
        }

        return $this;
    }
54913
protected function validateDefaultLocalization($localizations)
    {
        $result = false;
        foreach ($localizations as $localization) {
            if ($localization->isDefault()) {
                if ($result) {
                    throw new InvalidDefaultLocalizationException();
                }
                $result = true;
            }
        }

        return $result;
    }
1236548
protected function filterLanguages(array $contentLanguages): array
    {
        return array_filter(
            $this->languageService->loadLanguages(),
            function (Language $language) use ($contentLanguages) {
                return in_array($language->languageCode, $contentLanguages, true);
            }
        );
    }
1186383
protected function setLocales(array $locales)
    {
        $this->locales = [];
        foreach ($locales as $langCode => $localeStruct) {
            $this->locales[$langCode] = $this->parseLocale($localeStruct, $langCode);
        }

        return $this;
    }
285077
public function getDefaultLocale()
    {
        $locales = $this->getLocales();

        foreach ($locales as $locale) {
            if ($locale->isDefault()) {
                return $locale;
            }
        }

        return array_pop($locales);
    }
1186777
public function storeTranslations($values)
    {
        $array = [];

        foreach ($values as $lang => $data) {
            $array[$lang]['locale'] = $lang;

            foreach ($this->translatedAttributes as $attribute) {
                $array[$lang][$attribute] = isset($values[$lang][$attribute]) ? $values[$lang][$attribute] : '';
            }
        }

        $this->translations()->createMany($array);
    }
681583
private function cloneDefaultLocaleTranslations(array $translationClasses, $targetLocale)
    {
        $this->em->getConnection()->beginTransaction();

        $localeProperty = $this->translatableManager->getTranslationLocaleProperty();

        foreach ($translationClasses as $translationClass) {
            $defaultLocaleTranslations = $this->em->getRepository($translationClass)->findBy([
                $localeProperty => $this->defaultLocale,
            ]);

            foreach ($defaultLocaleTranslations as $translation) {
                $meta = $this->em->getClassMetadata($translationClass);

                $translationClone = clone $translation;
                $ids = $meta->getIdentifier();
                $meta->setIdentifierValues($translationClone, array_fill_keys($ids, null));
                $meta->setFieldValue($translationClone, $localeProperty, $targetLocale);

                foreach ($meta->getAssociationNames() as $property) {
                    if ('translatable' !== $property) {
                        $meta->setFieldValue(
                            $translationClone,
                            $property,
                            $meta->isCollectionValuedAssociation($property) ? new ArrayCollection() : null
                        );
                    }
                }

                $this->em->persist($translationClone);

                $ids = $meta->getIdentifierValues($translation);
                $this->io->comment($translationClass.' '.reset($ids));
            }

            $this->em->flush();
            $this->em->clear();
        }

        $this->em->getConnection()->commit();
    }
726782
public function setLanguage($iLanguage = null)
    {
        if (!isset($iLanguage)) {
            $this->_iLanguage = \OxidEsales\Eshop\Core\Registry::getLang()->getBaseLanguage();
        } else {
            $this->_iLanguage = $iLanguage;
        }
    }
1192550
public function addDefaults(array $defaults)
    {
        foreach ($defaults as $name => $default) {
            $this->defaults[$name] = $default;
        }
        $this->compiled = null;

        return $this;
    }