TranslateGettext::xlateStringCallback PHP Method

xlateStringCallback() private method

This function simply wraps gettext() call, but provides ability to log string replacements. (alternative would be using preg_replace with /e which would probably be faster, but no ability to debug/log.)
private xlateStringCallback ( array $matches ) : string
$matches array Array of matches; we're interested in $matches[2].
return string Translated text
    private function xlateStringCallback($matches)
    {
        $charbefore = $matches[1];
        $msgid = $matches[2];
        $translated = gettext($msgid);
        $this->log("Translating \"{$msgid}\" => \"{$translated}\"", Project::MSG_DEBUG);
        return $charbefore . '"' . $translated . '"';
    }