Loads the message translation for the specified language and category.
@param string $category the message category
@param string $language the target language
@return array the loaded messages
350198
protected function loadMessages($category, $language)
	{
        $messageFile=$this->basePath . DIRECTORY_SEPARATOR . $language . DIRECTORY_SEPARATOR . $this->catalog;
        if($this->useMoFile)
        	$messageFile.=self::MO_FILE_EXT;
        else
        	$messageFile.=self::PO_FILE_EXT;

		if ($this->cachingDuration > 0 && $this->cacheID!==false && ($cache=Yii::app()->getComponent($this->cacheID))!==null)
		{
			$key = self::CACHE_KEY_PREFIX . $messageFile . "." . $category;
			if (($data=$cache->get($key)) !== false)
				return unserialize($data);
		}

		if (is_file($messageFile))
		{
			if($this->useMoFile)
				$file=new CGettextMoFile($this->useBigEndian);
			else
				$file=new CGettextPoFile();
			$messages=$file->load($messageFile,$category);
			if(isset($cache))
			{
				$dependency=new CFileCacheDependency($messageFile);
				$cache->set($key,serialize($messages),$this->cachingDuration,$dependency);
			}
			return $messages;
		}
		else
			return array();
	}
1370318
private function setCategoryFullSlug(Category $category): void
    {
        static $languages;

        if (! $languages) {
            $languages = $this->language ? [$this->language] : TransHelper::getAllLanguages();
        }

        foreach ($languages as $language) {
            $category->translations()->where('locale', $language->iso_code)->update([
                'full_slug' => $this->getSlugForCategory($category->id, $language->iso_code),
            ]);
        }

        foreach ($category->descendants()->get() as $descendant) {
            foreach ($languages as $language) {
                $descendant->translations()->where('locale', $language->iso_code)->update([
                    'full_slug' => $this->getSlugForCategory($descendant->id, $language->iso_code),
                ]);
            }
        }
    }
1068308
public function update(Category $category, array $data)
    {
        if (Session::has('multi_language_enabled')) {
            $languageId = $data['language_id'];
            $languaModel = Language::find($languageId);
            
            if ($languaModel->is_default) {
                return $category->update($data);
            } else {
                $category->update(Arr::only($data, ['parent_id']));

                $translatedModel = $category
                    ->translations()
                    ->whereLanguageId($languageId)
                    ->first();
                if (null === $translatedModel) {
                    return CategoryTranslation::create(
                        array_merge($data, ['category_id' => $category->id])
                    );
                } else {
                    $translatedModel->update(
                        $data,
                        $category->getTranslatedAttributes()
                    );

                    return $translatedModel;
                }

            }
        } else {
            return $category->update($data);
        }
    }
45270
public function getTranslation($language = null)
    {
        if (!$language) {
            $language = $this->getLanguage();
        }
        if (!isset($this->_models[$language])) {
            $this->_models[$language] = $this->getNewTranslation($language);
        }
        return $this->_models[$language];
    }
1129578
public function getComponentsWithCategory($category)
    {
        $components = array();
        foreach ($this->blockConfiguration as $blockComponent => $configuration) {
            if (isset($configuration['category']) && $category === $configuration['category']) {
                $components[] = $blockComponent;
            }
        }

        return $components;
    }
1151462
private function createTranslation(CategoryInterface $category, $locale)
    {
        $categoryTranslation = $this->categoryTranslationRepository->createNew();
        $categoryTranslation->setLocale($locale);
        $categoryTranslation->setTranslation('');
        $categoryTranslation->setCategory($category);
        $category->addTranslation($categoryTranslation);

        $this->entityManager->persist($categoryTranslation);

        return $categoryTranslation;
    }
365386
public function getCategories(CategoryListMessage $message): array
    {
        $path = sprintf('sites/%d/categories', $message->getSiteId());

        $response = $this->getClient()->sendRequest(RequestStatus::GET, $path);

        /** @var Category[] $models */
        $models = $this->getModelFactory()->createMany(Category::class, $response);

        return $models;
    }
573330
private function buildCategoriesWhere($categories, $operator, $languageCode)
    {
        $structure = $this->structureManager->getStructure('excerpt');

        $sql2Where = [];
        if ($structure->hasProperty('categories')) {
            $property = new TranslatedProperty(
                $structure->getProperty('categories'),
                $languageCode,
                $this->languageNamespace,
                'excerpt'
            );
            foreach ($categories as $category) {
                $sql2Where[] = 'page.[' . $property->getName() . '] = ' . $category;
            }

            if (count($sql2Where) > 0) {
                return '(' . implode(' ' . strtoupper($operator) . ' ', $sql2Where) . ')';
            }
        }

        return '';
    }
1021638
public function error( $object , $category , $message )
	{
		return $this->message( self::getMessagePrefix( $object , $category , 'error' ) . $message , self::LEVEL_ERROR );
	}
1112591
private function formatCategories(array $categories) {

    $terms = [];

    foreach ($categories as $cid) {
      $term = $this->categoryRepo->loadCategoryTerm($cid);
      if ($term) {
        $terms[] = $term->id();
      }
    }

    return ($terms);
  }
1368965
public function loadAllTranslations($language)
    {
        foreach ($this->loaded as $module) {
            $this->loadModuleTranslation($module, $language);
        }
    }
651816
protected function _files($category, $locale, $scope) {
		$path = $this->_config['path'];
		$scope = $scope ?: 'default';

		if (($pos = strpos($category, 'Template')) !== false) {
			$category = substr($category, 0, $pos);
			return ["{$path}/{$category}_{$scope}.pot"];
		}

		if ($category === 'message') {
			$category = 'messages';
		}
		$category = strtoupper($category);

		return [
			"{$path}/{$locale}/LC_{$category}/{$scope}.mo",
			"{$path}/{$locale}/LC_{$category}/{$scope}.po"
		];
	}
63439
public function getAllMessages($language = null) {
	
		$this->loadAllMessages();

		// The array of messages by message, then by language:
		// array(message_key => array(language => message))
		$msgs = array();
	
		$keys = $this->getAllKeys();
	
		$languages = $this->getSupportedLanguages();
	
		foreach ($keys as $key) {
			$msgs[$key] = $this->getMessageForAllLanguages($key, $language);
		}
	
		ksort($msgs);
		$response = array("languages"=>$languages, "msgs"=>$msgs);
		return $response;
	}
132491
public static <T> T getMessageLogger(Class<T> type, String category) {
        return getMessageLogger(type, category, Locale.getDefault());
    }
147434
public function getLanguage($language)
    {
        if (!$this->getLanguages()->has($language)) {
            $this->getLanguages()->set($language, new LanguageBag());
        }

        return $this->getLanguages()->get($language);
    }
402949
public function addLanguageItem($category, $message)
    {
        $this->_languageElements[$category][$message] = true;

        $coloredCategory = Console::ansiFormat($category, [Console::FG_YELLOW]);
        $coloredMessage = Console::ansiFormat($message, [Console::FG_YELLOW]);

        $this->stdout('Detected language element: [ ' . $coloredCategory . ' ] ' . $coloredMessage);
    }
1371911
public function setLanguage($language, $category = null)
    {
        if ($category === null) {
            $category = defined('LC_MESSAGES') ? LC_MESSAGES : LC_ALL;
        }

        setlocale($category, $language);
        putenv('LANGUAGE='.$language);

        return $this;
    }