*
* @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.
* 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);';
}
/**
* 'nplurals=2; plural=(n > 1);'.
*/
public function getPluralForms() {
- return $this->_pluralForms;
+ return $this->pluralForms;
}
/**
* Human readable language name.
*/
public function setLanguageName($languageName) {
- $this->_languageName = $languageName;
+ $this->languageName = $languageName;
}
/**
* The human readable language name.
*/
public function getLanguageName() {
- return $this->_languageName;
+ return $this->languageName;
}
/**
* Human readable project name.
*/
public function setProjectName($projectName) {
- $this->_projectName = $projectName;
+ $this->projectName = $projectName;
}
/**
* The human readable project name.
*/
public function getProjectName() {
- return $this->_projectName;
+ return $this->projectName;
}
/**
// 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'];
}
}
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";
$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;