Returns the translations list for a given langauge.

@param string $language
@return array
552659
public function getTranslations( $language, $instance, $parent_instance = false )
	{
        $sql = <<<TRANSLATIONS
        SELECT
         id,
         message,
         comment,
         SUBSTRING_INDEX(GROUP_CONCAT(destination_instance ORDER BY language_depth DESC, instance_depth DESC SEPARATOR '##-##'),'##-##',1) as destination_instance,
         SUBSTRING_INDEX(GROUP_CONCAT(language ORDER BY language_depth DESC, instance_depth DESC SEPARATOR '##-##'),'##-##',1) as language,
         SUBSTRING_INDEX(GROUP_CONCAT(translation ORDER BY language_depth DESC, instance_depth DESC SEPARATOR '##-##'),'##-##',1) as translation,
         SUBSTRING_INDEX(GROUP_CONCAT(author ORDER BY language_depth DESC, instance_depth DESC SEPARATOR '##-##'),'##-##',1) as author,
         SUBSTRING_INDEX(GROUP_CONCAT(modified ORDER BY language_depth DESC, instance_depth DESC SEPARATOR '##-##'),'##-##',1) as modified,
         SUBSTRING_INDEX(GROUP_CONCAT(is_base_lang ORDER BY language_depth DESC, instance_depth DESC SEPARATOR '##-##'),'##-##',1) as is_base_lang
        FROM
            (
                SELECT
                    m.id,
                    m.message,
                    m.comment,
                    m.instance AS message_instance,
                    t.instance AS translation_instance,
                    i.instance AS destination_instance,
                    ip.instance AS instance_parent,
                    (
                        SELECT
                            COUNT(ip_x.instance) as depth
                        FROM
                            i18n_instances i_x
                                JOIN i18n_instances ip_x ON i_x.lft BETWEEN ip_x.lft AND ip_x.rgt
                        WHERE
                            i_x.instance = t.instance
                        GROUP BY
                            i_x.instance
                    ) as instance_depth,	
                    t.lang as origin_language,
                    l.lang as language,
                    (
                        SELECT
                            COUNT(lp_x.lang) as depth
                        FROM
                            i18n_languages l_x
                                JOIN i18n_languages lp_x ON l_x.lft BETWEEN lp_x.lft AND lp_x.rgt
                        WHERE
                            l_x.lang = lp.lang
                        GROUP BY
                            l_x.lang
                    ) as language_depth,	
                    t.translation AS translation,
                    t.author AS author,
                    t.modified AS modified,
                    IF(t.lang = l.lang, 1, 0) as is_base_lang
                    
                FROM
                    i18n_messages m
                    LEFT JOIN i18n_languages l ON l.lang = ?
                    LEFT JOIN i18n_languages lp ON l.lft BETWEEN lp.lft AND lp.rgt	
                    LEFT JOIN i18n_translations t ON m.id = t.id_message AND t.lang = lp.lang
                    LEFT JOIN i18n_instances i ON i.instance = ?
                    LEFT JOIN i18n_instances ip ON i.lft BETWEEN ip.lft AND ip.rgt
                WHERE
                    t.instance = ip.instance
                ORDER BY
                    IF(t.id_message IS NULL,0,1), LOWER(CONVERT(m.message USING utf8)), m.id, t.lang = l.lang DESC
        ) tbl
        GROUP BY id;
TRANSLATIONS;

		return $this->GetArray( $sql, array(
		                                   $language,
		                                   $instance,
		                                   'tag' => 'Get all translations for current language'
		                              ) );
	}
54386
public function get_list_of_currencies($lang = null) {
        if ($lang === null) {
            $lang = current_language();
        }

        $currencies = $this->load_component_strings('core_currencies', $lang);
        asort($currencies);

        return $currencies;
    }
148405
protected function prepareLanguage($language)
    {
        $value = addslashes($language['code']);
        $label = addslashes($language['code']);
        $flag  = addslashes(sprintf('%s.png', substr($label, 0, 2)));
        
        return [
            'sValue' => $value,
            'sLabel' => $label,
            'sFlag'  => $flag,
        ];
    }
462098
public function highlightJsLangData(string $lang): array
    {
        if ($lang === 'wp') {
            return [
                'ver'  => $this->cv,
                'deps' => ['highlight-js'],
                'url'  => $this->c::appWsCoreUrl('/client-s/js/hljs/langs/wp.min.js'),
            ];
        }
        return [
            'version' => '9.12.0',
            'deps'    => ['highlight-js'],
            'url'     => '//cdnjs.cloudflare.com/ajax/libs/highlight.js/%1$s/languages/'.urlencode($lang).'.min.js',
        ];
    }
942467
public function getAllLangs(): array
    {
        $domainInfo = $this->intuition->getDomainInfo($this->domain);
        $messageFiles = glob($domainInfo['dir'].'/*.json');
        $languages = array_values(array_unique(array_map(
            function ($filename) {
                return basename($filename, '.json');
            },
            $messageFiles
        )));
        $availableLanguages = [];
        foreach ($languages as $lang) {
            $availableLanguages[$lang] = $this->intuition->getLangName($lang);
        }
        ksort($availableLanguages);
        return $availableLanguages;
    }
1227969
public function getTranslations(
        array $domains = [],
        array $languages = [],
        callable $filter = null
    ) : array {
        $translations = array_filter(
            $this->translations,
            function (Translation $translation) {
                return $translation->getValue() != '';
            }
        );

        if (is_callable($filter)) {
            $translations = array_filter(
                $translations,
                $filter
            );
        }

        return $translations;
    }
514714
public function getAll( $domain )
	{
		$messages = [];

		foreach( $this->getTranslations( $domain ) as $object ) {
			$messages = $messages + $object->all();
		}

		return $messages;
	}
1368965
public function loadAllTranslations($language)
    {
        foreach ($this->loaded as $module) {
            $this->loadModuleTranslation($module, $language);
        }
    }
188441
public function description(string $language = null): ?string
    {
        if ($language === null) {
            return array_get($this->translation, 'description');
        }

        $translation = array_first($this->translations, function ($translation) use ($language) {
            return $translation['language_code'] === $language;
        });

        return array_get($translation, 'description');
    }
1181816
public function getTranslationsForKey($key) {
		$this->getAllTranslationByLanguage();
		$translations = [];
		foreach ($this->messages as $language => $messages) {
			foreach ($messages as $messageKey => $message) {
				if($key == $messageKey) {
					$translations[$language] = $message;
				}
			}
		}
		return $translations;
	}
612062
public function getTranslations(
        array $domains = [],
        array $languages = [],
        callable $filter = null
    ) : array {
        return array_reduce(
            $this->getRepositories(
                $domains,
                $languages
            ),
            function (array $translations, Repository $repository) use ($domains, $languages, $filter) {
                return array_merge(
                    $translations,
                    $repository->getTranslations(
                        $domains,
                        $languages,
                        $filter
                    )
                );
            },
            []
        );
    }
477637
public function getLanguage( $language )
	{
		$pattern		= '/^([a-z]{1,8}(?:-[a-z]{1,8})*)(?:;\s*q=(0(?:\.[0-9]{1,3})?|1(?:\.0{1,3})?))?$/i';
		if( !$language )
			return $this->default;
		$accepted	= preg_split( '/,\s*/', $language );
		$curr_lang	= $this->default;
		$curr_qual	= 0;
		foreach( $accepted as $accept)
		{
			if( !preg_match ( $pattern, $accept, $matches) )
				continue;
			$lang_code = explode ( '-', $matches[1] );
			$lang_quality =  isset( $matches[2] ) ? (float)$matches[2] : 1.0;
			while (count ($lang_code))
			{
				if( in_array( strtolower( join( '-', $lang_code ) ), $this->allowed ) )
				{
					if( $lang_quality > $curr_qual )
					{
						$curr_lang	= strtolower( join( '-', $lang_code ) );
						$curr_qual	= $lang_quality;
						break;
					}
				}
				array_pop ($lang_code);
			}
		}
		return $curr_lang;
	}
817404
public function getLanguages()
    {
        $source = $this->server['HTTP_ACCEPT_LANGUAGE'];

        if (strpos($source, ',') !== false) {
            $langs = explode(',', $source);
            return $langs;
        } else {
            return array($source);
        }
    }
616622
public function byLanguage($language = null)
    {
        if (!$language) {
            if (Yii::$app->id === 'app-backend') {
                $language = Yii::$app->wavecms->editedLanguage;
            } else {
                $language = Yii::$app->language;
            }
        }

        return $this->andWhere(['REGEXP', News::tableName() . '.languages', '(^|;)(' . $language . ')(;|$)']);
    }
530402
protected function getAllTxFiles($language)
    {
        $iterator = new \DirectoryIterator($this->txlang . DIRECTORY_SEPARATOR . $language);

        $files = array();
        while ($iterator->valid()) {
            if (!$iterator->isDot()
                && $iterator->isFile()
                && $iterator->getExtension() == 'xlf'
                && $this->isNotFileToSkip($iterator->getPathname())
            ) {
                $files[$iterator->getPathname()] = $iterator->getFilename();
            }
            $iterator->next();
        }

        return $files;
    }
725840
public function getValues($language = null)
    {
        if (!$language) {
            $language = $this->defaultLanguage;
        }

        if (!isset($this->values[$language])) {
            return [];
        }

        return $this->values[$language];
    }
46439
public function getTranslation($language = null)
    {
        $language = $language ?: $this->_currentLanguage;
        return $this->owner->hasOne($this->translationClassName, [$this->languageForeignKey => $this->_ownerPrimaryKey])
                        ->where([$this->languageField => $language]);
    }