public function getTranslation(
        string $language,
        string $key
    ) : Translation {
        $languages = $this
            ->repositoryCollection
            ->getTranslations(
                [],
                [$language],
                function (Translation $translation) use ($key) {
                    return $translation->getKey() === $key;
                }
            );

        $firstLanguage = reset($languages);

        return $firstLanguage;
    }
public function getTranslation(
        string $language,
        string $key
    ) : Translation {
        $languages = $this
            ->repositoryCollection
            ->getTranslations(
                [],
                [$language],
                function (Translation $translation) use ($key) {
                    return $translation->getKey() === $key;
                }
            );

        $firstLanguage = reset($languages);

        return $firstLanguage;
    }
public function getTranslation ( string $ language , string $ key ) : Translation { $ languages = $ this -> repositoryCollection -> getTranslations ( [ ] , [ $ language ] , function ( Translation $ translation ) use ( $ key ) { return $ translation -> getKey ( ) === $ key ; } ) ; $ firstLanguage = reset ( $ languages ) ; return $ firstLanguage ; }
Get Translation given the language and the key.

@param string $language
@param string $key

@return Translation
Get Translation given the language and the key .