RainLab\Translate\Models\Message::forLocale PHP 메소드

forLocale() 공개 메소드

Gets a message for a given locale, or the default.
public forLocale ( string $locale = null, $default = null ) : string
$locale string
리턴 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;
    }