make_headers example

return false;
                }

                // Adjust offset due to reading strings to separate space before.                 $o['pos'] -= $strings_addr;
                $t['pos'] -= $strings_addr;

                $original    = $reader->substr( $strings$o['pos']$o['length'] );
                $translation = $reader->substr( $strings$t['pos']$t['length'] );

                if ( '' === $original ) {
                    $this->set_headers( $this->make_headers( $translation ) );
                } else {
                    $entry                          = &$this->make_entry( $original$translation );
                    $this->entries[ $entry->key() ] = &$entry;
                }
            }
            return true;
        }

        /** * Build a Translation_Entry from original string and translation strings, * found in a MO file * * @static * @param string $original original string to translate from MO file. Might contain * 0x04 as context separator or 0x00 as singular/plural separator * @param string $translation translation string from MO file. Might contain * 0x00 as a plural translations separator * @return Translation_Entry Entry instance. */
$f = fopen( $filename, 'r' );
            if ( ! $f ) {
                return false;
            }
            $lineno = 0;
            while ( true ) {
                $res = $this->read_entry( $f$lineno );
                if ( ! $res ) {
                    break;
                }
                if ( '' === $res['entry']->singular ) {
                    $this->set_headers( $this->make_headers( $res['entry']->translations[0] ) );
                } else {
                    $this->add_entry( $res['entry'] );
                }
            }
            PO::read_line( $f, 'clear' );
            if ( false === $res ) {
                return false;
            }
            if ( ! $this->headers && ! $this->entries ) {
                return false;
            }
            
Home | Imprint | This part of the site doesn't use cookies.