return $this->import_from_reader($reader);
}
+ /**
+ * @param string $filename
+ * @return bool
+ */
function export_to_file($filename) {
$fh = fopen($filename, 'wb');
if ( !$fh ) return false;
return $res;
}
+ /**
+ * @return string|false
+ */
function export() {
$tmp_fh = fopen("php://temp", 'r+');
if ( !$tmp_fh ) return false;
return stream_get_contents( $tmp_fh );
}
+ /**
+ * @param Translation_Entry $entry
+ * @return bool
+ */
function is_entry_good_for_export( $entry ) {
if ( empty( $entry->translations ) ) {
return false;
return true;
}
+ /**
+ * @param resource $fh
+ * @return true
+ */
function export_to_file_handle($fh) {
$entries = array_filter( $this->entries, array( $this, 'is_entry_good_for_export' ) );
ksort($entries);
return true;
}
+ /**
+ * @param Translation_Entry $entry
+ * @return string
+ */
function export_original($entry) {
//TODO: warnings for control characters
$exported = $entry->singular;
return $exported;
}
+ /**
+ * @param Translation_Entry $entry
+ * @return string
+ */
function export_translations($entry) {
//TODO: warnings for control characters
return implode(chr(0), $entry->translations);
}
+ /**
+ * @return string
+ */
function export_headers() {
$exported = '';
foreach($this->headers as $header => $value) {
return $exported;
}
+ /**
+ * @param int $magic
+ * @return string|false
+ */
function get_byteorder($magic) {
// The magic is 0x950412de
return $entry;
}
+ /**
+ * @param int $count
+ * @return string
+ */
function select_plural_form($count) {
return $this->gettext_select_plural_form($count);
}
+ /**
+ * @return int
+ */
function get_plural_forms_count() {
return $this->_nplurals;
}