Gdn::translate PHP Method

translate() public static method

Translates a code into the selected locale's definition.
public static translate ( string $Code, string $Default = false ) : string
$Code string The code related to the language-specific definition.
$Default string The default value to be displayed if the translation code is not found.
return string The translated string or $Code if there is no value in $Default.
    public static function translate($Code, $Default = false)
    {
        $Locale = Gdn::locale();
        if ($Locale) {
            return $Locale->translate($Code, $Default);
        } else {
            return $Default;
        }
    }