Return all language messages.

@return array

@throws \Exception
771537
protected function getMessages()
    {
        $messages = [];
        $path     = $this->sourcePath;

        if ( ! $this->file->exists($path)) {
            throw new \Exception("${path} doesn't exists!");
        }

        foreach ($this->file->allFiles($path) as $file) {
            $pathName = $file->getRelativePathName();

            if ($this->file->extension($pathName) !== 'php') {
                continue;
            }

            if ($this->isMessagesExcluded($pathName)) {
                continue;
            }

            $key = substr($pathName, 0, -4);
            $key = str_replace('\\', '.', $key);
            $key = str_replace('/', '.', $key);

            $messages[$key] = include $path . DIRECTORY_SEPARATOR . $pathName;
        }

        foreach ($this->file->allFiles(resource_path('lang')) as $file) {
            $pathName = $file->getRelativePathName();

            if ($this->file->extension($pathName) !== 'json') {
                continue;
            }
            $key                     = substr($pathName, 0, -4);
            $key                     = str_replace('\\', '.', $key);
            $key                     = str_replace('/', '.', $key);
            $messages[$key . 'json'] = json_decode(file_get_contents($file->getRealPath()));
        }

        return $messages;
    }
942314
public function getMessage()
    {
        $message = $this->message;

        if (is_array($message)) {
            $message = $this->language->translateArray($message);
        }

        return $message;
    }
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;
    }
124881
public function getAllMessage()
    {
        $messages = [];
        foreach (array_keys($this->errors) as $key) {
            $messages[$key] = $this->getMessage($key);
        }
        return $messages;
    }
178191
public function getAllMessages()
    {
        $messages = [];
        foreach (array_keys($this->errors) as $key) {
            $messages = array_merge($messages, $this->getMessages($key));
        }
        return $messages;
    }
1318684
private function getLanguages()
    {
        $allLanguages = $this->manager->languages();

        if (! $this->option('lang')) {
            return $allLanguages;
        }

        $userLanguages = explode(',', (string) $this->option('lang'));

        if ($missingLanguages = array_diff($userLanguages, $allLanguages)) {
            throw new InvalidArgumentException('Unknown Language(s) ['.implode(',', $missingLanguages).'].');
        }

        return $userLanguages;
    }
83811
private function getMessages()
    {
        $messages = [];
        $content = '';
        fseek($this->fh, 0);
        while (!feof($this->fh)) {
            $content .= fgets($this->fh);
        }
        if ($content) {
            $messages = json_decode($content, true);
        }
        return $messages;
    }
550285
function languages()
    {
        $languages = array();

        $languageLocaleList = $this->languageLocaleList();
        foreach( $languageLocaleList as $languageLocale )
            $languages[$languageLocale] = eZContentLanguage::fetchByLocale( $languageLocale );

        return $languages;
    }
155725
public function getLanguageList() {
		$files = glob($this->getPath().'messages_*.php');
		
		$startAt = strlen('messages_');
		$languages = array();
		foreach ($files as $file) {
			$base = basename($file);
			$languages[] = substr($base, $startAt, strrpos($base, '.php') - $startAt);
		}
		return $languages;
	}
1229041
public function getMessageForAllLanguages($key, $lang = null) {
		
		if (!$this->messages) {
			$this->loadAllMessages();
		}
		
		$messageArray = array();
		foreach ($this->messages as $language=>$messageLanguage) {
			if(is_null($lang) || $lang == "")
				$messageArray[$language] = $messageLanguage->getMessage($key);
			elseif($lang == $language)
				$messageArray[$language] = $messageLanguage->getMessage($key);
		}
		return $messageArray;
	}
282750
protected function getLangFiles()
    {
        if (static::$cache_lang_files) {
            return static::$cache_lang_files;
        }

        $locales = [];
        foreach ($this->getLangDirs() as $langPath) {
            $langFiles = scandir($langPath);
            foreach ($langFiles as $langFile) {
                $locale = pathinfo($langFile, PATHINFO_FILENAME);
                $ext = pathinfo($langFile, PATHINFO_EXTENSION);
                if ($locale && $ext === 'yml') {
                    $locales[$locale] = $locale;
                }
            }
        }
        ksort($locales);
        static::$cache_lang_files = $locales;
        return $locales;
    }
129168
public function getMessages() : array
    {
        $messages = [];

        foreach ($this->getLogs() as $log) {
            foreach ($log->getMessages() as $message) {
                $messages[] = $message;
            }
        }

        return $messages;
    }
656813
private function contentMessages()
    {
        $savedTranslations = $this->readSavedTranslations();
        // An exception occurred when reading the file
        if ($savedTranslations === null) {
            return '';
        }

        $this->gatherTranslatableStrings();

        // Find already translated strings
        $newTranslations = [];
        foreach (array_keys($this->translatables) as $key) {
            $newTranslations[$key] = isset($savedTranslations[$key]) ? $savedTranslations[$key] : '';
        }
        ksort($newTranslations);

        try {
            return $this->buildNewContent($newTranslations, $savedTranslations);
        } catch (InvalidResourceException $e) {
            // last resort fallback, edit the file
            return file_get_contents($this->absPath);
        }
    }
550526
protected function get_messages() {
        global $SESSION;

        $messages = array();
        if (!empty($SESSION->lesson_messages) && is_array($SESSION->lesson_messages) && array_key_exists($this->properties->id, $SESSION->lesson_messages)) {
            $messages = $SESSION->lesson_messages[$this->properties->id];
            unset($SESSION->lesson_messages[$this->properties->id]);
        }

        return $messages;
    }
12914
protected function getLocaleChoices()
    {
        $locale = [];

        foreach ($this->languages as $language) {
            $locale[$language['label']] = $language['locale'];
        }

        return $locale;
    }
332591
public static function getAvailableLanguages(){
        $languages = array();
        foreach(common_ext_ExtensionsManager::singleton()->getInstalledExtensions() as $extension){
           $localesDir = $extension->getDir() . 'locales/';
           foreach(glob($localesDir . '*') as  $file){
                if(is_dir($file) && file_exists($file . '/messages.po')){
                    $lang = basename($file);
                    if(!in_array($lang, $languages)){
                        $languages[] = $lang;
                    }
                }
           }
        } 
        return $languages;
    }
1019418
protected function getMessages()
    {
        $messages = [];
        $path = $this->sourcePath;

        if (!$this->file->exists($path)) {
            throw new \Exception("${path} doesn't exists!");
        }

        foreach ($this->file->allFiles($path) as $file) {
            $pathName = $file->getRelativePathName();
            $extension = $this->file->extension($pathName);
            if ($extension != 'php' && $extension != 'json') {
                continue;
            }

            if ($this->isMessagesExcluded($pathName)) {
                continue;
            }

            $key = substr($pathName, 0, -4);
            $key = str_replace('\\', '.', $key);
            $key = str_replace('/', '.', $key);

            if (starts_with($key, 'vendor')) {
                $key = $this->getVendorKey($key);
            }

            $fullPath = $path.DIRECTORY_SEPARATOR.$pathName;
            if ($extension == 'php') {
                $messages[$key] = include $fullPath;
            } else {
                $key = $key.$this->stringsDomain;
                $fileContent = file_get_contents($fullPath);
                $messages[$key] = json_decode($fileContent, true);
            }
        }

        $this->sortMessages($messages);

        return $messages;
    }