RainLab\Translate\Models\Message::forLocale PHP Method

forLocale() public method

Gets a message for a given locale, or the default.
public forLocale ( string $locale = null, $default = null ) : string
$locale string
return string
    public function forLocale($locale = null, $default = null)
    {
        if ($locale === null) {
            $locale = self::DEFAULT_LOCALE;
        }
        if (array_key_exists($locale, $this->message_data)) {
            return $this->message_data[$locale];
        }
        return $default;
    }