Mercurial > hg > isophonics-drupal-site
comparison vendor/symfony/translation/Reader/TranslationReader.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 |
---|---|
25 /** | 25 /** |
26 * Loaders used for import. | 26 * Loaders used for import. |
27 * | 27 * |
28 * @var array | 28 * @var array |
29 */ | 29 */ |
30 private $loaders = array(); | 30 private $loaders = []; |
31 | 31 |
32 /** | 32 /** |
33 * Adds a loader to the translation extractor. | 33 * Adds a loader to the translation extractor. |
34 * | 34 * |
35 * @param string $format The format of the loader | 35 * @param string $format The format of the loader |
53 // load any existing translation files | 53 // load any existing translation files |
54 $finder = new Finder(); | 54 $finder = new Finder(); |
55 $extension = $catalogue->getLocale().'.'.$format; | 55 $extension = $catalogue->getLocale().'.'.$format; |
56 $files = $finder->files()->name('*.'.$extension)->in($directory); | 56 $files = $finder->files()->name('*.'.$extension)->in($directory); |
57 foreach ($files as $file) { | 57 foreach ($files as $file) { |
58 $domain = substr($file->getFilename(), 0, -1 * strlen($extension) - 1); | 58 $domain = substr($file->getFilename(), 0, -1 * \strlen($extension) - 1); |
59 $catalogue->addCatalogue($loader->load($file->getPathname(), $catalogue->getLocale(), $domain)); | 59 $catalogue->addCatalogue($loader->load($file->getPathname(), $catalogue->getLocale(), $domain)); |
60 } | 60 } |
61 } | 61 } |
62 } | 62 } |
63 } | 63 } |