Beispiel #1
0
function __($phrase, array $replacePhrase = [])
{
    $thisLang = Lang::locale();
    $arrayTranslate = Trans::fillCacheTrans();
    if (isset($arrayTranslate[$phrase][$thisLang])) {
        $phrase = $arrayTranslate[$phrase][$thisLang];
    } else {
        $phrase = Trans::generateTranslation($phrase, $thisLang);
    }
    if (count($replacePhrase)) {
        $phrase = str_replace(array_keys($replacePhrase), array_values($replacePhrase), $phrase);
    }
    return $phrase;
}