Adds data for the given language.

@param MW_Container_Content_Interface $contentItem Content object
@param string $langid Language id
@param array $ids List of product IDs
512093
protected function _addLanguage( MW_Container_Content_Interface $contentItem, $langid, array $ids )
	{
		$manager = MShop_Product_Manager_Factory::createManager( $this->_getContext() );
		$search = $manager->createSearch();

		if( !empty( $ids ) ) {
			$search->setConditions( $search->compare( '==', 'product.id', $ids ) );
		}

		$sort = array( $search->sort( '+', 'product.code' ) );
		$search->setSortations( $sort );

		$start = 0;

		do
		{
			$result = $manager->searchItems( $search, array('text') );

			foreach( $result as $item ) {
				$this->_addItem( $contentItem, $item, $langid );
			}

			$count = count( $result );
			$start += $count;
			$search->setSlice( $start );
		}
		while( $count == $search->getSliceSize() );
	}
901992
public function translationByLanguageID( $languageID )
    {
        /** @var eZContentLanguage $language */
        $language = eZContentLanguage::fetch( $languageID );
        if ( $language instanceof eZContentLanguage )
            return $this->translationByLocale( $language->attribute( 'locale' ) );

        return false;
    }
288646
private static function appendAdditionalNodeIDs( eZContentObject $contentObject, &$nodeIDList )
    {
        $contentObjectId = $contentObject->attribute( 'id' );
        if ( !isset( self::$additionalNodeIDsPerObject[$contentObjectId] ) )
            return;

        foreach ( self::$additionalNodeIDsPerObject[$contentObjectId] as $nodeID )
        {
            $nodeIDList[] = $nodeID;
        }
    }
590840
private function _initLanguageElements($languageSourceIds)
    {
        $languageSources = LanguageSource::findAll(['id' => $languageSourceIds]);
        foreach ($languageSources as $languageSource) {
            $this->_languageElements[$languageSource->category][$languageSource->message] = $languageSource->id;

            $category = Console::ansiFormat($languageSource->category, [Console::FG_RED]);
            $message = Console::ansiFormat($languageSource->message, [Console::FG_RED]);

            $this->_scanner->stdout('category: ' . $category . ', message: ' . $message);
        }
    }
657089
public function addDocumentIds(\AgentSIB\Diadoc\Api\Proto\DocumentId $value)
    {
        if ($this->DocumentIds === null) {
            $this->DocumentIds = new \Protobuf\MessageCollection();
        }

        $this->DocumentIds->add($value);
    }
633817
private function getNavData($langId)
    {
        return (new DbQuery())
            ->from(['cms_nav_item item'])
            ->select(['item.id', 'item.nav_id', 'item.title', 'item.description', 'item.keywords', 'item.image_id', 'item.is_url_strict_parsing_disabled', 'item.alias', 'item.title_tag', 'item.timestamp_create', 'item.timestamp_update', 'item.create_user_id', 'item.update_user_id', 'nav.is_home', 'nav.parent_nav_id', 'nav.sort_index', 'nav.is_hidden', 'item.nav_item_type', 'item.nav_item_type_id', 'nav_container.alias AS container'])
            ->leftJoin('cms_nav nav', 'nav.id=item.nav_id')
            ->leftJoin('cms_nav_container nav_container', 'nav_container.id=nav.nav_container_id')
            ->where(['nav.is_deleted' => false, 'item.lang_id' => $langId, 'nav.is_offline' => false, 'nav.is_draft' => false])
            ->andWhere(['or', ['publish_from' => null], ['<=', 'publish_from', new Expression('UNIX_TIMESTAMP()')]])
            ->andWhere(['or', ['publish_till' => null], ['>=', 'publish_till', new Expression('UNIX_TIMESTAMP()')]])
            ->orderBy(['container' => 'ASC', 'parent_nav_id' => 'ASC', 'nav.sort_index' => 'ASC'])
            ->indexBy('id')
            ->all();
    }
541845
public function deleteTranslatedFields($languageCode, $contentId, $versionNo = null)
    {
        $query = $this->connection->createQueryBuilder();
        $query
            ->delete('ezcontentobject_attribute')
            ->where('contentobject_id = :contentId')
            ->andWhere('language_code = :languageCode')
            ->setParameters(
                [
                    ':contentId' => $contentId,
                    ':languageCode' => $languageCode,
                ]
            )
        ;

        if (null !== $versionNo) {
            $query
                ->andWhere('version = :versionNo')
                ->setParameter(':versionNo', $versionNo)
            ;
        }

        $query->execute();
    }
1076345
public function setLanguageId($langid)
	{
		if ( $langid === $this->getLanguageId() ) { return; }

		$this->_values['langid'] = strtolower( (string) $langid );
		$this->setModified();
	}
1157873
public function pushLanguage(int $lanId): void
  {
    $this->language = Abc::$DL->abcBabelCoreLanguageGetDetails($lanId);
    array_push($this->stack, $this->language);
  }
115541
public function addText($locale, $text, $id = null)
    {
        $textWithLocale = new TextWithLocale();
        $textWithLocale
            ->setLocale($locale)
            ->setText($text);
        if (!is_null($id)) {
            $textWithLocale->setId($id);
        }
        $this->texts->add($textWithLocale);

        return $this;
    }
580961
public function createContent($contentType, $fields, $parentLocationId)
    {
        $repository = $this->getRepository();
        $languageCode = self::DEFAULT_LANGUAGE;
        $content = $this->createContentDraft($parentLocationId, $contentType, $fields, $languageCode);
        $content = $this->contentService->publishVersion($content->versionInfo);

        return $content->contentInfo->mainLocationId;
    }
955644
protected function getNotificationContentData($fluent, $langId, $key = 'title')
    {
        foreach ($fluent->contents as $content) {
            if ($langId !== $content['lang_id']) {
                continue;
            }
            return array_get($content, $key);
        }
        return '';
    }
313381
private function loadLocationEntriesMatchingMultipleLanguages($locationId, array $languageIds)
    {
        // note: alwaysAvailable for this use case is not relevant
        $languageMask = $this->languageMaskGenerator->generateLanguageMaskFromLanguageIds(
            $languageIds,
            false
        );

        $connection = $this->dbHandler->getConnection();
        /** @var \Doctrine\DBAL\Connection $connection */
        $query = $connection->createQueryBuilder();
        $query
            ->select('id', 'lang_mask', 'parent', 'text_md5')
            ->from($this->table)
            ->where('action = :action')
            // fetch rows matching any of the given Languages
            ->andWhere('lang_mask & :languageMask <> 0')
            ->setParameter(':action', 'eznode:' . $locationId)
            ->setParameter(':languageMask', $languageMask)
        ;

        $statement = $query->execute();
        $rows = $statement->fetchAll(\PDO::FETCH_ASSOC);

        return $rows ?: [];
    }
762608
public function insertLanguageItems($languageItems)
    {
        $data = [];
        foreach ($languageItems as $category => $messages) {
            foreach (array_keys($messages) as $message) {
                $data[] = [
                    $category,
                    $message,
                ];
            }
        }

        $count = count($data);
        for ($i = 0; $i < $count; $i += self::INSERT_LANGUAGE_ITEMS_LIMIT) {
            static::getDb()
                ->createCommand()
                ->batchInsert(static::tableName(), ['category', 'message'], array_slice($data, $i, self::INSERT_LANGUAGE_ITEMS_LIMIT))
                ->execute();
        }

        return $count;
    }
1324153
public function setContentState($contentId, $groupId, $stateId)
    {
        // First find out if $contentId is related to existing states in $groupId
        $query = $this->dbHandler->createSelectQuery();
        $query->select(
            $this->dbHandler->aliasedColumn($query, 'id', 'ezcobj_state')
        )->from(
            $this->dbHandler->quoteTable('ezcobj_state')
        )->innerJoin(
            $this->dbHandler->quoteTable('ezcobj_state_link'),
            $query->expr->eq(
                $this->dbHandler->quoteColumn('id', 'ezcobj_state'),
                $this->dbHandler->quoteColumn('contentobject_state_id', 'ezcobj_state_link')
            )
        )->where(
            $query->expr->lAnd(
                $query->expr->eq(
                    $this->dbHandler->quoteColumn('group_id', 'ezcobj_state'),
                    $query->bindValue($groupId, null, \PDO::PARAM_INT)
                ),
                $query->expr->eq(
                    $this->dbHandler->quoteColumn('contentobject_id', 'ezcobj_state_link'),
                    $query->bindValue($contentId, null, \PDO::PARAM_INT)
                )
            )
        );

        $statement = $query->prepare();
        $statement->execute();

        $rows = $statement->fetchAll(\PDO::FETCH_ASSOC);

        if (!empty($rows)) {
            // We already have a state assigned to $contentId, update to new one
            $query = $this->dbHandler->createUpdateQuery();
            $query->update(
                $this->dbHandler->quoteTable('ezcobj_state_link')
            )->set(
                $this->dbHandler->quoteColumn('contentobject_state_id'),
                $query->bindValue($stateId, null, \PDO::PARAM_INT)
            )->where(
                $query->expr->lAnd(
                    $query->expr->eq(
                        $this->dbHandler->quoteColumn('contentobject_id'),
                        $query->bindValue($contentId, null, \PDO::PARAM_INT)
                    ),
                    $query->expr->eq(
                        $this->dbHandler->quoteColumn('contentobject_state_id'),
                        $query->bindValue($rows[0]['ezcobj_state_id'], null, \PDO::PARAM_INT)
                    )
                )
            );

            $query->prepare()->execute();
        } else {
            // No state assigned to $contentId from specified group, create assignment
            $query = $this->dbHandler->createInsertQuery();
            $query->insertInto(
                $this->dbHandler->quoteTable('ezcobj_state_link')
            )->set(
                $this->dbHandler->quoteColumn('contentobject_id'),
                $query->bindValue($contentId, null, \PDO::PARAM_INT)
            )->set(
                $this->dbHandler->quoteColumn('contentobject_state_id'),
                $query->bindValue($stateId, null, \PDO::PARAM_INT)
            );

            $query->prepare()->execute();
        }
    }
273710
public function deleteTranslationFromContent($contentId, $languageCode)
    {
        $language = $this->languageHandler->loadByLanguageCode($languageCode);

        $this->connection->beginTransaction();
        try {
            $this->deleteTranslationFromContentVersions($contentId, $language->id);
            $this->deleteTranslationFromContentNames($contentId, $languageCode);
            $this->deleteTranslationFromContentObject($contentId, $language->id);

            $this->connection->commit();
        } catch (DBALException $e) {
            $this->connection->rollBack();
            throw $e;
        }
    }
1078485
public static function buildBreadcrumbs(Content $content, Language $language)
    {
        resolve('breadcrumbs')->register(
            $content->type->name,
            function ($breadcrumbs) use ($content, $language) {
                $breadcrumbs->push(trans('gzero-core::common.home'), routeMl('home'));

                $titlesAndUrls = (new ContentReadRepository)->getAncestorsTitlesAndPaths($content, $language);

                $titlesAndUrls->each(function ($item) use ($breadcrumbs, $language) {
                    $breadcrumbs->push($item->title, urlMl($item->path, $language->code));
                });
            }
        );
    }