From 7086111ad4dd997e12a3220e1ee60c9b9bcf0bb8 Mon Sep 17 00:00:00 2001 From: Charles Date: Tue, 7 Jan 2020 13:06:14 +0100 Subject: Added wordpress --- srcs/wordpress/wp-includes/pomo/entry.php | 103 ++++++++++++++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 srcs/wordpress/wp-includes/pomo/entry.php (limited to 'srcs/wordpress/wp-includes/pomo/entry.php') diff --git a/srcs/wordpress/wp-includes/pomo/entry.php b/srcs/wordpress/wp-includes/pomo/entry.php new file mode 100644 index 0000000..b5e56ff --- /dev/null +++ b/srcs/wordpress/wp-includes/pomo/entry.php @@ -0,0 +1,103 @@ + $value ) { + $this->$varname = $value; + } + if ( isset( $args['plural'] ) && $args['plural'] ) { + $this->is_plural = true; + } + if ( ! is_array( $this->translations ) ) { + $this->translations = array(); + } + if ( ! is_array( $this->references ) ) { + $this->references = array(); + } + if ( ! is_array( $this->flags ) ) { + $this->flags = array(); + } + } + + /** + * PHP4 constructor. + */ + public function Translation_Entry( $args = array() ) { + self::__construct( $args ); + } + + /** + * Generates a unique key for this entry + * + * @return string|bool the key or false if the entry is empty + */ + function key() { + if ( null === $this->singular || '' === $this->singular ) { + return false; + } + + // Prepend context and EOT, like in MO files + $key = ! $this->context ? $this->singular : $this->context . "\4" . $this->singular; + // Standardize on \n line endings + $key = str_replace( array( "\r\n", "\r" ), "\n", $key ); + + return $key; + } + + /** + * @param object $other + */ + function merge_with( &$other ) { + $this->flags = array_unique( array_merge( $this->flags, $other->flags ) ); + $this->references = array_unique( array_merge( $this->references, $other->references ) ); + if ( $this->extracted_comments != $other->extracted_comments ) { + $this->extracted_comments .= $other->extracted_comments; + } + + } + } +endif; -- cgit