summaryrefslogtreecommitdiffstats
path: root/Aufgabe06/vendor/symfony/translation/Symfony/Component/Translation/Extractor
diff options
context:
space:
mode:
Diffstat (limited to 'Aufgabe06/vendor/symfony/translation/Symfony/Component/Translation/Extractor')
-rw-r--r--Aufgabe06/vendor/symfony/translation/Symfony/Component/Translation/Extractor/ChainExtractor.php60
-rw-r--r--Aufgabe06/vendor/symfony/translation/Symfony/Component/Translation/Extractor/ExtractorInterface.php38
2 files changed, 98 insertions, 0 deletions
diff --git a/Aufgabe06/vendor/symfony/translation/Symfony/Component/Translation/Extractor/ChainExtractor.php b/Aufgabe06/vendor/symfony/translation/Symfony/Component/Translation/Extractor/ChainExtractor.php
new file mode 100644
index 0000000..50e3c84
--- /dev/null
+++ b/Aufgabe06/vendor/symfony/translation/Symfony/Component/Translation/Extractor/ChainExtractor.php
@@ -0,0 +1,60 @@
+<?php
+
+/*
+ * This file is part of the Symfony package.
+ *
+ * (c) Fabien Potencier <fabien@symfony.com>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\Translation\Extractor;
+
+use Symfony\Component\Translation\MessageCatalogue;
+
+/**
+ * ChainExtractor extracts translation messages from template files.
+ *
+ * @author Michel Salib <michelsalib@hotmail.com>
+ */
+class ChainExtractor implements ExtractorInterface
+{
+ /**
+ * The extractors.
+ *
+ * @var ExtractorInterface[]
+ */
+ private $extractors = array();
+
+ /**
+ * Adds a loader to the translation extractor.
+ *
+ * @param string $format The format of the loader
+ * @param ExtractorInterface $extractor The loader
+ */
+ public function addExtractor($format, ExtractorInterface $extractor)
+ {
+ $this->extractors[$format] = $extractor;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function setPrefix($prefix)
+ {
+ foreach ($this->extractors as $extractor) {
+ $extractor->setPrefix($prefix);
+ }
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function extract($directory, MessageCatalogue $catalogue)
+ {
+ foreach ($this->extractors as $extractor) {
+ $extractor->extract($directory, $catalogue);
+ }
+ }
+}
diff --git a/Aufgabe06/vendor/symfony/translation/Symfony/Component/Translation/Extractor/ExtractorInterface.php b/Aufgabe06/vendor/symfony/translation/Symfony/Component/Translation/Extractor/ExtractorInterface.php
new file mode 100644
index 0000000..6f877c3
--- /dev/null
+++ b/Aufgabe06/vendor/symfony/translation/Symfony/Component/Translation/Extractor/ExtractorInterface.php
@@ -0,0 +1,38 @@
+<?php
+
+/*
+ * This file is part of the Symfony package.
+ *
+ * (c) Fabien Potencier <fabien@symfony.com>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Symfony\Component\Translation\Extractor;
+
+use Symfony\Component\Translation\MessageCatalogue;
+
+/**
+ * Extracts translation messages from a template directory to the catalogue.
+ * New found messages are injected to the catalogue using the prefix.
+ *
+ * @author Michel Salib <michelsalib@hotmail.com>
+ */
+interface ExtractorInterface
+{
+ /**
+ * Extracts translation messages from a template directory to the catalogue.
+ *
+ * @param string $directory The path to look into
+ * @param MessageCatalogue $catalogue The catalogue
+ */
+ public function extract($directory, MessageCatalogue $catalogue);
+
+ /**
+ * Sets the prefix that should be used for new found messages.
+ *
+ * @param string $prefix The prefix
+ */
+ public function setPrefix($prefix);
+}