Mercurial > hg > isophonics-drupal-site
diff core/lib/Drupal/Component/Gettext/PoHeader.php @ 17:129ea1e6d783
Update, including to Drupal core 8.6.10
author | Chris Cannam |
---|---|
date | Thu, 28 Feb 2019 13:21:36 +0000 |
parents | 1fec387a4317 |
children |
line wrap: on
line diff
--- a/core/lib/Drupal/Component/Gettext/PoHeader.php Tue Jul 10 15:07:59 2018 +0100 +++ b/core/lib/Drupal/Component/Gettext/PoHeader.php Thu Feb 28 13:21:36 2019 +0000 @@ -27,42 +27,42 @@ * * @var string */ - private $_langcode; + protected $langcode; /** * Formula for the plural form. * * @var string */ - private $_pluralForms; + protected $pluralForms; /** * Author(s) of the file. * * @var string */ - private $_authors; + protected $authors; /** * Date the po file got created. * * @var string */ - private $_po_date; + protected $poDate; /** * Human readable language name. * * @var string */ - private $_languageName; + protected $languageName; /** * Name of the project the translation belongs to. * * @var string */ - private $_projectName; + protected $projectName; /** * Constructor, creates a PoHeader with default values. @@ -71,11 +71,11 @@ * Language code. */ public function __construct($langcode = NULL) { - $this->_langcode = $langcode; + $this->langcode = $langcode; // Ignore errors when run during site installation before // date_default_timezone_set() is called. - $this->_po_date = @date("Y-m-d H:iO"); - $this->_pluralForms = 'nplurals=2; plural=(n > 1);'; + $this->poDate = @date("Y-m-d H:iO"); + $this->pluralForms = 'nplurals=2; plural=(n > 1);'; } /** @@ -86,7 +86,7 @@ * 'nplurals=2; plural=(n > 1);'. */ public function getPluralForms() { - return $this->_pluralForms; + return $this->pluralForms; } /** @@ -96,7 +96,7 @@ * Human readable language name. */ public function setLanguageName($languageName) { - $this->_languageName = $languageName; + $this->languageName = $languageName; } /** @@ -106,7 +106,7 @@ * The human readable language name. */ public function getLanguageName() { - return $this->_languageName; + return $this->languageName; } /** @@ -116,7 +116,7 @@ * Human readable project name. */ public function setProjectName($projectName) { - $this->_projectName = $projectName; + $this->projectName = $projectName; } /** @@ -126,7 +126,7 @@ * The human readable project name. */ public function getProjectName() { - return $this->_projectName; + return $this->projectName; } /** @@ -142,7 +142,7 @@ // There is only one value relevant for our header implementation when // reading, and that is the plural formula. if (!empty($values['Plural-Forms'])) { - $this->_pluralForms = $values['Plural-Forms']; + $this->pluralForms = $values['Plural-Forms']; } } @@ -152,11 +152,11 @@ public function __toString() { $output = ''; - $isTemplate = empty($this->_languageName); + $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 .= '# ' . ($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"; @@ -164,14 +164,14 @@ $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 .= "\"POT-Creation-Date: " . $this->poDate . "\\n\"\n"; + $output .= "\"PO-Revision-Date: " . $this->poDate . "\\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 .= "\"Plural-Forms: " . $this->pluralForms . "\\n\"\n"; $output .= "\n"; return $output;