Mercurial > hg > cmmr2012-drupal-site
comparison 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 |
comparison
equal
deleted
inserted
replaced
4:a9cd425dd02b | 5:12f9dff5fda9 |
---|---|
9 * @see https://www.drupal.org/node/1637662 | 9 * @see https://www.drupal.org/node/1637662 |
10 */ | 10 */ |
11 class PoItem { | 11 class PoItem { |
12 | 12 |
13 /** | 13 /** |
14 * The delimiter used to split plural strings. | |
15 * | |
16 * This is the ETX (End of text) character and is used as a minimal means to | |
17 * separate singular and plural variants in source and translation text. It | |
18 * was found to be the most compatible delimiter for the supported databases. | |
19 */ | |
20 const DELIMITER = "\03"; | |
21 | |
22 /** | |
14 * The language code this translation is in. | 23 * The language code this translation is in. |
15 * | 24 * |
16 * @var string | 25 * @var string |
17 */ | 26 */ |
18 protected $langcode; | 27 protected $langcode; |
184 } | 193 } |
185 if (isset($values['comment'])) { | 194 if (isset($values['comment'])) { |
186 $this->setComment($values['comment']); | 195 $this->setComment($values['comment']); |
187 } | 196 } |
188 if (isset($this->source) && | 197 if (isset($this->source) && |
189 strpos($this->source, LOCALE_PLURAL_DELIMITER) !== FALSE) { | 198 strpos($this->source, self::DELIMITER) !== FALSE) { |
190 $this->setSource(explode(LOCALE_PLURAL_DELIMITER, $this->source)); | 199 $this->setSource(explode(self::DELIMITER, $this->source)); |
191 $this->setTranslation(explode(LOCALE_PLURAL_DELIMITER, $this->translation)); | 200 $this->setTranslation(explode(self::DELIMITER, $this->translation)); |
192 $this->setPlural(count($this->source) > 1); | 201 $this->setPlural(count($this->source) > 1); |
193 } | 202 } |
194 } | 203 } |
195 | 204 |
196 /** | 205 /** |