diff --git a/core/lib/Drupal/Component/Gettext/PoHeader.php b/core/lib/Drupal/Component/Gettext/PoHeader.php
index 96793b5..5d38de5 100644
--- a/core/lib/Drupal/Component/Gettext/PoHeader.php
+++ b/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 @@ public function __construct($langcode = NULL) {
    *   'nplurals=2; plural=(n > 1);'.
    */
   public function getPluralForms() {
-    return $this->_pluralForms;
+    return $this->pluralForms;
   }
 
   /**
@@ -96,7 +96,7 @@ public function getPluralForms() {
    *   Human readable language name.
    */
   public function setLanguageName($languageName) {
-    $this->_languageName = $languageName;
+    $this->languageName = $languageName;
   }
 
   /**
@@ -106,7 +106,7 @@ public function setLanguageName($languageName) {
    *   The human readable language name.
    */
   public function getLanguageName() {
-    return $this->_languageName;
+    return $this->languageName;
   }
 
   /**
@@ -116,7 +116,7 @@ public function getLanguageName() {
    *   Human readable project name.
    */
   public function setProjectName($projectName) {
-    $this->_projectName = $projectName;
+    $this->projectName = $projectName;
   }
 
   /**
@@ -126,7 +126,7 @@ public function setProjectName($projectName) {
    *   The human readable project name.
    */
   public function getProjectName() {
-    return $this->_projectName;
+    return $this->projectName;
   }
 
   /**
@@ -142,7 +142,7 @@ public function setFromString($header) {
     // 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 setFromString($header) {
   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 @@ public function __toString() {
     $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;
diff --git a/core/lib/Drupal/Component/Gettext/PoItem.php b/core/lib/Drupal/Component/Gettext/PoItem.php
index 6c70990..464875e 100644
--- a/core/lib/Drupal/Component/Gettext/PoItem.php
+++ b/core/lib/Drupal/Component/Gettext/PoItem.php
@@ -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 @@ public function getLangcode() {
    * @param string $langcode
    */
   public function setLangcode($langcode) {
-    $this->_langcode = $langcode;
+    $this->langcode = $langcode;
   }
 
   /**
@@ -79,7 +79,7 @@ public function setLangcode($langcode) {
    * @return string $context
    */
   public function getContext() {
-    return $this->_context;
+    return $this->context;
   }
 
   /**
@@ -88,7 +88,7 @@ public function getContext() {
    * @param string $context
    */
   public function setContext($context) {
-    $this->_context = $context;
+    $this->context = $context;
   }
 
   /**
@@ -98,7 +98,7 @@ public function setContext($context) {
    * @return string or array $translation
    */
   public function getSource() {
-    return $this->_source;
+    return $this->source;
   }
 
   /**
@@ -108,7 +108,7 @@ public function getSource() {
    * @param string|array $source
    */
   public function setSource($source) {
-    $this->_source = $source;
+    $this->source = $source;
   }
 
   /**
@@ -118,7 +118,7 @@ public function setSource($source) {
    * @return string or array $translation
    */
   public function getTranslation() {
-    return $this->_translation;
+    return $this->translation;
   }
 
   /**
@@ -128,7 +128,7 @@ public function getTranslation() {
    * @param string|array $translation
    */
   public function setTranslation($translation) {
-    $this->_translation = $translation;
+    $this->translation = $translation;
   }
 
   /**
@@ -137,7 +137,7 @@ public function setTranslation($translation) {
    * @param bool $plural
    */
   public function setPlural($plural) {
-    $this->_plural = $plural;
+    $this->plural = $plural;
   }
 
   /**
@@ -146,7 +146,7 @@ public function setPlural($plural) {
    * @return bool
    */
   public function isPlural() {
-    return $this->_plural;
+    return $this->plural;
   }
 
   /**
@@ -155,7 +155,7 @@ public function isPlural() {
    * @return String $comment
    */
   public function getComment() {
-    return $this->_comment;
+    return $this->comment;
   }
 
   /**
@@ -164,7 +164,7 @@ public function getComment() {
    * @param string $comment
    */
   public function setComment($comment) {
-    $this->_comment = $comment;
+    $this->comment = $comment;
   }
 
   /**
@@ -185,11 +185,11 @@ public function setFromArray(array $values = []) {
     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 @@ private function formatItem() {
     $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 @@ private function formatPlural() {
     $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 @@ private function formatPlural() {
    */
   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;
   }
 
diff --git a/core/lib/Drupal/Component/Gettext/PoMemoryWriter.php b/core/lib/Drupal/Component/Gettext/PoMemoryWriter.php
index c5416b6..bac9e44 100644
--- a/core/lib/Drupal/Component/Gettext/PoMemoryWriter.php
+++ b/core/lib/Drupal/Component/Gettext/PoMemoryWriter.php
@@ -12,13 +12,13 @@ class PoMemoryWriter implements PoWriterInterface {
    *
    * @var array
    */
-  private $_items;
+  protected $items;
 
   /**
    * Constructor, initialize empty items.
    */
   public function __construct() {
-    $this->_items = [];
+    $this->items = [];
   }
 
   /**
@@ -30,7 +30,7 @@ public function writeItem(PoItem $item) {
       $item->setTranslation(implode(LOCALE_PLURAL_DELIMITER, $item->getTranslation()));
     }
     $context = $item->getContext();
-    $this->_items[$context != NULL ? $context : ''][$item->getSource()] = $item->getTranslation();
+    $this->items[$context != NULL ? $context : ''][$item->getSource()] = $item->getTranslation();
   }
 
   /**
@@ -49,7 +49,7 @@ public function writeItems(PoReaderInterface $reader, $count = -1) {
    * @return array PoItem
    */
   public function getData() {
-    return $this->_items;
+    return $this->items;
   }
 
   /**
diff --git a/core/lib/Drupal/Component/Gettext/PoStreamReader.php b/core/lib/Drupal/Component/Gettext/PoStreamReader.php
index 9548ea7..de386a6 100644
--- a/core/lib/Drupal/Component/Gettext/PoStreamReader.php
+++ b/core/lib/Drupal/Component/Gettext/PoStreamReader.php
@@ -17,7 +17,7 @@ class PoStreamReader implements PoStreamInterface, PoReaderInterface {
    *
    * @var int
    */
-  private $_line_number = 0;
+  protected $lineNumber = 0;
 
   /**
    * Parser context for the stream reader state machine.
@@ -32,90 +32,90 @@ class PoStreamReader implements PoStreamInterface, PoReaderInterface {
    *
    * @var string
    */
-  private $_context = 'COMMENT';
+  protected $context = 'COMMENT';
 
   /**
    * Current entry being read. Incomplete.
    *
    * @var array
    */
-  private $_current_item = [];
+  protected $currentItem = [];
 
   /**
    * Current plural index for plural translations.
    *
    * @var int
    */
-  private $_current_plural_index = 0;
+  protected $currentPluralIndex = 0;
 
   /**
    * URI of the PO stream that is being read.
    *
    * @var string
    */
-  private $_uri = '';
+  protected $uri = '';
 
   /**
    * Language code for the PO stream being read.
    *
    * @var string
    */
-  private $_langcode = NULL;
+  protected $langcode = NULL;
 
   /**
    * File handle of the current PO stream.
    *
    * @var resource
    */
-  private $_fd;
+  protected $fd;
 
   /**
    * The PO stream header.
    *
    * @var \Drupal\Component\Gettext\PoHeader
    */
-  private $_header;
+  protected $header;
 
   /**
    * Object wrapper for the last read source/translation pair.
    *
    * @var \Drupal\Component\Gettext\PoItem
    */
-  private $_last_item;
+  protected $lastItem;
 
   /**
    * Indicator of whether the stream reading is finished.
    *
    * @var bool
    */
-  private $_finished;
+  protected $finished;
 
   /**
    * Array of translated error strings recorded on reading this stream so far.
    *
    * @var array
    */
-  private $_errors;
+  protected $errors;
 
   /**
    * {@inheritdoc}
    */
   public function getLangcode() {
-    return $this->_langcode;
+    return $this->langcode;
   }
 
   /**
    * {@inheritdoc}
    */
   public function setLangcode($langcode) {
-    $this->_langcode = $langcode;
+    $this->langcode = $langcode;
   }
 
   /**
    * {@inheritdoc}
    */
   public function getHeader() {
-    return $this->_header;
+    return $this->header;
   }
 
   /**
@@ -130,14 +130,14 @@ public function setHeader(PoHeader $header) {
    * {@inheritdoc}
    */
   public function getURI() {
-    return $this->_uri;
+    return $this->uri;
   }
 
   /**
    * {@inheritdoc}
    */
   public function setURI($uri) {
-    $this->_uri = $uri;
+    $this->uri = $uri;
   }
 
   /**
@@ -150,8 +150,8 @@ public function setURI($uri) {
    *   If the URI is not yet set.
    */
   public function open() {
-    if (!empty($this->_uri)) {
-      $this->_fd = fopen($this->_uri, 'rb');
+    if (!empty($this->uri)) {
+      $this->fd = fopen($this->uri, 'rb');
       $this->readHeader();
     }
     else {
@@ -166,8 +166,8 @@ public function open() {
    *   If the stream is not open.
    */
   public function close() {
-    if ($this->_fd) {
-      fclose($this->_fd);
+    if ($this->fd) {
+      fclose($this->fd);
     }
     else {
       throw new \Exception('Cannot close stream that is not open.');
@@ -179,14 +179,14 @@ public function close() {
    */
   public function readItem() {
     // Clear out the last item.
-    $this->_last_item = NULL;
+    $this->lastItem = NULL;
 
     // Read until finished with the stream or a complete item was identified.
-    while (!$this->_finished && is_null($this->_last_item)) {
+    while (!$this->finished && is_null($this->lastItem)) {
       $this->readLine();
     }
 
-    return $this->_last_item;
+    return $this->lastItem;
   }
 
   /**
@@ -196,14 +196,14 @@ public function readItem() {
    *   The new seek position to set.
    */
   public function setSeek($seek) {
-    fseek($this->_fd, $seek);
+    fseek($this->fd, $seek);
   }
 
   /**
    * Gets the pointer position of the current PO stream.
    */
   public function getSeek() {
-    return ftell($this->_fd);
+    return ftell($this->fd);
   }
 
   /**
@@ -221,18 +221,18 @@ private function readHeader() {
     }
     $header = new PoHeader();
     $header->setFromString(trim($item->getTranslation()));
-    $this->_header = $header;
+    $this->header = $header;
   }
 
   /**
    * Reads a line from the PO stream and stores data internally.
    *
-   * Expands $this->_current_item based on new data for the current item. If
+   * Expands $this->current_item based on new data for the current item. If
    * this line ends the current item, it is saved with setItemFromArray() with
-   * data from $this->_current_item.
+   * data from $this->current_item.
    *
    * An internal state machine is maintained in this reader using
-   * $this->_context as the reading state. PO items are in between COMMENT
+   * $this->context as the reading state. PO items are in between COMMENT
    * states (when items have at least one line or comment in between them) or
    * indicated by MSGSTR or MSGSTR_ARR followed immediately by an MSGID or
    * MSGCTXT (when items closely follow each other).
@@ -245,25 +245,25 @@ private function readHeader() {
   private function readLine() {
     // Read a line and set the stream finished indicator if it was not
     // possible anymore.
-    $line = fgets($this->_fd);
-    $this->_finished = ($line === FALSE);
+    $line = fgets($this->fd);
+    $this->finished = ($line === FALSE);
 
-    if (!$this->_finished) {
+    if (!$this->finished) {
 
-      if ($this->_line_number == 0) {
+      if ($this->lineNumber == 0) {
         // The first line might come with a UTF-8 BOM, which should be removed.
         $line = str_replace("\xEF\xBB\xBF", '', $line);
         // Current plurality for 'msgstr[]'.
-        $this->_current_plural_index = 0;
+        $this->currentPluralIndex = 0;
       }
 
       // Track the line number for error reporting.
-      $this->_line_number++;
+      $this->lineNumber++;
 
       // Initialize common values for error logging.
       $log_vars = [
         '%uri' => $this->getURI(),
-        '%line' => $this->_line_number,
+        '%line' => $this->lineNumber,
       ];
 
       // Trim away the linefeed. \\n might appear at the end of the string if
@@ -273,24 +273,24 @@ private function readLine() {
       if (!strncmp('#', $line, 1)) {
         // Lines starting with '#' are comments.
 
-        if ($this->_context == 'COMMENT') {
+        if ($this->context == 'COMMENT') {
           // Already in comment context, add to current comment.
-          $this->_current_item['#'][] = substr($line, 1);
+          $this->currentItem['#'][] = substr($line, 1);
         }
-        elseif (($this->_context == 'MSGSTR') || ($this->_context == 'MSGSTR_ARR')) {
+        elseif (($this->context == 'MSGSTR') || ($this->context == 'MSGSTR_ARR')) {
           // We are currently in string context, save current item.
-          $this->setItemFromArray($this->_current_item);
+          $this->setItemFromArray($this->currentItem);
 
           // Start a new entry for the comment.
-          $this->_current_item = [];
-          $this->_current_item['#'][] = substr($line, 1);
+          $this->currentItem = [];
+          $this->currentItem['#'][] = substr($line, 1);
 
-          $this->_context = 'COMMENT';
+          $this->context = 'COMMENT';
           return;
         }
         else {
           // A comment following any other context is a syntax error.
-          $this->_errors[] = SafeMarkup::format('The translation stream %uri contains an error: "msgstr" was expected but not found on line %line.', $log_vars);
+          $this->errors[] = SafeMarkup::format('The translation stream %uri contains an error: "msgstr" was expected but not found on line %line.', $log_vars);
           return FALSE;
         }
         return;
@@ -298,9 +298,9 @@ private function readLine() {
       elseif (!strncmp('msgid_plural', $line, 12)) {
         // A plural form for the current source string.
 
-        if ($this->_context != 'MSGID') {
+        if ($this->context != 'MSGID') {
           // A plural form can only be added to an msgid directly.
-          $this->_errors[] = SafeMarkup::format('The translation stream %uri contains an error: "msgid_plural" was expected but not found on line %line.', $log_vars);
+          $this->errors[] = SafeMarkup::format('The translation stream %uri contains an error: "msgid_plural" was expected but not found on line %line.', $log_vars);
           return FALSE;
         }
 
@@ -311,34 +311,34 @@ private function readLine() {
         $quoted = $this->parseQuoted($line);
         if ($quoted === FALSE) {
           // The plural form must be wrapped in quotes.
-          $this->_errors[] = SafeMarkup::format('The translation stream %uri contains a syntax error on line %line.', $log_vars);
+          $this->errors[] = SafeMarkup::format('The translation stream %uri contains a syntax error on line %line.', $log_vars);
           return FALSE;
         }
 
         // Append the plural source to the current entry.
-        if (is_string($this->_current_item['msgid'])) {
+        if (is_string($this->currentItem['msgid'])) {
           // The first value was stored as string. Now we know the context is
           // plural, it is converted to array.
-          $this->_current_item['msgid'] = [$this->_current_item['msgid']];
+          $this->currentItem['msgid'] = [$this->currentItem['msgid']];
         }
-        $this->_current_item['msgid'][] = $quoted;
+        $this->currentItem['msgid'][] = $quoted;
 
-        $this->_context = 'MSGID_PLURAL';
+        $this->context = 'MSGID_PLURAL';
         return;
       }
       elseif (!strncmp('msgid', $line, 5)) {
         // Starting a new message.
 
-        if (($this->_context == 'MSGSTR') || ($this->_context == 'MSGSTR_ARR')) {
+        if (($this->context == 'MSGSTR') || ($this->context == 'MSGSTR_ARR')) {
           // We are currently in string context, save current item.
-          $this->setItemFromArray($this->_current_item);
+          $this->setItemFromArray($this->currentItem);
 
           // Start a new context for the msgid.
-          $this->_current_item = [];
+          $this->currentItem = [];
         }
-        elseif ($this->_context == 'MSGID') {
+        elseif ($this->context == 'MSGID') {
           // We are currently already in the context, meaning we passed an id with no data.
-          $this->_errors[] = SafeMarkup::format('The translation stream %uri contains an error: "msgid" is unexpected on line %line.', $log_vars);
+          $this->errors[] = SafeMarkup::format('The translation stream %uri contains an error: "msgid" is unexpected on line %line.', $log_vars);
           return FALSE;
         }
 
@@ -349,25 +349,25 @@ private function readLine() {
         $quoted = $this->parseQuoted($line);
         if ($quoted === FALSE) {
           // The message id must be wrapped in quotes.
-          $this->_errors[] = SafeMarkup::format('The translation stream %uri contains an error: invalid format for "msgid" on line %line.', $log_vars, $log_vars);
+          $this->errors[] = SafeMarkup::format('The translation stream %uri contains an error: invalid format for "msgid" on line %line.', $log_vars, $log_vars);
           return FALSE;
         }
 
-        $this->_current_item['msgid'] = $quoted;
-        $this->_context = 'MSGID';
+        $this->currentItem['msgid'] = $quoted;
+        $this->context = 'MSGID';
         return;
       }
       elseif (!strncmp('msgctxt', $line, 7)) {
         // Starting a new context.
 
-        if (($this->_context == 'MSGSTR') || ($this->_context == 'MSGSTR_ARR')) {
+        if (($this->context == 'MSGSTR') || ($this->context == 'MSGSTR_ARR')) {
           // We are currently in string context, save current item.
-          $this->setItemFromArray($this->_current_item);
-          $this->_current_item = [];
+          $this->setItemFromArray($this->currentItem);
+          $this->currentItem = [];
         }
-        elseif (!empty($this->_current_item['msgctxt'])) {
+        elseif (!empty($this->currentItem['msgctxt'])) {
           // A context cannot apply to another context.
-          $this->_errors[] = SafeMarkup::format('The translation stream %uri contains an error: "msgctxt" is unexpected on line %line.', $log_vars);
+          $this->errors[] = SafeMarkup::format('The translation stream %uri contains an error: "msgctxt" is unexpected on line %line.', $log_vars);
           return FALSE;
         }
 
@@ -378,37 +378,37 @@ private function readLine() {
         $quoted = $this->parseQuoted($line);
         if ($quoted === FALSE) {
           // The context string must be quoted.
-          $this->_errors[] = SafeMarkup::format('The translation stream %uri contains an error: invalid format for "msgctxt" on line %line.', $log_vars);
+          $this->errors[] = SafeMarkup::format('The translation stream %uri contains an error: invalid format for "msgctxt" on line %line.', $log_vars);
           return FALSE;
         }
 
-        $this->_current_item['msgctxt'] = $quoted;
+        $this->currentItem['msgctxt'] = $quoted;
 
-        $this->_context = 'MSGCTXT';
+        $this->context = 'MSGCTXT';
         return;
       }
       elseif (!strncmp('msgstr[', $line, 7)) {
         // A message string for a specific plurality.
 
-        if (($this->_context != 'MSGID') &&
-            ($this->_context != 'MSGCTXT') &&
-            ($this->_context != 'MSGID_PLURAL') &&
-            ($this->_context != 'MSGSTR_ARR')) {
+        if (($this->context != 'MSGID') &&
+            ($this->context != 'MSGCTXT') &&
+            ($this->context != 'MSGID_PLURAL') &&
+            ($this->context != 'MSGSTR_ARR')) {
           // Plural message strings must come after msgid, msgxtxt,
           // msgid_plural, or other msgstr[] entries.
-          $this->_errors[] = SafeMarkup::format('The translation stream %uri contains an error: "msgstr[]" is unexpected on line %line.', $log_vars);
+          $this->errors[] = SafeMarkup::format('The translation stream %uri contains an error: "msgstr[]" is unexpected on line %line.', $log_vars);
           return FALSE;
         }
 
         // Ensure the plurality is terminated.
         if (strpos($line, ']') === FALSE) {
-          $this->_errors[] = SafeMarkup::format('The translation stream %uri contains an error: invalid format for "msgstr[]" on line %line.', $log_vars);
+          $this->errors[] = SafeMarkup::format('The translation stream %uri contains an error: invalid format for "msgstr[]" on line %line.', $log_vars);
           return FALSE;
         }
 
         // Extract the plurality.
         $frombracket = strstr($line, '[');
-        $this->_current_plural_index = substr($frombracket, 1, strpos($frombracket, ']') - 1);
+        $this->currentPluralIndex = substr($frombracket, 1, strpos($frombracket, ']') - 1);
 
         // Skip to the next whitespace and trim away any further whitespace,
         // bringing $line to the message text only.
@@ -417,24 +417,24 @@ private function readLine() {
         $quoted = $this->parseQuoted($line);
         if ($quoted === FALSE) {
           // The string must be quoted.
-          $this->_errors[] = SafeMarkup::format('The translation stream %uri contains an error: invalid format for "msgstr[]" on line %line.', $log_vars);
+          $this->errors[] = SafeMarkup::format('The translation stream %uri contains an error: invalid format for "msgstr[]" on line %line.', $log_vars);
           return FALSE;
         }
-        if (!isset($this->_current_item['msgstr']) || !is_array($this->_current_item['msgstr'])) {
-          $this->_current_item['msgstr'] = [];
+        if (!isset($this->currentItem['msgstr']) || !is_array($this->currentItem['msgstr'])) {
+          $this->currentItem['msgstr'] = [];
         }
 
-        $this->_current_item['msgstr'][$this->_current_plural_index] = $quoted;
+        $this->currentItem['msgstr'][$this->currentPluralIndex] = $quoted;
 
-        $this->_context = 'MSGSTR_ARR';
+        $this->context = 'MSGSTR_ARR';
         return;
       }
       elseif (!strncmp("msgstr", $line, 6)) {
         // A string pair for an msgid (with optional context).
 
-        if (($this->_context != 'MSGID') && ($this->_context != 'MSGCTXT')) {
+        if (($this->context != 'MSGID') && ($this->context != 'MSGCTXT')) {
           // Strings are only valid within an id or context scope.
-          $this->_errors[] = SafeMarkup::format('The translation stream %uri contains an error: "msgstr" is unexpected on line %line.', $log_vars);
+          $this->errors[] = SafeMarkup::format('The translation stream %uri contains an error: "msgstr" is unexpected on line %line.', $log_vars);
           return FALSE;
         }
 
@@ -445,13 +445,13 @@ private function readLine() {
         $quoted = $this->parseQuoted($line);
         if ($quoted === FALSE) {
           // The string must be quoted.
-          $this->_errors[] = SafeMarkup::format('The translation stream %uri contains an error: invalid format for "msgstr" on line %line.', $log_vars);
+          $this->errors[] = SafeMarkup::format('The translation stream %uri contains an error: invalid format for "msgstr" on line %line.', $log_vars);
           return FALSE;
         }
 
-        $this->_current_item['msgstr'] = $quoted;
+        $this->currentItem['msgstr'] = $quoted;
 
-        $this->_context = 'MSGSTR';
+        $this->context = 'MSGSTR';
         return;
       }
       elseif ($line != '') {
@@ -460,37 +460,37 @@ private function readLine() {
         $quoted = $this->parseQuoted($line);
         if ($quoted === FALSE) {
           // This string must be quoted.
-          $this->_errors[] = SafeMarkup::format('The translation stream %uri contains an error: string continuation expected on line %line.', $log_vars);
+          $this->errors[] = SafeMarkup::format('The translation stream %uri contains an error: string continuation expected on line %line.', $log_vars);
           return FALSE;
         }
 
         // Append the string to the current item.
-        if (($this->_context == 'MSGID') || ($this->_context == 'MSGID_PLURAL')) {
-          if (is_array($this->_current_item['msgid'])) {
+        if (($this->context == 'MSGID') || ($this->context == 'MSGID_PLURAL')) {
+          if (is_array($this->currentItem['msgid'])) {
             // Add string to last array element for plural sources.
-            $last_index = count($this->_current_item['msgid']) - 1;
-            $this->_current_item['msgid'][$last_index] .= $quoted;
+            $last_index = count($this->currentItem['msgid']) - 1;
+            $this->currentItem['msgid'][$last_index] .= $quoted;
           }
           else {
             // Singular source, just append the string.
-            $this->_current_item['msgid'] .= $quoted;
+            $this->currentItem['msgid'] .= $quoted;
           }
         }
-        elseif ($this->_context == 'MSGCTXT') {
+        elseif ($this->context == 'MSGCTXT') {
           // Multiline context name.
-          $this->_current_item['msgctxt'] .= $quoted;
+          $this->currentItem['msgctxt'] .= $quoted;
         }
-        elseif ($this->_context == 'MSGSTR') {
+        elseif ($this->context == 'MSGSTR') {
           // Multiline translation string.
-          $this->_current_item['msgstr'] .= $quoted;
+          $this->currentItem['msgstr'] .= $quoted;
         }
-        elseif ($this->_context == 'MSGSTR_ARR') {
+        elseif ($this->context == 'MSGSTR_ARR') {
           // Multiline plural translation string.
-          $this->_current_item['msgstr'][$this->_current_plural_index] .= $quoted;
+          $this->currentItem['msgstr'][$this->currentPluralIndex] .= $quoted;
         }
         else {
           // No valid context to append to.
-          $this->_errors[] = SafeMarkup::format('The translation stream %uri contains an error: unexpected string on line %line.', $log_vars);
+          $this->errors[] = SafeMarkup::format('The translation stream %uri contains an error: unexpected string on line %line.', $log_vars);
           return FALSE;
         }
         return;
@@ -498,12 +498,12 @@ private function readLine() {
     }
 
     // Empty line read or EOF of PO stream, close out the last entry.
-    if (($this->_context == 'MSGSTR') || ($this->_context == 'MSGSTR_ARR')) {
-      $this->setItemFromArray($this->_current_item);
-      $this->_current_item = [];
+    if (($this->context == 'MSGSTR') || ($this->context == 'MSGSTR_ARR')) {
+      $this->setItemFromArray($this->currentItem);
+      $this->currentItem = [];
     }
-    elseif ($this->_context != 'COMMENT') {
-      $this->_errors[] = SafeMarkup::format('The translation stream %uri ended unexpectedly at line %line.', $log_vars);
+    elseif ($this->context != 'COMMENT') {
+      $this->errors[] = SafeMarkup::format('The translation stream %uri ended unexpectedly at line %line.', $log_vars);
       return FALSE;
     }
 
@@ -533,11 +533,11 @@ public function setItemFromArray($value) {
     $item->setTranslation($value['msgstr']);
     $item->setPlural($plural);
     $item->setComment($comments);
-    $item->setLangcode($this->_langcode);
+    $item->setLangcode($this->langcode);
 
-    $this->_last_item = $item;
+    $this->lastItem = $item;
 
-    $this->_context = 'COMMENT';
+    $this->context = 'COMMENT';
   }
 
   /**
diff --git a/core/lib/Drupal/Component/Gettext/PoStreamWriter.php b/core/lib/Drupal/Component/Gettext/PoStreamWriter.php
index 1e3f387..a441a3b 100644
--- a/core/lib/Drupal/Component/Gettext/PoStreamWriter.php
+++ b/core/lib/Drupal/Component/Gettext/PoStreamWriter.php
@@ -12,21 +12,28 @@ class PoStreamWriter implements PoWriterInterface, PoStreamInterface {
    *
    * @var string
    */
-  private $_uri;
+  protected $uri;
 
   /**
    * The Gettext PO header.
    *
    * @var \Drupal\Component\Gettext\PoHeader
    */
-  private $_header;
+  protected $header;
 
   /**
    * File handle of the current PO stream.
    *
    * @var resource
    */
-  private $_fd;
+  protected $fd;
+
+  /**
+   * The language code of this writer.
+   *
+   * @var string
+   */
+  protected $langcode;
 
   /**
    * Gets the PO header of the current stream.
@@ -35,7 +42,7 @@ class PoStreamWriter implements PoWriterInterface, PoStreamInterface {
    *   The Gettext PO header.
    */
   public function getHeader() {
-    return $this->_header;
+    return $this->header;
   }
 
   /**
@@ -45,7 +52,7 @@ public function getHeader() {
    *   The Gettext PO header to set.
    */
   public function setHeader(PoHeader $header) {
-    $this->_header = $header;
+    $this->header = $header;
   }
 
   /**
@@ -55,7 +62,7 @@ public function setHeader(PoHeader $header) {
    *   The language code.
    */
   public function getLangcode() {
-    return $this->_langcode;
+    return $this->langcode;
   }
 
   /**
@@ -65,7 +72,7 @@ public function getLangcode() {
    *   The language code.
    */
   public function setLangcode($langcode) {
-    $this->_langcode = $langcode;
+    $this->langcode = $langcode;
   }
 
   /**
@@ -73,7 +80,7 @@ public function setLangcode($langcode) {
    */
   public function open() {
     // Open in write mode. Will overwrite the stream if it already exists.
-    $this->_fd = fopen($this->getURI(), 'w');
+    $this->fd = fopen($this->getURI(), 'w');
     // Write the header at the start.
     $this->writeHeader();
   }
@@ -85,8 +92,8 @@ public function open() {
    *   If the stream is not open.
    */
   public function close() {
-    if ($this->_fd) {
-      fclose($this->_fd);
+    if ($this->fd) {
+      fclose($this->fd);
     }
     else {
       throw new \Exception('Cannot close stream that is not open.');
@@ -104,7 +111,7 @@ public function close() {
    *   If writing the data is not possible.
    */
   private function write($data) {
-    $result = fwrite($this->_fd, $data);
+    $result = fwrite($this->fd, $data);
     if ($result === FALSE || $result != strlen($data)) {
       throw new \Exception('Unable to write data: ' . substr($data, 0, 20));
     }
@@ -114,7 +121,7 @@ private function write($data) {
    * Write the PO header to the stream.
    */
   private function writeHeader() {
-    $this->write($this->_header);
+    $this->write($this->header);
   }
 
   /**
@@ -141,17 +148,17 @@ public function writeItems(PoReaderInterface $reader, $count = -1) {
    *   If the URI is not set.
    */
   public function getURI() {
-    if (empty($this->_uri)) {
+    if (empty($this->uri)) {
       throw new \Exception('No URI set.');
     }
-    return $this->_uri;
+    return $this->uri;
   }
 
   /**
    * {@inheritdoc}
    */
   public function setURI($uri) {
-    $this->_uri = $uri;
+    $this->uri = $uri;
   }
 
 }
