Mercurial > hg > isophonics-drupal-site
comparison vendor/symfony/translation/Loader/MoFileLoader.php @ 17:129ea1e6d783
Update, including to Drupal core 8.6.10
author | Chris Cannam |
---|---|
date | Thu, 28 Feb 2019 13:21:36 +0000 |
parents | 1fec387a4317 |
children |
comparison
equal
deleted
inserted
replaced
16:c2387f117808 | 17:129ea1e6d783 |
---|---|
69 // sizeHashes | 69 // sizeHashes |
70 $this->readLong($stream, $isBigEndian); | 70 $this->readLong($stream, $isBigEndian); |
71 // offsetHashes | 71 // offsetHashes |
72 $this->readLong($stream, $isBigEndian); | 72 $this->readLong($stream, $isBigEndian); |
73 | 73 |
74 $messages = array(); | 74 $messages = []; |
75 | 75 |
76 for ($i = 0; $i < $count; ++$i) { | 76 for ($i = 0; $i < $count; ++$i) { |
77 $pluralId = null; | 77 $pluralId = null; |
78 $translated = null; | 78 $translated = null; |
79 | 79 |
106 | 106 |
107 if (false !== strpos($translated, "\000")) { | 107 if (false !== strpos($translated, "\000")) { |
108 $translated = explode("\000", $translated); | 108 $translated = explode("\000", $translated); |
109 } | 109 } |
110 | 110 |
111 $ids = array('singular' => $singularId, 'plural' => $pluralId); | 111 $ids = ['singular' => $singularId, 'plural' => $pluralId]; |
112 $item = compact('ids', 'translated'); | 112 $item = compact('ids', 'translated'); |
113 | 113 |
114 if (is_array($item['translated'])) { | 114 if (\is_array($item['translated'])) { |
115 $messages[$item['ids']['singular']] = stripcslashes($item['translated'][0]); | 115 $messages[$item['ids']['singular']] = stripcslashes($item['translated'][0]); |
116 if (isset($item['ids']['plural'])) { | 116 if (isset($item['ids']['plural'])) { |
117 $plurals = array(); | 117 $plurals = []; |
118 foreach ($item['translated'] as $plural => $translated) { | 118 foreach ($item['translated'] as $plural => $translated) { |
119 $plurals[] = sprintf('{%d} %s', $plural, $translated); | 119 $plurals[] = sprintf('{%d} %s', $plural, $translated); |
120 } | 120 } |
121 $messages[$item['ids']['plural']] = stripcslashes(implode('|', $plurals)); | 121 $messages[$item['ids']['plural']] = stripcslashes(implode('|', $plurals)); |
122 } | 122 } |