The given key will be translated. If the result is empty, the key will be returned.

@return string
163653
public function render()
    {
        $key = $this->arguments['key'];
        $extensionName = $this->arguments['extensionName'];

        if (empty($key) || strpos($key, 'LLL') > 0) {
            return $key;
        }

        $request = $this->renderingContext->getControllerContext()->getRequest();
        $extensionName = $extensionName === null ? $request->getControllerExtensionName() : $extensionName;
        $result = LocalizationUtility::translate($key, $extensionName);
        return (empty($result) ? $key : $result);
    }
921420
protected function getKeyString()
    {
        $expected = $this->expected;
        $keys = '';
        $tail = array_pop($expected);

        if (!empty($expected)) {
            $keys = implode('","', $expected) . '", and "';
        }

        $keys .= $tail;

        return $keys;
    }
1148283
public function key()
    {
        $file = $this->current();
        return ($file !== null) ? (string) $file->file['_id'] : null;
    }
730745
protected static function translate($key)
    {
        if (is_callable(static::getTranslatorFunction())) {
            $translated = call_user_func(static::getTranslatorFunction(), $key);
            if ($key !== $translated) {
                return $translated;
            } else {
                return '';
            }
        } else {
            return '';
        }
    }
661935
public function key()
    {
        $extractor = $this->_key;

        return $extractor($this->_fetchCurrent(), parent::key(), $this);
    }
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;
	}
797000
protected function _getKey()
    {
        $view = $this->getView();
        $key  = $view->getIdentifier().'-'.$view->getLayout();

        if ($this->getMixer() instanceof KControllerModellable)
        {
            $state = $this->getModel()->getState()->getValues();
            $key  .= ':'.md5(http_build_query($state, '', '&'));
        }

        return $key;
    }
805229
public function key()
    {
        $key = key($this->data);
        return isset($this->keys[$key]) ? $this->keys[$key] : $key;
    }
209454
public function getTranslationAttribute($key, $locale = null, $fallback = true, $unmutated = false)
    {
        if ($this->isTranslationAttribute($key))
        {
            $translation = $this->translate($locale);

            $attribute = ($translation) ?
                ($unmutated ? $translation->getUnmutatedAttribute($key) : $translation->{$key}) :
                null;

            if (empty($attribute) && $fallback)
            {
                $translation = $this->translate($this->getFallbackLocale());

                if ($translation)
                {
                    return $unmutated ? $translation->getUnmutatedAttribute($key) : $translation->{$key};
                }
            }

            return $attribute;
        }

        return null;
    }
436925
public static function get($key) {
        if (isset(self::$keyvals) && isset(self::$keyvals[$key])) {
            return self::$keyvals[$key];
        }
        return '';
    }
1014302
public function getLanguageKey()
    {
        $languageKey = 'unknown';

        if ($this->environmentService->isEnvironmentInFrontendMode()) {
            $pageController = Core::get()->getPageController();

            if (isset($pageController->config['config']['language'])) {
                $languageKey = $pageController->config['config']['language'];
            }
        } else {
            $backendUser = Core::get()->getBackendUser();

            if (strlen($backendUser->uc['lang']) > 0) {
                $languageKey = $backendUser->uc['lang'];
            }
        }

        return $languageKey;
    }
707163
public function getCacheKey(): string
    {
        return $this->getTypePrefix() . $this->getFlexType() . '.' . sha1(json_encode($this->getKeys()) . $this->_keyField);
    }
68111
public function translate($key) {

		//First: check the cache:
		if(isset($this->cache[$key])) {
			if($this->cache[$key] instanceof DictionaryEntryNotFoundException) {
				throw $this->cache[$key];
			}
			return $this->cache[$key];
		}

		//If the key could not be found in cache,
		//and we do not have a valid domDocument to parse (ie. the dictionary was
		//initialized by restore rather than load)
		//throw an Entry Not Found Exception.
		if(null == $this->domDocument) {
		    $exception = new DictionaryEntryNotFoundException($key);
			$this->cache[$key] = $exception;
			throw $exception;
		}

		$xpath = new \DOMXPath($this->domDocument);

		//Find the entry (whose key attribute is as specified):
		$domNodeList = $xpath->evaluate('/fig:dictionary/entry[@key="' . $key . '"]');

		if($domNodeList->length == 0) {
			//The translation for this key was not found in the current dictionary.
            $exception = new DictionaryEntryNotFoundException($key);
			$this->cache[$key] = $exception;
			throw $exception;
		}

		//The Value part is the inner contents of the entry tag.
		$result = $this->domDocument->saveXML($domNodeList->item(0));
		$result = preg_replace('/^<entry[^>]+>/', '', $result);
		$result = preg_replace('/<\/entry>$/', '', $result);

		return ($this->cache[$key] = $result);
	}
10283
public function key()
	{
		$keys	= array_keys( $this->pairs );
		return $this->position < $this->count() ? $keys[$this->position] : NULL;
	}
1060275
public function getAttribute($key)
    {
        if ($this->isKeyReturningTranslationText($key)) {
            if ($translation = $this->getTranslation()) {
                return $translation->$key;
            }

            # fallback: try to find default locale values
            if ($translation = $this->getTranslation(\localizer\getDefault()->id())) {
                return $translation->$key;
            }

            return null;
        }

        return parent::getAttribute($key);
    }
1354071
public function get($key) {
        $key = $this->secureKey($key);
        
        if (isset($_SESSION[$key])) {
            return trim(Text::unlock($_SESSION[$key], $this->sugar()));
        } else {
            return '';
        }
    }
1182140
public function key()
    {
        if (is_null($this->ext)) {
            $this->ext = $this->generateExt();
        }
        return $this->ext;
    }