Cake\Shell\Task\ExtractTask::_addTranslation PHP Method

_addTranslation() protected method

Takes care of duplicate translations
protected _addTranslation ( string $domain, string $msgid, array $details = [] ) : void
$domain string The domain
$msgid string The message string
$details array Context and plural form if any, file and line references
return void
    protected function _addTranslation($domain, $msgid, $details = [])
    {
        $context = isset($details['msgctxt']) ? $details['msgctxt'] : "";
        if (empty($this->_translations[$domain][$msgid][$context])) {
            $this->_translations[$domain][$msgid][$context] = ['msgid_plural' => false];
        }
        if (isset($details['msgid_plural'])) {
            $this->_translations[$domain][$msgid][$context]['msgid_plural'] = $details['msgid_plural'];
        }
        if (isset($details['file'])) {
            $line = isset($details['line']) ? $details['line'] : 0;
            $this->_translations[$domain][$msgid][$context]['references'][$details['file']][] = $line;
        }
    }