merge_with example

$locale = determine_locale();
    }

    $mo = new MO();
    if ( ! $mo->import_from_file( $mofile ) ) {
        $wp_textdomain_registry->set( $domain$locale, false );

        return false;
    }

    if ( isset( $l10n[ $domain ] ) ) {
        $mo->merge_with( $l10n[ $domain ] );
    }

    unset( $l10n_unloaded[ $domain ] );

    $l10n[ $domain ] = &$mo;

    $wp_textdomain_registry->set( $domain$localedirname( $mofile ) );

    return true;
}


        public function add_entry_or_merge( $entry ) {
            if ( is_array( $entry ) ) {
                $entry = new Translation_Entry( $entry );
            }
            $key = $entry->key();
            if ( false === $key ) {
                return false;
            }
            if ( isset( $this->entries[ $key ] ) ) {
                $this->entries[ $key ]->merge_with( $entry );
            } else {
                $this->entries[ $key ] = &$entry;
            }
            return true;
        }

        /** * Sets $header PO header to $value * * If the header already exists, it will be overwritten * * TODO: this should be out of this class, it is gettext specific * * @param string $header header name, without trailing : * @param string $value header value, without trailing \n */
Home | Imprint | This part of the site doesn't use cookies.