Prado\I18N\core\MessageSource_gettext::save PHP Method

save() public method

If the translation was not found, you should add those strings to the translation source via the append() method.
public save ( $catalogue = 'messages' ) : boolean
return boolean true if saved successfuly, false otherwise.
    function save($catalogue = 'messages')
    {
        $messages = $this->untranslated;
        if (count($messages) <= 0) {
            return false;
        }
        $variants = $this->getVariants($catalogue);
        if ($variants) {
            list($variant, $MOFile, $POFile) = $variants;
        } else {
            list($variant, $MOFile, $POFile) = $this->createMessageTemplate($catalogue);
        }
        if (is_writable($MOFile) == false) {
            throw new TIOException("Unable to save to file {$MOFile}, file must be writable.");
        }
        if (is_writable($POFile) == false) {
            throw new TIOException("Unable to save to file {$POFile}, file must be writable.");
        }
        //set the strings as untranslated.
        $strings = array();
        foreach ($messages as $message) {
            $strings[$message] = '';
        }
        //load the PO
        $po = TGettext::factory('PO', $POFile);
        $po->load();
        $result = $po->toArray();
        $existing = count($result['strings']);
        //add to strings to the existing message list
        $result['strings'] = array_merge($result['strings'], $strings);
        $new = count($result['strings']);
        if ($new > $existing) {
            //change the date 2004-12-25 12:26
            $result['meta']['PO-Revision-Date'] = @date('Y-m-d H:i:s');
            $po->fromArray($result);
            $mo = $po->toMO();
            if ($po->save() && $mo->save($MOFile)) {
                if (!empty($this->cache)) {
                    $this->cache->clean($variant, $this->culture);
                }
                return true;
            } else {
                return false;
            }
        }
        return false;
    }