Returns a associative array holding the metadata.

@param   string  $lang  The name of the language.

@return  mixed  If $lang exists return key/value pair with the language metadata, otherwise return NULL.

@since   1.0
549545
public static function getMetadata($lang)
	{
		$path = self::getLanguagePath(JPATH_ROOT, $lang);
		$file = $lang . '.xml';

		$result = null;

		if (is_file("$path/$file"))
		{
			$result = self::parseXMLLanguageFile("$path/$file");
		}

		if (empty($result))
		{
			return null;
		}

		return $result;
	}
506160
public function getTree($lang = null) {
		if (is_null($lang)) $lang = $this->_language;

		$file = $this->_language_path . $lang . '/tree.php';
		return $this->_loadFile($file);
	}
1371321
public function getOptionsByLang($lang = 'en')
    {
        $finalOptions = [];

        foreach ($this->getOptions() as $options) {
            foreach ($options as $option) {
                if ($option->lang == $lang || $option->isPlain) {
                    $finalOptions[] = $option;
                }
            }
        }

        return empty($finalOptions) ? null : $finalOptions;
    }
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;
	}
1107840
public function getNodeTranslationsQueryBuilder($lang = null)
    {
        $queryBuilder = $this->createQueryBuilder('nt')
            ->select('nt,n,v')
            ->innerJoin('nt.node', 'n')
            ->leftJoin(
                'nt.publicNodeVersion',
                'v',
                'WITH',
                'nt.publicNodeVersion = v.id'
            )
            ->where('n.deleted = false')
            ->orderBy('nt.weight')
            ->addOrderBy('nt.weight');

        if (!empty($lang)) {
            $queryBuilder
                ->andWhere('nt.lang = :lang')
                ->setParameter('lang', $lang);
        }

        return $queryBuilder;
    }
1054946
public function getTranslationByLang($language) {
        if ($language instanceof Language) {
            $index = $language->getSymbol();
        } else {
            $index = $language;
        }
        if (empty($this->transArray[$index])) {
            $this->transArray[$index] = $this->getTranslations()->filter(function ($trans) use ($index) {
                                    return $trans->getTransLang()->getSymbol() == $index;
                            })
                    ->first();
        }

        return $this->transArray[$index];
    }
1273167
public function get($language)
    {
        $result = array();
        if (isset($this->{$language})) {
            $result = $this->{$language};
        }
        if ($language !== 'nl' && isset($this->nl)) {
            $result += $this->nl;
        }
        return $result;
    }
261791
public function translationData($lang)
    {
        $translation = $this->translation($lang);

        if ($translation) {
            $data = json_decode($translation->entity_data);

            if (isset($data->blocks)) {
                $data->blocks = json_decode($data->blocks, true);
            }

            return $data;
        }

        return null;
    }
203793
public static function languageToTerritory($lang) {
        $config = Zend_Registry::get('config');
        $territory = isset($config->resources->locale->territories->{$lang}) ?
            $config->resources->locale->territories->{$lang} :
            Zend_Locale::getLocaleToTerritory($lang);
        return $territory;
    }
1279308
private function loadLang($lang) {
        $locale = preg_replace_callback('/\b([a-z]{2})[-_](?:([a-z]{4})[-_])?([a-z]{2})\b/', function ($matches) {
            return $matches[1].'_'.(!empty($matches[2]) ? ucfirst($matches[2]).'_' : '').strtoupper($matches[3]);
        }, strtolower($lang));

        if (file_exists($filename = __DIR__.'/Lang/'.$locale.'.php')) {
            $this->lang = $locale;

            $this->number_word = include __DIR__.'/Lang/'.$locale.'.php';
            $this->currency = $this->number_word['currency'];

            return true;
        }
        throw new InvalidArgumentException('Unknown language ('.$lang.')');
    }
147434
public function getLanguage($language)
    {
        if (!$this->getLanguages()->has($language)) {
            $this->getLanguages()->set($language, new LanguageBag());
        }

        return $this->getLanguages()->get($language);
    }
455833
public function getTranslation($language = null)
    {
        if ($language === null) {
            $language = $this->getLanguage();
        }

        if (!isset($this->owner->{$this->translationsAttribute}[$language])) {
            $this->owner->{$this->translationsAttribute}[$language] = $this->loadTranslation($language);
        }

        return $this->owner->{$this->translationsAttribute}[$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;
    }
303611
public function getTranslations($lang)
    {
        $path = $this->getTranslationPathBaseDirectory('lang', $lang);

        if (!is_readable($path)) {
            return array();
        }

        $data = file_get_contents($path);
        $translations = json_decode($data, true);

        return $translations;
    }
1314276
public static function get($key, array $params = [], $lang = null)
    {
        $lang = $lang ?: static::$lang;
        if(static::has($key)) {
            $string = static::$langs[$lang][$key];
            foreach($params as $placeholder => $value) {
                $string = str_replace('{' . $placeholder . '}', $value, $string);
            }

            return $string;
        }

        return $key;
    }
1125565
public function getLabel($lang = null)
    {
        $lang = empty($lang) ? $this->getDefaultLanguage() : $lang;

        if (!isset($this->labels[$lang])) {
            return $this->getFirstLabel();
        }

        return $this->labels[$lang];
    }
921091
public function loadDictionary($lang = null)
    {
        if (!is_string($lang) && !is_null($lang)) {
            throw new \InvalidArgumentException("Please provide a string as parameter!");
        } else {
            
            // if nothing is set, get it from the config file
            if (is_null($lang)) {
                $lang = $this->config->value('language');
            }
            
            $file_to_load = $this->language_folder . $lang . '.php';

            return $this->loadFile($file_to_load);
        }
    }