/*!
\pure
\return the translation message for the key \a $key or null if the key does not exist.

This function must overridden if isKeyBased() is true.
185912
function findKey( $key )
    {
        $num = $this->keyPick( $key );
        if ( $num >=0 and $num <= count( $this->Handlers ) )
        {
            $handler = $this->Handlers[$num];
            return $handler->findKey( $key );
        }
        $retValue = null;
        return $retValue;
    }
366481
private function getMessage($filename, $key)
    {
        $messageset = $this->getParameters('messageset');

        // If we have a matching key in messageset it wins
        if (array_get($messageset, $key))
        {
            return array_get($messageset, $key);
        }

        $fileKey = ($this->languageKey) ? $this->languageKey . '.' . $key : $key;

        // We have a couple of options where messages could be retrieved by default,
        // try: Model.php and model.php, as well as Model_Model.php and Model/Model.php
        $messages = [
            $filename . $fileKey,
            Str::lower($filename) . $fileKey,
            str_replace('_', '/', $filename) . $fileKey,
            Str::lower(str_replace('_', '/', $filename)) . $fileKey
        ];

        // Cycle through messages trying to find one that is valid
        foreach ($messages as $message)
        {
            if (Lang::has($message))
            {
                return Lang::get($message);
            }
        }

        return "";
    }
250960
public function getKeyValue($key)
    {
        return empty($this->_data[$key]) ? null: $this->_data[$key];
    }
513160
public function translate($key, $translation, $locale = null) {
        $this->translations[$this->locale($locale)][$key] = $translation;

        return $translation;
    }
713501
public function getKey($key)
    {
        $tokens = explode('.', $key);


        $first = array_shift($tokens);
        $first = str_replace('POINT', '.', $first);

        $that = $this;

        $value = $that[$first];

        foreach($tokens as $k) {
            $k = str_replace('POINT', '.', $k);
            if (false === isset($value[$k])) {
                return null;
            }
            $value = $value[$k];
        }

        return $value;
    }
1182570
public function getFlashMessage($key)
    {
        $session = static::getInstance();
        foreach ($session->getFlashBag()->get($key, []) as $message) {
            return $message ?: null;
        }

        return '';
    }
118276
function findKey( $key )
    {
        $msg = null;
        if ( isset( $this->Messages[$key] ) )
        {
            $msg = $this->Messages[$key];
        }
        return $msg;
    }
891119
function keyTranslate( $key )
    {
        $num = $this->keyPick( $key );
        if ( $num >=0 and $num <= count( $this->Handlers ) )
        {
            $handler = $this->Handlers[$num];
            return $handler->keyTranslate( $key );
        }

        return null;
    }
157689
private function translateWithLang($key, $lang) {
        if (!isset($this->translations[$lang]) || !isset($this->translations[$lang][$key])) {
            return null;
        }

        return $this->translations[$lang][$key];
    }
1021280
private function get($key) {
		if (isset($_SESSION[self::SESSION_KEY_FLASH]) && isset($_SESSION[self::SESSION_KEY_FLASH][$key])) {
			$message = $_SESSION[self::SESSION_KEY_FLASH][$key];

			unset($_SESSION[self::SESSION_KEY_FLASH][$key]);

			return $message;
		}
		else {
			return null;
		}
	}
826731
public String getMessage(String key, Locale locale)
	{
		if (null == locale)
		{
			return getMessage(key);
		}
		return CollectionTools.getString(getResourceBundle(locale), key, getBehaviourOnMissingMessage().getValueOnMissingMessage(key));
	}
923633
public function translate($key)
    {
        if ($this->translations === null) {
            $this->loadTranslations();
        }

        if (!isset($this->translations[$key])) {
            // the key if $this is already the fallback translator
            return $this !== self::$fallbackTranslator ? self::$fallbackTranslator->translate($key) : $key;
        }

        return  $this->translations[$key];
    }
1136870
public function getMessageDefaults($key = null)
    {
        if (is_null($key)) {
            return $this->messageDefaults;
        }

        if (isset($this->messageDefaults[$key])) {
            return $this->messageDefaults[$key];
        }
    }
464098
public function trans($key, array $args = [], $lang = null)
    {
        return $this->translate($key, $args, $lang);
    }
207332
protected function getCustomMessageFromTranslator($key)
    {
        if (($message = $this->translator->trans($key)) !== $key) {
            return $message;
        }

        // If an exact match was not found for the key, we will collapse all of these
        // messages and loop through them and try to find a wildcard match for the
        // given key. Otherwise, we will simply return the key's value back out.
        $shortKey = preg_replace(
            '/^validation\.custom\./', '', $key
        );

        return $this->getWildcardCustomMessages(Arr::dot(
            (array) $this->translator->trans('validation.custom')
        ), $shortKey, $key);
    }
1122491
protected function translate($key, array $arguments = null)
    {
        $ret = LocalizationUtility::translate($key, $this->extensionName, $arguments);

        // Not translated handling
        if ($ret === null) {
            $ret = '[-' . $key . '-]';
        }

        return $ret;
    }
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 '';
        }
    }