Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / lib / Drupal / Component / Gettext / PoItem.php
index 6c70990851d00b5e98baa69a37cc29962a630cf1..464875ef53143542eef381eb33182c28455a0437 100644 (file)
@@ -15,45 +15,45 @@ class PoItem {
    *
    * @var string
    */
-  private $_langcode;
+  protected $langcode;
 
   /**
    * The context this translation belongs to.
    *
    * @var string
    */
-  private $_context = '';
+  protected $context = '';
 
   /**
    * The source string or array of strings if it has plurals.
    *
    * @var string|array
    *
-   * @see $_plural
+   * @see $plural
    */
-  private $_source;
+  protected $source;
 
   /**
    * Flag indicating if this translation has plurals.
    *
    * @var bool
    */
-  private $_plural;
+  protected $plural;
 
   /**
    * The comment of this translation.
    *
    * @var string
    */
-  private $_comment;
+  protected $comment;
 
   /**
    * The translation string or array of strings if it has plurals.
    *
    * @var string|array
-   * @see $_plural
+   * @see $plural
    */
-  private $_translation;
+  protected $translation;
 
   /**
    * Gets the language code of the currently used language.
@@ -61,7 +61,7 @@ class PoItem {
    * @return string with langcode
    */
   public function getLangcode() {
-    return $this->_langcode;
+    return $this->langcode;
   }
 
   /**
@@ -70,7 +70,7 @@ class PoItem {
    * @param string $langcode
    */
   public function setLangcode($langcode) {
-    $this->_langcode = $langcode;
+    $this->langcode = $langcode;
   }
 
   /**
@@ -79,7 +79,7 @@ class PoItem {
    * @return string $context
    */
   public function getContext() {
-    return $this->_context;
+    return $this->context;
   }
 
   /**
@@ -88,7 +88,7 @@ class PoItem {
    * @param string $context
    */
   public function setContext($context) {
-    $this->_context = $context;
+    $this->context = $context;
   }
 
   /**
@@ -98,7 +98,7 @@ class PoItem {
    * @return string or array $translation
    */
   public function getSource() {
-    return $this->_source;
+    return $this->source;
   }
 
   /**
@@ -108,7 +108,7 @@ class PoItem {
    * @param string|array $source
    */
   public function setSource($source) {
-    $this->_source = $source;
+    $this->source = $source;
   }
 
   /**
@@ -118,7 +118,7 @@ class PoItem {
    * @return string or array $translation
    */
   public function getTranslation() {
-    return $this->_translation;
+    return $this->translation;
   }
 
   /**
@@ -128,7 +128,7 @@ class PoItem {
    * @param string|array $translation
    */
   public function setTranslation($translation) {
-    $this->_translation = $translation;
+    $this->translation = $translation;
   }
 
   /**
@@ -137,7 +137,7 @@ class PoItem {
    * @param bool $plural
    */
   public function setPlural($plural) {
-    $this->_plural = $plural;
+    $this->plural = $plural;
   }
 
   /**
@@ -146,7 +146,7 @@ class PoItem {
    * @return bool
    */
   public function isPlural() {
-    return $this->_plural;
+    return $this->plural;
   }
 
   /**
@@ -155,7 +155,7 @@ class PoItem {
    * @return String $comment
    */
   public function getComment() {
-    return $this->_comment;
+    return $this->comment;
   }
 
   /**
@@ -164,7 +164,7 @@ class PoItem {
    * @param string $comment
    */
   public function setComment($comment) {
-    $this->_comment = $comment;
+    $this->comment = $comment;
   }
 
   /**
@@ -185,11 +185,11 @@ class PoItem {
     if (isset($values['comment'])) {
       $this->setComment($values['comment']);
     }
-    if (isset($this->_source) &&
-        strpos($this->_source, LOCALE_PLURAL_DELIMITER) !== FALSE) {
-      $this->setSource(explode(LOCALE_PLURAL_DELIMITER, $this->_source));
-      $this->setTranslation(explode(LOCALE_PLURAL_DELIMITER, $this->_translation));
-      $this->setPlural(count($this->_source) > 1);
+    if (isset($this->source) &&
+        strpos($this->source, LOCALE_PLURAL_DELIMITER) !== FALSE) {
+      $this->setSource(explode(LOCALE_PLURAL_DELIMITER, $this->source));
+      $this->setTranslation(explode(LOCALE_PLURAL_DELIMITER, $this->translation));
+      $this->setPlural(count($this->source) > 1);
     }
   }
 
@@ -207,12 +207,12 @@ class PoItem {
     $output = '';
 
     // Format string context.
-    if (!empty($this->_context)) {
-      $output .= 'msgctxt ' . $this->formatString($this->_context);
+    if (!empty($this->context)) {
+      $output .= 'msgctxt ' . $this->formatString($this->context);
     }
 
     // Format translation.
-    if ($this->_plural) {
+    if ($this->plural) {
       $output .= $this->formatPlural();
     }
     else {
@@ -232,11 +232,11 @@ class PoItem {
     $output = '';
 
     // Format source strings.
-    $output .= 'msgid ' . $this->formatString($this->_source[0]);
-    $output .= 'msgid_plural ' . $this->formatString($this->_source[1]);
+    $output .= 'msgid ' . $this->formatString($this->source[0]);
+    $output .= 'msgid_plural ' . $this->formatString($this->source[1]);
 
-    foreach ($this->_translation as $i => $trans) {
-      if (isset($this->_translation[$i])) {
+    foreach ($this->translation as $i => $trans) {
+      if (isset($this->translation[$i])) {
         $output .= 'msgstr[' . $i . '] ' . $this->formatString($trans);
       }
       else {
@@ -252,8 +252,8 @@ class PoItem {
    */
   private function formatSingular() {
     $output = '';
-    $output .= 'msgid ' . $this->formatString($this->_source);
-    $output .= 'msgstr ' . (isset($this->_translation) ? $this->formatString($this->_translation) : '""');
+    $output .= 'msgid ' . $this->formatString($this->source);
+    $output .= 'msgstr ' . (isset($this->translation) ? $this->formatString($this->translation) : '""');
     return $output;
   }