Get a text by key

@param string $key
@return mixed A content in the requested language or in the default
language if the requested does not exist.
972276
public function offsetGet($key)
    {
        $langs = Languages::getInstance($this->getCategory());
        return (isset($langs[$this->code][$key])) ?
            $langs[$this->code][$key] :
            $langs[$langs->getDefault()][$key];
    }
1299849
protected function retrieveMessageData($key)
    {
        $data = $this->client->get($this->data[$key])->getBody();

        if ($data instanceof Stream) {
            return $data->getContents();
        }

        return false;
    }
889070
public function get($key)
	{
		$value = xcache_get($this->prefix.$key);

		if (isset($value))
		{
			return $value;
		}
	}
356350
public function getValue($key)
    {
        return isset($this->langstrings[$key]) ? $this->langstrings[$key] : null;
    }
772387
public function get($key = '')
    {
        try {
            if ($this->cacheInstance !== NULL && is_object($this->cacheInstance)) {
                /**
                 * @var $cache object
                 */
                if (is_array($key)) {
                    $cache = $this->cacheInstance->getItems($key);
                } else {
                    $cache = $this->cacheInstance->getItem($key);
                }
                if (!$cache->isHit()) {
                    $result = NULL;
                    $this->debug->debug(__FUNCTION__, 'Unavailable Cache for Key: ' . $key);
                } else {
                    $result = $cache->get();
                    $this->debug->debug(__FUNCTION__, 'Get Cache from Key: ' . $key . ', result: ' . json_encode($result));
                }
                $message = 'Final get Content from Key: ' . $key . ' => Output result: ' . json_encode($result);
                $this->debug->info(__FUNCTION__, $message);

                return $result;
            } else {
                $this->debug->error(__FUNCTION__, 'Unavailable cacheInstance');

                return NULL;
            }
        }
        catch (\Exception $e) {
            $message = 'Error File: ' . $e->getFile() . ' - Line: ' . $e->getLine() . ' - Code: ' . $e->getCode() . ' - Message: ' . $e->getMessage();
            $this->debug->error(__FUNCTION__, $message);

            return $message;
        }
    }
456118
protected function getPageLocalizationByRequestKey($key)
	{
		$localization = $this->searchLocalizationByRequestKey($key);

		if ($localization === null) {

			$page = $this->searchPageByRequestKey($key);

			if ($page !== null) {
				return $page->getLocalization($this->getCurrentLocale()->getId());
			}
		}

		return $localization;
	}
1237997
protected function translate($key, $default = false)
    {
        $string = $this->translator->get($key);

        if ($default !== false) {
            if ($string == $key) {
                return $default;
            }
        }

        return $string;
    }
902652
public function get($key)
    {
        try {
            return $this->redis->get($key);
        } catch (\RedisException $e) {
            die("Error!: " . $e->getMessage() . "<br/>");
        }
    }
318249
public function getActualValueByKey(string $key): string
    {
        if($key==="") return "";
        $this->initData(Finder::getInstance()->getPathFolders(Finder::TYPE_TRANSLATIONS));

        $tc = Configuration::getInstance()->get('cms_translation_catcher');
        if(!isset(self::$init_data[$key]) && $tc && defined('P')){
            $key = str_replace(PHP_EOL, '', $key);
            $dir = DIR_BASE.'trans_catcher/';
            FileSystem::mkDir($dir);
            $file_name = $dir . P . '.txt';
            if(!file_exists($file_name)){
                $log = [];
            }else{
                $log_data = explode(PHP_EOL, file_get_contents($file_name));
                foreach($log_data as $r){
                    if(!$r) continue;
                    $l = explode('=>', $r, 2);
                    $log[trim($l[0],'"')] = trim($l[1], '",');
                }
            }
            if(!isset($log[$key])){
                $log[$key] = '';
            }
            $content = '';
            foreach($log as $k=>$v){
                $content .= '"'.$k.'"=>"'.$v.'",'.PHP_EOL;
            }
            file_put_contents ($file_name, $content);
        }

        return self::$init_data[$key] ?? $key;
    }
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;
	}
563160
private function getTranslationKey($key = null)
    {
        $t = $this->translator;
        $key = $t->has('helper::'.$key) ? 'helper::'.$key : $key;
        return $key;
    }
1291233
public function getKey(string $key)
    {
        $keys = explode('.', $key);
        $file = array_shift($keys);
        $keys = explode('/', implode('.', $keys));

        if (!isset($this->translations[$file])) {
            $this->addFile($file);
        }

        return $this->findKey($file, $keys);
    }
772022
public static function getTranslation($key)
  {
    $_key = strtoupper($key);
    if ( isset(self::$translations[$_key]) ){
      return self::$translations[$_key];
    }
    
    return $key;
  }
308474
function keyTranslate( $key )
    {
        $msg = $this->findKey( $key );
        if ( $msg !== null )
            return $msg["translation"];
        else
        {
            return null;
        }
    }
924205
public static function get($key)
    {
        exception_if(!array_has(self::$words, $key), LanguageKeyNotFoundException::class, $key);

        return array_get(self::$words, $key);
    }
305969
public function get($key)
    {
        if ( !$content = $this->info($key) ) {
            return null;
        }

        return $this->unpack($content);
    }
1354071
public function get($key) {
        $key = $this->secureKey($key);
        
        if (isset($_SESSION[$key])) {
            return trim(Text::unlock($_SESSION[$key], $this->sugar()));
        } else {
            return '';
        }
    }