public static function export_entry(EntryTranslations &$entry)
    {
        if (null === $entry->singular || '' === $entry->singular) {
            return false;
        }
        $po = array();
        if (!empty($entry->translator_comments)) {
            $po[] = self::comment_block($entry->translator_comments);
        }
        if (!empty($entry->extracted_comments)) {
            $po[] = self::comment_block($entry->extracted_comments, '.');
        }
        if (!empty($entry->references)) {
            $po[] = self::comment_block(implode(' ', $entry->references), ':');
        }
        if (!empty($entry->flags)) {
            $po[] = self::comment_block(implode(', ', $entry->flags), ',');
        }
        if (!is_null($entry->context)) {
            $po[] = 'msgctxt ' . self::poify($entry->context);
        }
        $po[] = 'msgid ' . self::poify($entry->singular);
        if (!$entry->is_plural) {
            $translation = empty($entry->translations) ?
                '' :
                $entry->translations[0];
            $translation = self::match_begin_and_end_newlines($translation, $entry->singular);
            $po[] = 'msgstr ' . self::poify($translation);
        } else {
            $po[] = 'msgid_plural ' . self::poify($entry->plural);
            $translations = empty($entry->translations) ?
                array('', '') :
                $entry->translations;
            foreach ($translations as $i => $translation) {
                $translation = self::match_begin_and_end_newlines($translation, $entry->plural);
                $po[] = "msgstr[$i] " . self::poify($translation);
            }
        }

        return implode("\n", $po);
    }
public static function export_entry(EntryTranslations &$entry)
    {
        if (null === $entry->singular || '' === $entry->singular) {
            return false;
        }
        $po = array();
        if (!empty($entry->translator_comments)) {
            $po[] = self::comment_block($entry->translator_comments);
        }
        if (!empty($entry->extracted_comments)) {
            $po[] = self::comment_block($entry->extracted_comments, '.');
        }
        if (!empty($entry->references)) {
            $po[] = self::comment_block(implode(' ', $entry->references), ':');
        }
        if (!empty($entry->flags)) {
            $po[] = self::comment_block(implode(', ', $entry->flags), ',');
        }
        if (!is_null($entry->context)) {
            $po[] = 'msgctxt ' . self::poify($entry->context);
        }
        $po[] = 'msgid ' . self::poify($entry->singular);
        if (!$entry->is_plural) {
            $translation = empty($entry->translations) ?
                '' :
                $entry->translations[0];
            $translation = self::match_begin_and_end_newlines($translation, $entry->singular);
            $po[] = 'msgstr ' . self::poify($translation);
        } else {
            $po[] = 'msgid_plural ' . self::poify($entry->plural);
            $translations = empty($entry->translations) ?
                array('', '') :
                $entry->translations;
            foreach ($translations as $i => $translation) {
                $translation = self::match_begin_and_end_newlines($translation, $entry->plural);
                $po[] = "msgstr[$i] " . self::poify($translation);
            }
        }

        return implode("\n", $po);
    }
public static function export_entry ( EntryTranslations & $ entry ) { if ( null === $ entry -> singular || '' === $ entry -> singular ) { return false ; } $ po = array ( ) ; if ( ! empty ( $ entry -> translator_comments ) ) { $ po [ ] = self :: comment_block ( $ entry -> translator_comments ) ; } if ( ! empty ( $ entry -> extracted_comments ) ) { $ po [ ] = self :: comment_block ( $ entry -> extracted_comments , '.' ) ; } if ( ! empty ( $ entry -> references ) ) { $ po [ ] = self :: comment_block ( implode ( ' ' , $ entry -> references ) , ':' ) ; } if ( ! empty ( $ entry -> flags ) ) { $ po [ ] = self :: comment_block ( implode ( ', ' , $ entry -> flags ) , ',' ) ; } if ( ! is_null ( $ entry -> context ) ) { $ po [ ] = 'msgctxt ' . self :: poify ( $ entry -> context ) ; } $ po [ ] = 'msgid ' . self :: poify ( $ entry -> singular ) ; if ( ! $ entry -> is_plural ) { $ translation = empty ( $ entry -> translations ) ? '' : $ entry -> translations [ 0 ] ; $ translation = self :: match_begin_and_end_newlines ( $ translation , $ entry -> singular ) ; $ po [ ] = 'msgstr ' . self :: poify ( $ translation ) ; } else { $ po [ ] = 'msgid_plural ' . self :: poify ( $ entry -> plural ) ; $ translations = empty ( $ entry -> translations ) ? array ( '' , '' ) : $ entry -> translations ; foreach ( $ translations as $ i => $ translation ) { $ translation = self :: match_begin_and_end_newlines ( $ translation , $ entry -> plural ) ; $ po [ ] = "msgstr[$i] " . self :: poify ( $ translation ) ; } } return implode ( "\n" , $ po ) ; }
Builds a string from the entry for inclusion in PO file.

@static

@param EntryTranslations &$entry the entry to convert to po string

@return false|string PO-style formatted string for the entry or
false if the entry is empty
Builds a string from the entry for inclusion in PO file .