yii\i18n\DbMessageSource::loadMessages PHP Method

loadMessages() protected method

If translation for specific locale code such as en-US isn't found it tries more generic en.
protected loadMessages ( string $category, string $language ) : array
$category string the message category
$language string the target language
return array the loaded messages. The keys are original messages, and the values are translated messages.
    protected function loadMessages($category, $language)
    {
        if ($this->enableCaching) {
            $key = [__CLASS__, $category, $language];
            $messages = $this->cache->get($key);
            if ($messages === false) {
                $messages = $this->loadMessagesFromDb($category, $language);
                $this->cache->set($key, $messages, $this->cachingDuration);
            }
            return $messages;
        } else {
            return $this->loadMessagesFromDb($category, $language);
        }
    }