diff core/lib/Drupal/Component/Gettext/PoItem.php @ 5:12f9dff5fda9 tip

Update to Drupal core 8.7.1
author Chris Cannam
date Thu, 09 May 2019 15:34:47 +0100
parents a9cd425dd02b
children
line wrap: on
line diff
--- a/core/lib/Drupal/Component/Gettext/PoItem.php	Thu Feb 28 13:11:55 2019 +0000
+++ b/core/lib/Drupal/Component/Gettext/PoItem.php	Thu May 09 15:34:47 2019 +0100
@@ -11,6 +11,15 @@
 class PoItem {
 
   /**
+   * The delimiter used to split plural strings.
+   *
+   * This is the ETX (End of text) character and is used as a minimal means to
+   * separate singular and plural variants in source and translation text. It
+   * was found to be the most compatible delimiter for the supported databases.
+   */
+  const DELIMITER = "\03";
+
+  /**
    * The language code this translation is in.
    *
    * @var string
@@ -186,9 +195,9 @@
       $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));
+        strpos($this->source, self::DELIMITER) !== FALSE) {
+      $this->setSource(explode(self::DELIMITER, $this->source));
+      $this->setTranslation(explode(self::DELIMITER, $this->translation));
       $this->setPlural(count($this->source) > 1);
     }
   }