public PoHeader::__toString()
Generate a Gettext PO formatted header string based on data set earlier.
File
- core/lib/Drupal/Component/Gettext/PoHeader.php, line 152
Class
- PoHeader
- Gettext PO header handler.
Namespace
Drupal\Component\Gettext
Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | public function __toString() { $output = '' ; $isTemplate = empty ( $this ->_languageName); $output .= '# ' . ( $isTemplate ? 'LANGUAGE' : $this ->_languageName) . ' translation of ' . ( $isTemplate ? 'PROJECT' : $this ->_projectName) . "\n" ; if (! empty ( $this ->_authors)) { $output .= '# Generated by ' . implode( "\n# " , $this ->_authors) . "\n" ; } $output .= "#\n" ; // Add the actual header information. $output .= "msgid \"\"\n" ; $output .= "msgstr \"\"\n" ; $output .= "\"Project-Id-Version: PROJECT VERSION\\n\"\n" ; $output .= "\"POT-Creation-Date: " . $this ->_po_date . "\\n\"\n" ; $output .= "\"PO-Revision-Date: " . $this ->_po_date . "\\n\"\n" ; $output .= "\"Last-Translator: NAME <EMAIL@ADDRESS>\\n\"\n" ; $output .= "\"Language-Team: LANGUAGE <EMAIL@ADDRESS>\\n\"\n" ; $output .= "\"MIME-Version: 1.0\\n\"\n" ; $output .= "\"Content-Type: text/plain; charset=utf-8\\n\"\n" ; $output .= "\"Content-Transfer-Encoding: 8bit\\n\"\n" ; $output .= "\"Plural-Forms: " . $this ->_pluralForms . "\\n\"\n" ; $output .= "\n" ; return $output ; } |
Please login to continue.