X-Git-Url: http://aleph1.co.uk/gitweb/?a=blobdiff_plain;f=web%2Fcore%2Flib%2FDrupal%2FComponent%2FGettext%2FPoHeader.php;h=5d38de57f8f3a1924d70f4145bcce7cb809a0385;hb=1c1cb0980bfa6caf0c24cce671b6bb541dc87583;hp=96793b5e9562519adde499fa9ef61c1dc53e43f5;hpb=af6d1fb995500ae68849458ee10d66abbdcfb252;p=yaffs-website diff --git a/web/core/lib/Drupal/Component/Gettext/PoHeader.php b/web/core/lib/Drupal/Component/Gettext/PoHeader.php index 96793b5e9..5d38de57f 100644 --- a/web/core/lib/Drupal/Component/Gettext/PoHeader.php +++ b/web/core/lib/Drupal/Component/Gettext/PoHeader.php @@ -27,42 +27,42 @@ class PoHeader { * * @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 @@ class PoHeader { * 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 @@ class PoHeader { * 'nplurals=2; plural=(n > 1);'. */ public function getPluralForms() { - return $this->_pluralForms; + return $this->pluralForms; } /** @@ -96,7 +96,7 @@ class PoHeader { * Human readable language name. */ public function setLanguageName($languageName) { - $this->_languageName = $languageName; + $this->languageName = $languageName; } /** @@ -106,7 +106,7 @@ class PoHeader { * The human readable language name. */ public function getLanguageName() { - return $this->_languageName; + return $this->languageName; } /** @@ -116,7 +116,7 @@ class PoHeader { * Human readable project name. */ public function setProjectName($projectName) { - $this->_projectName = $projectName; + $this->projectName = $projectName; } /** @@ -126,7 +126,7 @@ class PoHeader { * The human readable project name. */ public function getProjectName() { - return $this->_projectName; + return $this->projectName; } /** @@ -142,7 +142,7 @@ class PoHeader { // 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 @@ class PoHeader { 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 @@ class PoHeader { $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 \\n\"\n"; $output .= "\"Language-Team: LANGUAGE \\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;