diff options
Diffstat (limited to 'vendor/symfony/translation/Symfony')
111 files changed, 0 insertions, 8600 deletions
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/.gitignore b/vendor/symfony/translation/Symfony/Component/Translation/.gitignore deleted file mode 100644 index 44de97a3..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/.gitignore +++ /dev/null | |||
@@ -1,4 +0,0 @@ | |||
1 | vendor/ | ||
2 | composer.lock | ||
3 | phpunit.xml | ||
4 | |||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/CHANGELOG.md b/vendor/symfony/translation/Symfony/Component/Translation/CHANGELOG.md deleted file mode 100644 index b8027ab1..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/CHANGELOG.md +++ /dev/null | |||
@@ -1,27 +0,0 @@ | |||
1 | CHANGELOG | ||
2 | ========= | ||
3 | |||
4 | 2.3.0 | ||
5 | ----- | ||
6 | |||
7 | * added classes to make operations on catalogues (like making a diff or a merge on 2 catalogues) | ||
8 | * added Translator::getFallbackLocales() | ||
9 | * deprecated Translator::setFallbackLocale() in favor of the new Translator::setFallbackLocales() method | ||
10 | |||
11 | 2.2.0 | ||
12 | ----- | ||
13 | |||
14 | * QtTranslationsLoader class renamed to QtFileLoader. QtTranslationsLoader is deprecated and will be removed in 2.3. | ||
15 | * [BC BREAK] uniformized the exception thrown by the load() method when an error occurs. The load() method now | ||
16 | throws Symfony\Component\Translation\Exception\NotFoundResourceException when a resource cannot be found | ||
17 | and Symfony\Component\Translation\Exception\InvalidResourceException when a resource is invalid. | ||
18 | * changed the exception class thrown by some load() methods from \RuntimeException to \InvalidArgumentException | ||
19 | (IcuDatFileLoader, IcuResFileLoader and QtFileLoader) | ||
20 | |||
21 | 2.1.0 | ||
22 | ----- | ||
23 | |||
24 | * added support for more than one fallback locale | ||
25 | * added support for extracting translation messages from templates (Twig and PHP) | ||
26 | * added dumpers for translation catalogs | ||
27 | * added support for QT, gettext, and ResourceBundles | ||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Catalogue/AbstractOperation.php b/vendor/symfony/translation/Symfony/Component/Translation/Catalogue/AbstractOperation.php deleted file mode 100644 index 062056b7..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/Catalogue/AbstractOperation.php +++ /dev/null | |||
@@ -1,146 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of the Symfony package. | ||
5 | * | ||
6 | * (c) Fabien Potencier <fabien@symfony.com> | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | namespace Symfony\Component\Translation\Catalogue; | ||
13 | |||
14 | use Symfony\Component\Translation\MessageCatalogue; | ||
15 | use Symfony\Component\Translation\MessageCatalogueInterface; | ||
16 | |||
17 | /** | ||
18 | * Base catalogues binary operation class. | ||
19 | * | ||
20 | * @author Jean-François Simon <contact@jfsimon.fr> | ||
21 | */ | ||
22 | abstract class AbstractOperation implements OperationInterface | ||
23 | { | ||
24 | /** | ||
25 | * @var MessageCatalogueInterface | ||
26 | */ | ||
27 | protected $source; | ||
28 | |||
29 | /** | ||
30 | * @var MessageCatalogueInterface | ||
31 | */ | ||
32 | protected $target; | ||
33 | |||
34 | /** | ||
35 | * @var MessageCatalogue | ||
36 | */ | ||
37 | protected $result; | ||
38 | |||
39 | /** | ||
40 | * @var null|array | ||
41 | */ | ||
42 | private $domains; | ||
43 | |||
44 | /** | ||
45 | * @var array | ||
46 | */ | ||
47 | protected $messages; | ||
48 | |||
49 | /** | ||
50 | * @param MessageCatalogueInterface $source | ||
51 | * @param MessageCatalogueInterface $target | ||
52 | * | ||
53 | * @throws \LogicException | ||
54 | */ | ||
55 | public function __construct(MessageCatalogueInterface $source, MessageCatalogueInterface $target) | ||
56 | { | ||
57 | if ($source->getLocale() !== $target->getLocale()) { | ||
58 | throw new \LogicException('Operated catalogues must belong to the same locale.'); | ||
59 | } | ||
60 | |||
61 | $this->source = $source; | ||
62 | $this->target = $target; | ||
63 | $this->result = new MessageCatalogue($source->getLocale()); | ||
64 | $this->domains = null; | ||
65 | $this->messages = array(); | ||
66 | } | ||
67 | |||
68 | /** | ||
69 | * {@inheritdoc} | ||
70 | */ | ||
71 | public function getDomains() | ||
72 | { | ||
73 | if (null === $this->domains) { | ||
74 | $this->domains = array_values(array_unique(array_merge($this->source->getDomains(), $this->target->getDomains()))); | ||
75 | } | ||
76 | |||
77 | return $this->domains; | ||
78 | } | ||
79 | |||
80 | /** | ||
81 | * {@inheritdoc} | ||
82 | */ | ||
83 | public function getMessages($domain) | ||
84 | { | ||
85 | if (!in_array($domain, $this->getDomains())) { | ||
86 | throw new \InvalidArgumentException(sprintf('Invalid domain: %s.', $domain)); | ||
87 | } | ||
88 | |||
89 | if (!isset($this->messages[$domain]['all'])) { | ||
90 | $this->processDomain($domain); | ||
91 | } | ||
92 | |||
93 | return $this->messages[$domain]['all']; | ||
94 | } | ||
95 | |||
96 | /** | ||
97 | * {@inheritdoc} | ||
98 | */ | ||
99 | public function getNewMessages($domain) | ||
100 | { | ||
101 | if (!in_array($domain, $this->getDomains())) { | ||
102 | throw new \InvalidArgumentException(sprintf('Invalid domain: %s.', $domain)); | ||
103 | } | ||
104 | |||
105 | if (!isset($this->messages[$domain]['new'])) { | ||
106 | $this->processDomain($domain); | ||
107 | } | ||
108 | |||
109 | return $this->messages[$domain]['new']; | ||
110 | } | ||
111 | |||
112 | /** | ||
113 | * {@inheritdoc} | ||
114 | */ | ||
115 | public function getObsoleteMessages($domain) | ||
116 | { | ||
117 | if (!in_array($domain, $this->getDomains())) { | ||
118 | throw new \InvalidArgumentException(sprintf('Invalid domain: %s.', $domain)); | ||
119 | } | ||
120 | |||
121 | if (!isset($this->messages[$domain]['obsolete'])) { | ||
122 | $this->processDomain($domain); | ||
123 | } | ||
124 | |||
125 | return $this->messages[$domain]['obsolete']; | ||
126 | } | ||
127 | |||
128 | /** | ||
129 | * {@inheritdoc} | ||
130 | */ | ||
131 | public function getResult() | ||
132 | { | ||
133 | foreach ($this->getDomains() as $domain) { | ||
134 | if (!isset($this->messages[$domain])) { | ||
135 | $this->processDomain($domain); | ||
136 | } | ||
137 | } | ||
138 | |||
139 | return $this->result; | ||
140 | } | ||
141 | |||
142 | /** | ||
143 | * @param string $domain | ||
144 | */ | ||
145 | abstract protected function processDomain($domain); | ||
146 | } | ||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Catalogue/DiffOperation.php b/vendor/symfony/translation/Symfony/Component/Translation/Catalogue/DiffOperation.php deleted file mode 100644 index 1672d121..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/Catalogue/DiffOperation.php +++ /dev/null | |||
@@ -1,49 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of the Symfony package. | ||
5 | * | ||
6 | * (c) Fabien Potencier <fabien@symfony.com> | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | namespace Symfony\Component\Translation\Catalogue; | ||
13 | |||
14 | /** | ||
15 | * Diff operation between two catalogues. | ||
16 | * | ||
17 | * @author Jean-François Simon <contact@jfsimon.fr> | ||
18 | */ | ||
19 | class DiffOperation extends AbstractOperation | ||
20 | { | ||
21 | /** | ||
22 | * {@inheritdoc} | ||
23 | */ | ||
24 | protected function processDomain($domain) | ||
25 | { | ||
26 | $this->messages[$domain] = array( | ||
27 | 'all' => array(), | ||
28 | 'new' => array(), | ||
29 | 'obsolete' => array(), | ||
30 | ); | ||
31 | |||
32 | foreach ($this->source->all($domain) as $id => $message) { | ||
33 | if ($this->target->has($id, $domain)) { | ||
34 | $this->messages[$domain]['all'][$id] = $message; | ||
35 | $this->result->add(array($id => $message), $domain); | ||
36 | } else { | ||
37 | $this->messages[$domain]['obsolete'][$id] = $message; | ||
38 | } | ||
39 | } | ||
40 | |||
41 | foreach ($this->target->all($domain) as $id => $message) { | ||
42 | if (!$this->source->has($id, $domain)) { | ||
43 | $this->messages[$domain]['all'][$id] = $message; | ||
44 | $this->messages[$domain]['new'][$id] = $message; | ||
45 | $this->result->add(array($id => $message), $domain); | ||
46 | } | ||
47 | } | ||
48 | } | ||
49 | } | ||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Catalogue/MergeOperation.php b/vendor/symfony/translation/Symfony/Component/Translation/Catalogue/MergeOperation.php deleted file mode 100644 index 0052363e..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/Catalogue/MergeOperation.php +++ /dev/null | |||
@@ -1,45 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of the Symfony package. | ||
5 | * | ||
6 | * (c) Fabien Potencier <fabien@symfony.com> | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | namespace Symfony\Component\Translation\Catalogue; | ||
13 | |||
14 | /** | ||
15 | * Merge operation between two catalogues. | ||
16 | * | ||
17 | * @author Jean-François Simon <contact@jfsimon.fr> | ||
18 | */ | ||
19 | class MergeOperation extends AbstractOperation | ||
20 | { | ||
21 | /** | ||
22 | * {@inheritdoc} | ||
23 | */ | ||
24 | protected function processDomain($domain) | ||
25 | { | ||
26 | $this->messages[$domain] = array( | ||
27 | 'all' => array(), | ||
28 | 'new' => array(), | ||
29 | 'obsolete' => array(), | ||
30 | ); | ||
31 | |||
32 | foreach ($this->source->all($domain) as $id => $message) { | ||
33 | $this->messages[$domain]['all'][$id] = $message; | ||
34 | $this->result->add(array($id => $message), $domain); | ||
35 | } | ||
36 | |||
37 | foreach ($this->target->all($domain) as $id => $message) { | ||
38 | if (!$this->source->has($id, $domain)) { | ||
39 | $this->messages[$domain]['all'][$id] = $message; | ||
40 | $this->messages[$domain]['new'][$id] = $message; | ||
41 | $this->result->add(array($id => $message), $domain); | ||
42 | } | ||
43 | } | ||
44 | } | ||
45 | } | ||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Catalogue/OperationInterface.php b/vendor/symfony/translation/Symfony/Component/Translation/Catalogue/OperationInterface.php deleted file mode 100644 index d72378a3..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/Catalogue/OperationInterface.php +++ /dev/null | |||
@@ -1,63 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of the Symfony package. | ||
5 | * | ||
6 | * (c) Fabien Potencier <fabien@symfony.com> | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | namespace Symfony\Component\Translation\Catalogue; | ||
13 | |||
14 | use Symfony\Component\Translation\MessageCatalogueInterface; | ||
15 | |||
16 | /** | ||
17 | * Represents an operation on catalogue(s). | ||
18 | * | ||
19 | * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com> | ||
20 | */ | ||
21 | interface OperationInterface | ||
22 | { | ||
23 | /** | ||
24 | * Returns domains affected by operation. | ||
25 | * | ||
26 | * @return array | ||
27 | */ | ||
28 | public function getDomains(); | ||
29 | |||
30 | /** | ||
31 | * Returns all valid messages after operation. | ||
32 | * | ||
33 | * @param string $domain | ||
34 | * | ||
35 | * @return array | ||
36 | */ | ||
37 | public function getMessages($domain); | ||
38 | |||
39 | /** | ||
40 | * Returns new messages after operation. | ||
41 | * | ||
42 | * @param string $domain | ||
43 | * | ||
44 | * @return array | ||
45 | */ | ||
46 | public function getNewMessages($domain); | ||
47 | |||
48 | /** | ||
49 | * Returns obsolete messages after operation. | ||
50 | * | ||
51 | * @param string $domain | ||
52 | * | ||
53 | * @return array | ||
54 | */ | ||
55 | public function getObsoleteMessages($domain); | ||
56 | |||
57 | /** | ||
58 | * Returns resulting catalogue. | ||
59 | * | ||
60 | * @return MessageCatalogueInterface | ||
61 | */ | ||
62 | public function getResult(); | ||
63 | } | ||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Dumper/CsvFileDumper.php b/vendor/symfony/translation/Symfony/Component/Translation/Dumper/CsvFileDumper.php deleted file mode 100644 index 0b411905..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/Dumper/CsvFileDumper.php +++ /dev/null | |||
@@ -1,63 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of the Symfony package. | ||
5 | * | ||
6 | * (c) Fabien Potencier <fabien@symfony.com> | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | namespace Symfony\Component\Translation\Dumper; | ||
13 | |||
14 | use Symfony\Component\Translation\MessageCatalogue; | ||
15 | |||
16 | /** | ||
17 | * CsvFileDumper generates a csv formatted string representation of a message catalogue. | ||
18 | * | ||
19 | * @author Stealth35 | ||
20 | */ | ||
21 | class CsvFileDumper extends FileDumper | ||
22 | { | ||
23 | private $delimiter = ';'; | ||
24 | private $enclosure = '"'; | ||
25 | |||
26 | /** | ||
27 | * {@inheritDoc} | ||
28 | */ | ||
29 | public function format(MessageCatalogue $messages, $domain = 'messages') | ||
30 | { | ||
31 | $handle = fopen('php://memory', 'rb+'); | ||
32 | |||
33 | foreach ($messages->all($domain) as $source => $target) { | ||
34 | fputcsv($handle, array($source, $target), $this->delimiter, $this->enclosure); | ||
35 | } | ||
36 | |||
37 | rewind($handle); | ||
38 | $output = stream_get_contents($handle); | ||
39 | fclose($handle); | ||
40 | |||
41 | return $output; | ||
42 | } | ||
43 | |||
44 | /** | ||
45 | * Sets the delimiter and escape character for CSV. | ||
46 | * | ||
47 | * @param string $delimiter delimiter character | ||
48 | * @param string $enclosure enclosure character | ||
49 | */ | ||
50 | public function setCsvControl($delimiter = ';', $enclosure = '"') | ||
51 | { | ||
52 | $this->delimiter = $delimiter; | ||
53 | $this->enclosure = $enclosure; | ||
54 | } | ||
55 | |||
56 | /** | ||
57 | * {@inheritDoc} | ||
58 | */ | ||
59 | protected function getExtension() | ||
60 | { | ||
61 | return 'csv'; | ||
62 | } | ||
63 | } | ||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Dumper/DumperInterface.php b/vendor/symfony/translation/Symfony/Component/Translation/Dumper/DumperInterface.php deleted file mode 100644 index cebc65ed..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/Dumper/DumperInterface.php +++ /dev/null | |||
@@ -1,31 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of the Symfony package. | ||
5 | * | ||
6 | * (c) Fabien Potencier <fabien@symfony.com> | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | namespace Symfony\Component\Translation\Dumper; | ||
13 | |||
14 | use Symfony\Component\Translation\MessageCatalogue; | ||
15 | |||
16 | /** | ||
17 | * DumperInterface is the interface implemented by all translation dumpers. | ||
18 | * There is no common option. | ||
19 | * | ||
20 | * @author Michel Salib <michelsalib@hotmail.com> | ||
21 | */ | ||
22 | interface DumperInterface | ||
23 | { | ||
24 | /** | ||
25 | * Dumps the message catalogue. | ||
26 | * | ||
27 | * @param MessageCatalogue $messages The message catalogue | ||
28 | * @param array $options Options that are used by the dumper | ||
29 | */ | ||
30 | public function dump(MessageCatalogue $messages, $options = array()); | ||
31 | } | ||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Dumper/FileDumper.php b/vendor/symfony/translation/Symfony/Component/Translation/Dumper/FileDumper.php deleted file mode 100644 index 63c1e6c3..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/Dumper/FileDumper.php +++ /dev/null | |||
@@ -1,65 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of the Symfony package. | ||
5 | * | ||
6 | * (c) Fabien Potencier <fabien@symfony.com> | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | namespace Symfony\Component\Translation\Dumper; | ||
13 | |||
14 | use Symfony\Component\Translation\MessageCatalogue; | ||
15 | |||
16 | /** | ||
17 | * FileDumper is an implementation of DumperInterface that dump a message catalogue to file(s). | ||
18 | * Performs backup of already existing files. | ||
19 | * | ||
20 | * Options: | ||
21 | * - path (mandatory): the directory where the files should be saved | ||
22 | * | ||
23 | * @author Michel Salib <michelsalib@hotmail.com> | ||
24 | */ | ||
25 | abstract class FileDumper implements DumperInterface | ||
26 | { | ||
27 | /** | ||
28 | * {@inheritDoc} | ||
29 | */ | ||
30 | public function dump(MessageCatalogue $messages, $options = array()) | ||
31 | { | ||
32 | if (!array_key_exists('path', $options)) { | ||
33 | throw new \InvalidArgumentException('The file dumper need a path options.'); | ||
34 | } | ||
35 | |||
36 | // save a file for each domain | ||
37 | foreach ($messages->getDomains() as $domain) { | ||
38 | $file = $domain.'.'.$messages->getLocale().'.'.$this->getExtension(); | ||
39 | // backup | ||
40 | $fullpath = $options['path'].'/'.$file; | ||
41 | if (file_exists($fullpath)) { | ||
42 | copy($fullpath, $fullpath.'~'); | ||
43 | } | ||
44 | // save file | ||
45 | file_put_contents($fullpath, $this->format($messages, $domain)); | ||
46 | } | ||
47 | } | ||
48 | |||
49 | /** | ||
50 | * Transforms a domain of a message catalogue to its string representation. | ||
51 | * | ||
52 | * @param MessageCatalogue $messages | ||
53 | * @param string $domain | ||
54 | * | ||
55 | * @return string representation | ||
56 | */ | ||
57 | abstract protected function format(MessageCatalogue $messages, $domain); | ||
58 | |||
59 | /** | ||
60 | * Gets the file extension of the dumper. | ||
61 | * | ||
62 | * @return string file extension | ||
63 | */ | ||
64 | abstract protected function getExtension(); | ||
65 | } | ||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Dumper/IcuResFileDumper.php b/vendor/symfony/translation/Symfony/Component/Translation/Dumper/IcuResFileDumper.php deleted file mode 100644 index 979153ac..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/Dumper/IcuResFileDumper.php +++ /dev/null | |||
@@ -1,135 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of the Symfony package. | ||
5 | * | ||
6 | * (c) Fabien Potencier <fabien@symfony.com> | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | namespace Symfony\Component\Translation\Dumper; | ||
13 | |||
14 | use Symfony\Component\Translation\MessageCatalogue; | ||
15 | |||
16 | /** | ||
17 | * IcuResDumper generates an ICU ResourceBundle formatted string representation of a message catalogue. | ||
18 | * | ||
19 | * @author Stealth35 | ||
20 | */ | ||
21 | class IcuResFileDumper implements DumperInterface | ||
22 | { | ||
23 | /** | ||
24 | * {@inheritDoc} | ||
25 | */ | ||
26 | public function dump(MessageCatalogue $messages, $options = array()) | ||
27 | { | ||
28 | if (!array_key_exists('path', $options)) { | ||
29 | throw new \InvalidArgumentException('The file dumper need a path options.'); | ||
30 | } | ||
31 | |||
32 | // save a file for each domain | ||
33 | foreach ($messages->getDomains() as $domain) { | ||
34 | $file = $messages->getLocale().'.'.$this->getExtension(); | ||
35 | $path = $options['path'].'/'.$domain.'/'; | ||
36 | |||
37 | if (!file_exists($path)) { | ||
38 | mkdir($path); | ||
39 | } | ||
40 | |||
41 | // backup | ||
42 | if (file_exists($path.$file)) { | ||
43 | copy($path.$file, $path.$file.'~'); | ||
44 | } | ||
45 | |||
46 | // save file | ||
47 | file_put_contents($path.$file, $this->format($messages, $domain)); | ||
48 | } | ||
49 | } | ||
50 | |||
51 | /** | ||
52 | * {@inheritDoc} | ||
53 | */ | ||
54 | public function format(MessageCatalogue $messages, $domain = 'messages') | ||
55 | { | ||
56 | $data = $indexes = $resources = ''; | ||
57 | |||
58 | foreach ($messages->all($domain) as $source => $target) { | ||
59 | $indexes .= pack('v', strlen($data) + 28); | ||
60 | $data .= $source."\0"; | ||
61 | } | ||
62 | |||
63 | $data .= $this->writePadding($data); | ||
64 | |||
65 | $keyTop = $this->getPosition($data); | ||
66 | |||
67 | foreach ($messages->all($domain) as $source => $target) { | ||
68 | $resources .= pack('V', $this->getPosition($data)); | ||
69 | |||
70 | $data .= pack('V', strlen($target)) | ||
71 | .mb_convert_encoding($target."\0", 'UTF-16LE', 'UTF-8') | ||
72 | .$this->writePadding($data) | ||
73 | ; | ||
74 | } | ||
75 | |||
76 | $resOffset = $this->getPosition($data); | ||
77 | |||
78 | $data .= pack('v', count($messages)) | ||
79 | .$indexes | ||
80 | .$this->writePadding($data) | ||
81 | .$resources | ||
82 | ; | ||
83 | |||
84 | $bundleTop = $this->getPosition($data); | ||
85 | |||
86 | $root = pack('V7', | ||
87 | $resOffset + (2 << 28), // Resource Offset + Resource Type | ||
88 | 6, // Index length | ||
89 | $keyTop, // Index keys top | ||
90 | $bundleTop, // Index resources top | ||
91 | $bundleTop, // Index bundle top | ||
92 | count($messages), // Index max table length | ||
93 | 0 // Index attributes | ||
94 | ); | ||
95 | |||
96 | $header = pack('vC2v4C12@32', | ||
97 | 32, // Header size | ||
98 | 0xDA, 0x27, // Magic number 1 and 2 | ||
99 | 20, 0, 0, 2, // Rest of the header, ..., Size of a char | ||
100 | 0x52, 0x65, 0x73, 0x42, // Data format identifier | ||
101 | 1, 2, 0, 0, // Data version | ||
102 | 1, 4, 0, 0 // Unicode version | ||
103 | ); | ||
104 | |||
105 | $output = $header | ||
106 | .$root | ||
107 | .$data; | ||
108 | |||
109 | return $output; | ||
110 | } | ||
111 | |||
112 | private function writePadding($data) | ||
113 | { | ||
114 | $padding = strlen($data) % 4; | ||
115 | |||
116 | if ($padding) { | ||
117 | return str_repeat("\xAA", 4 - $padding); | ||
118 | } | ||
119 | } | ||
120 | |||
121 | private function getPosition($data) | ||
122 | { | ||
123 | $position = (strlen($data) + 28) / 4; | ||
124 | |||
125 | return $position; | ||
126 | } | ||
127 | |||
128 | /** | ||
129 | * {@inheritDoc} | ||
130 | */ | ||
131 | protected function getExtension() | ||
132 | { | ||
133 | return 'res'; | ||
134 | } | ||
135 | } | ||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Dumper/IniFileDumper.php b/vendor/symfony/translation/Symfony/Component/Translation/Dumper/IniFileDumper.php deleted file mode 100644 index 173cf8c1..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/Dumper/IniFileDumper.php +++ /dev/null | |||
@@ -1,45 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of the Symfony package. | ||
5 | * | ||
6 | * (c) Fabien Potencier <fabien@symfony.com> | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | namespace Symfony\Component\Translation\Dumper; | ||
13 | |||
14 | use Symfony\Component\Translation\MessageCatalogue; | ||
15 | |||
16 | /** | ||
17 | * IniFileDumper generates an ini formatted string representation of a message catalogue. | ||
18 | * | ||
19 | * @author Stealth35 | ||
20 | */ | ||
21 | class IniFileDumper extends FileDumper | ||
22 | { | ||
23 | /** | ||
24 | * {@inheritDoc} | ||
25 | */ | ||
26 | public function format(MessageCatalogue $messages, $domain = 'messages') | ||
27 | { | ||
28 | $output = ''; | ||
29 | |||
30 | foreach ($messages->all($domain) as $source => $target) { | ||
31 | $escapeTarget = str_replace('"', '\"', $target); | ||
32 | $output .= $source.'="'.$escapeTarget."\"\n"; | ||
33 | } | ||
34 | |||
35 | return $output; | ||
36 | } | ||
37 | |||
38 | /** | ||
39 | * {@inheritDoc} | ||
40 | */ | ||
41 | protected function getExtension() | ||
42 | { | ||
43 | return 'ini'; | ||
44 | } | ||
45 | } | ||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Dumper/MoFileDumper.php b/vendor/symfony/translation/Symfony/Component/Translation/Dumper/MoFileDumper.php deleted file mode 100644 index a3a2a649..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/Dumper/MoFileDumper.php +++ /dev/null | |||
@@ -1,82 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of the Symfony package. | ||
5 | * | ||
6 | * (c) Fabien Potencier <fabien@symfony.com> | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | namespace Symfony\Component\Translation\Dumper; | ||
13 | |||
14 | use Symfony\Component\Translation\MessageCatalogue; | ||
15 | use Symfony\Component\Translation\Loader\MoFileLoader; | ||
16 | |||
17 | /** | ||
18 | * MoFileDumper generates a gettext formatted string representation of a message catalogue. | ||
19 | * | ||
20 | * @author Stealth35 | ||
21 | */ | ||
22 | class MoFileDumper extends FileDumper | ||
23 | { | ||
24 | /** | ||
25 | * {@inheritDoc} | ||
26 | */ | ||
27 | public function format(MessageCatalogue $messages, $domain = 'messages') | ||
28 | { | ||
29 | $output = $sources = $targets = $sourceOffsets = $targetOffsets = ''; | ||
30 | $offsets = array(); | ||
31 | $size = 0; | ||
32 | |||
33 | foreach ($messages->all($domain) as $source => $target) { | ||
34 | $offsets[] = array_map('strlen', array($sources, $source, $targets, $target)); | ||
35 | $sources .= "\0".$source; | ||
36 | $targets .= "\0".$target; | ||
37 | ++$size; | ||
38 | } | ||
39 | |||
40 | $header = array( | ||
41 | 'magicNumber' => MoFileLoader::MO_LITTLE_ENDIAN_MAGIC, | ||
42 | 'formatRevision' => 0, | ||
43 | 'count' => $size, | ||
44 | 'offsetId' => MoFileLoader::MO_HEADER_SIZE, | ||
45 | 'offsetTranslated' => MoFileLoader::MO_HEADER_SIZE + (8 * $size), | ||
46 | 'sizeHashes' => 0, | ||
47 | 'offsetHashes' => MoFileLoader::MO_HEADER_SIZE + (16 * $size), | ||
48 | ); | ||
49 | |||
50 | $sourcesSize = strlen($sources); | ||
51 | $sourcesStart = $header['offsetHashes'] + 1; | ||
52 | |||
53 | foreach ($offsets as $offset) { | ||
54 | $sourceOffsets .= $this->writeLong($offset[1]) | ||
55 | .$this->writeLong($offset[0] + $sourcesStart); | ||
56 | $targetOffsets .= $this->writeLong($offset[3]) | ||
57 | .$this->writeLong($offset[2] + $sourcesStart + $sourcesSize); | ||
58 | } | ||
59 | |||
60 | $output = implode(array_map(array($this, 'writeLong'), $header)) | ||
61 | .$sourceOffsets | ||
62 | .$targetOffsets | ||
63 | .$sources | ||
64 | .$targets | ||
65 | ; | ||
66 | |||
67 | return $output; | ||
68 | } | ||
69 | |||
70 | /** | ||
71 | * {@inheritDoc} | ||
72 | */ | ||
73 | protected function getExtension() | ||
74 | { | ||
75 | return 'mo'; | ||
76 | } | ||
77 | |||
78 | private function writeLong($str) | ||
79 | { | ||
80 | return pack('V*', $str); | ||
81 | } | ||
82 | } | ||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Dumper/PhpFileDumper.php b/vendor/symfony/translation/Symfony/Component/Translation/Dumper/PhpFileDumper.php deleted file mode 100644 index 8de4a5b4..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/Dumper/PhpFileDumper.php +++ /dev/null | |||
@@ -1,40 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of the Symfony package. | ||
5 | * | ||
6 | * (c) Fabien Potencier <fabien@symfony.com> | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | namespace Symfony\Component\Translation\Dumper; | ||
13 | |||
14 | use Symfony\Component\Translation\MessageCatalogue; | ||
15 | |||
16 | /** | ||
17 | * PhpFileDumper generates php files from a message catalogue. | ||
18 | * | ||
19 | * @author Michel Salib <michelsalib@hotmail.com> | ||
20 | */ | ||
21 | class PhpFileDumper extends FileDumper | ||
22 | { | ||
23 | /** | ||
24 | * {@inheritDoc} | ||
25 | */ | ||
26 | protected function format(MessageCatalogue $messages, $domain) | ||
27 | { | ||
28 | $output = "<?php\n\nreturn ".var_export($messages->all($domain), true).";\n"; | ||
29 | |||
30 | return $output; | ||
31 | } | ||
32 | |||
33 | /** | ||
34 | * {@inheritDoc} | ||
35 | */ | ||
36 | protected function getExtension() | ||
37 | { | ||
38 | return 'php'; | ||
39 | } | ||
40 | } | ||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Dumper/PoFileDumper.php b/vendor/symfony/translation/Symfony/Component/Translation/Dumper/PoFileDumper.php deleted file mode 100644 index d957ab91..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/Dumper/PoFileDumper.php +++ /dev/null | |||
@@ -1,55 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of the Symfony package. | ||
5 | * | ||
6 | * (c) Fabien Potencier <fabien@symfony.com> | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | namespace Symfony\Component\Translation\Dumper; | ||
13 | |||
14 | use Symfony\Component\Translation\MessageCatalogue; | ||
15 | |||
16 | /** | ||
17 | * PoFileDumper generates a gettext formatted string representation of a message catalogue. | ||
18 | * | ||
19 | * @author Stealth35 | ||
20 | */ | ||
21 | class PoFileDumper extends FileDumper | ||
22 | { | ||
23 | /** | ||
24 | * {@inheritDoc} | ||
25 | */ | ||
26 | public function format(MessageCatalogue $messages, $domain = 'messages') | ||
27 | { | ||
28 | $output = ''; | ||
29 | $newLine = false; | ||
30 | foreach ($messages->all($domain) as $source => $target) { | ||
31 | if ($newLine) { | ||
32 | $output .= "\n"; | ||
33 | } else { | ||
34 | $newLine = true; | ||
35 | } | ||
36 | $output .= sprintf('msgid "%s"'."\n", $this->escape($source)); | ||
37 | $output .= sprintf('msgstr "%s"', $this->escape($target)); | ||
38 | } | ||
39 | |||
40 | return $output; | ||
41 | } | ||
42 | |||
43 | /** | ||
44 | * {@inheritDoc} | ||
45 | */ | ||
46 | protected function getExtension() | ||
47 | { | ||
48 | return 'po'; | ||
49 | } | ||
50 | |||
51 | private function escape($str) | ||
52 | { | ||
53 | return addcslashes($str, "\0..\37\42\134"); | ||
54 | } | ||
55 | } | ||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Dumper/QtFileDumper.php b/vendor/symfony/translation/Symfony/Component/Translation/Dumper/QtFileDumper.php deleted file mode 100644 index a1a84805..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/Dumper/QtFileDumper.php +++ /dev/null | |||
@@ -1,50 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of the Symfony package. | ||
5 | * | ||
6 | * (c) Fabien Potencier <fabien@symfony.com> | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | namespace Symfony\Component\Translation\Dumper; | ||
13 | |||
14 | use Symfony\Component\Translation\MessageCatalogue; | ||
15 | |||
16 | /** | ||
17 | * QtFileDumper generates ts files from a message catalogue. | ||
18 | * | ||
19 | * @author Benjamin Eberlei <kontakt@beberlei.de> | ||
20 | */ | ||
21 | class QtFileDumper extends FileDumper | ||
22 | { | ||
23 | /** | ||
24 | * {@inheritDoc} | ||
25 | */ | ||
26 | public function format(MessageCatalogue $messages, $domain) | ||
27 | { | ||
28 | $dom = new \DOMDocument('1.0', 'utf-8'); | ||
29 | $dom->formatOutput = true; | ||
30 | $ts = $dom->appendChild($dom->createElement('TS')); | ||
31 | $context = $ts->appendChild($dom->createElement('context')); | ||
32 | $context->appendChild($dom->createElement('name', $domain)); | ||
33 | |||
34 | foreach ($messages->all($domain) as $source => $target) { | ||
35 | $message = $context->appendChild($dom->createElement('message')); | ||
36 | $message->appendChild($dom->createElement('source', $source)); | ||
37 | $message->appendChild($dom->createElement('translation', $target)); | ||
38 | } | ||
39 | |||
40 | return $dom->saveXML(); | ||
41 | } | ||
42 | |||
43 | /** | ||
44 | * {@inheritDoc} | ||
45 | */ | ||
46 | protected function getExtension() | ||
47 | { | ||
48 | return 'ts'; | ||
49 | } | ||
50 | } | ||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Dumper/XliffFileDumper.php b/vendor/symfony/translation/Symfony/Component/Translation/Dumper/XliffFileDumper.php deleted file mode 100644 index 0d258aad..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/Dumper/XliffFileDumper.php +++ /dev/null | |||
@@ -1,66 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of the Symfony package. | ||
5 | * | ||
6 | * (c) Fabien Potencier <fabien@symfony.com> | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | namespace Symfony\Component\Translation\Dumper; | ||
13 | |||
14 | use Symfony\Component\Translation\MessageCatalogue; | ||
15 | |||
16 | /** | ||
17 | * XliffFileDumper generates xliff files from a message catalogue. | ||
18 | * | ||
19 | * @author Michel Salib <michelsalib@hotmail.com> | ||
20 | */ | ||
21 | class XliffFileDumper extends FileDumper | ||
22 | { | ||
23 | /** | ||
24 | * {@inheritDoc} | ||
25 | */ | ||
26 | protected function format(MessageCatalogue $messages, $domain) | ||
27 | { | ||
28 | $dom = new \DOMDocument('1.0', 'utf-8'); | ||
29 | $dom->formatOutput = true; | ||
30 | |||
31 | $xliff = $dom->appendChild($dom->createElement('xliff')); | ||
32 | $xliff->setAttribute('version', '1.2'); | ||
33 | $xliff->setAttribute('xmlns', 'urn:oasis:names:tc:xliff:document:1.2'); | ||
34 | |||
35 | $xliffFile = $xliff->appendChild($dom->createElement('file')); | ||
36 | $xliffFile->setAttribute('source-language', $messages->getLocale()); | ||
37 | $xliffFile->setAttribute('datatype', 'plaintext'); | ||
38 | $xliffFile->setAttribute('original', 'file.ext'); | ||
39 | |||
40 | $xliffBody = $xliffFile->appendChild($dom->createElement('body')); | ||
41 | foreach ($messages->all($domain) as $source => $target) { | ||
42 | $translation = $dom->createElement('trans-unit'); | ||
43 | |||
44 | $translation->setAttribute('id', md5($source)); | ||
45 | $translation->setAttribute('resname', $source); | ||
46 | |||
47 | $s = $translation->appendChild($dom->createElement('source')); | ||
48 | $s->appendChild($dom->createTextNode($source)); | ||
49 | |||
50 | $t = $translation->appendChild($dom->createElement('target')); | ||
51 | $t->appendChild($dom->createTextNode($target)); | ||
52 | |||
53 | $xliffBody->appendChild($translation); | ||
54 | } | ||
55 | |||
56 | return $dom->saveXML(); | ||
57 | } | ||
58 | |||
59 | /** | ||
60 | * {@inheritDoc} | ||
61 | */ | ||
62 | protected function getExtension() | ||
63 | { | ||
64 | return 'xlf'; | ||
65 | } | ||
66 | } | ||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Dumper/YamlFileDumper.php b/vendor/symfony/translation/Symfony/Component/Translation/Dumper/YamlFileDumper.php deleted file mode 100644 index d8072fb7..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/Dumper/YamlFileDumper.php +++ /dev/null | |||
@@ -1,39 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of the Symfony package. | ||
5 | * | ||
6 | * (c) Fabien Potencier <fabien@symfony.com> | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | namespace Symfony\Component\Translation\Dumper; | ||
13 | |||
14 | use Symfony\Component\Translation\MessageCatalogue; | ||
15 | use Symfony\Component\Yaml\Yaml; | ||
16 | |||
17 | /** | ||
18 | * YamlFileDumper generates yaml files from a message catalogue. | ||
19 | * | ||
20 | * @author Michel Salib <michelsalib@hotmail.com> | ||
21 | */ | ||
22 | class YamlFileDumper extends FileDumper | ||
23 | { | ||
24 | /** | ||
25 | * {@inheritDoc} | ||
26 | */ | ||
27 | protected function format(MessageCatalogue $messages, $domain) | ||
28 | { | ||
29 | return Yaml::dump($messages->all($domain)); | ||
30 | } | ||
31 | |||
32 | /** | ||
33 | * {@inheritDoc} | ||
34 | */ | ||
35 | protected function getExtension() | ||
36 | { | ||
37 | return 'yml'; | ||
38 | } | ||
39 | } | ||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Exception/ExceptionInterface.php b/vendor/symfony/translation/Symfony/Component/Translation/Exception/ExceptionInterface.php deleted file mode 100644 index 7757e669..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/Exception/ExceptionInterface.php +++ /dev/null | |||
@@ -1,23 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of the Symfony package. | ||
5 | * | ||
6 | * (c) Fabien Potencier <fabien@symfony.com> | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | namespace Symfony\Component\Translation\Exception; | ||
13 | |||
14 | /** | ||
15 | * Exception interface for all exceptions thrown by the component. | ||
16 | * | ||
17 | * @author Fabien Potencier <fabien@symfony.com> | ||
18 | * | ||
19 | * @api | ||
20 | */ | ||
21 | interface ExceptionInterface | ||
22 | { | ||
23 | } | ||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Exception/InvalidResourceException.php b/vendor/symfony/translation/Symfony/Component/Translation/Exception/InvalidResourceException.php deleted file mode 100644 index 6413f1ae..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/Exception/InvalidResourceException.php +++ /dev/null | |||
@@ -1,23 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of the Symfony package. | ||
5 | * | ||
6 | * (c) Fabien Potencier <fabien@symfony.com> | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | namespace Symfony\Component\Translation\Exception; | ||
13 | |||
14 | /** | ||
15 | * Thrown when a resource cannot be loaded. | ||
16 | * | ||
17 | * @author Fabien Potencier <fabien@symfony.com> | ||
18 | * | ||
19 | * @api | ||
20 | */ | ||
21 | class InvalidResourceException extends \InvalidArgumentException implements ExceptionInterface | ||
22 | { | ||
23 | } | ||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Exception/NotFoundResourceException.php b/vendor/symfony/translation/Symfony/Component/Translation/Exception/NotFoundResourceException.php deleted file mode 100644 index 7826e5ce..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/Exception/NotFoundResourceException.php +++ /dev/null | |||
@@ -1,23 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of the Symfony package. | ||
5 | * | ||
6 | * (c) Fabien Potencier <fabien@symfony.com> | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | namespace Symfony\Component\Translation\Exception; | ||
13 | |||
14 | /** | ||
15 | * Thrown when a resource does not exist. | ||
16 | * | ||
17 | * @author Fabien Potencier <fabien@symfony.com> | ||
18 | * | ||
19 | * @api | ||
20 | */ | ||
21 | class NotFoundResourceException extends \InvalidArgumentException implements ExceptionInterface | ||
22 | { | ||
23 | } | ||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Extractor/ChainExtractor.php b/vendor/symfony/translation/Symfony/Component/Translation/Extractor/ChainExtractor.php deleted file mode 100644 index 0d07a93f..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/Extractor/ChainExtractor.php +++ /dev/null | |||
@@ -1,60 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of the Symfony package. | ||
5 | * | ||
6 | * (c) Fabien Potencier <fabien@symfony.com> | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | namespace Symfony\Component\Translation\Extractor; | ||
13 | |||
14 | use Symfony\Component\Translation\MessageCatalogue; | ||
15 | |||
16 | /** | ||
17 | * ChainExtractor extracts translation messages from template files. | ||
18 | * | ||
19 | * @author Michel Salib <michelsalib@hotmail.com> | ||
20 | */ | ||
21 | class ChainExtractor implements ExtractorInterface | ||
22 | { | ||
23 | /** | ||
24 | * The extractors. | ||
25 | * | ||
26 | * @var ExtractorInterface[] | ||
27 | */ | ||
28 | private $extractors = array(); | ||
29 | |||
30 | /** | ||
31 | * Adds a loader to the translation extractor. | ||
32 | * | ||
33 | * @param string $format The format of the loader | ||
34 | * @param ExtractorInterface $extractor The loader | ||
35 | */ | ||
36 | public function addExtractor($format, ExtractorInterface $extractor) | ||
37 | { | ||
38 | $this->extractors[$format] = $extractor; | ||
39 | } | ||
40 | |||
41 | /** | ||
42 | * {@inheritDoc} | ||
43 | */ | ||
44 | public function setPrefix($prefix) | ||
45 | { | ||
46 | foreach ($this->extractors as $extractor) { | ||
47 | $extractor->setPrefix($prefix); | ||
48 | } | ||
49 | } | ||
50 | |||
51 | /** | ||
52 | * {@inheritDoc} | ||
53 | */ | ||
54 | public function extract($directory, MessageCatalogue $catalogue) | ||
55 | { | ||
56 | foreach ($this->extractors as $extractor) { | ||
57 | $extractor->extract($directory, $catalogue); | ||
58 | } | ||
59 | } | ||
60 | } | ||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Extractor/ExtractorInterface.php b/vendor/symfony/translation/Symfony/Component/Translation/Extractor/ExtractorInterface.php deleted file mode 100644 index 6f877c31..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/Extractor/ExtractorInterface.php +++ /dev/null | |||
@@ -1,38 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of the Symfony package. | ||
5 | * | ||
6 | * (c) Fabien Potencier <fabien@symfony.com> | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | namespace Symfony\Component\Translation\Extractor; | ||
13 | |||
14 | use Symfony\Component\Translation\MessageCatalogue; | ||
15 | |||
16 | /** | ||
17 | * Extracts translation messages from a template directory to the catalogue. | ||
18 | * New found messages are injected to the catalogue using the prefix. | ||
19 | * | ||
20 | * @author Michel Salib <michelsalib@hotmail.com> | ||
21 | */ | ||
22 | interface ExtractorInterface | ||
23 | { | ||
24 | /** | ||
25 | * Extracts translation messages from a template directory to the catalogue. | ||
26 | * | ||
27 | * @param string $directory The path to look into | ||
28 | * @param MessageCatalogue $catalogue The catalogue | ||
29 | */ | ||
30 | public function extract($directory, MessageCatalogue $catalogue); | ||
31 | |||
32 | /** | ||
33 | * Sets the prefix that should be used for new found messages. | ||
34 | * | ||
35 | * @param string $prefix The prefix | ||
36 | */ | ||
37 | public function setPrefix($prefix); | ||
38 | } | ||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/IdentityTranslator.php b/vendor/symfony/translation/Symfony/Component/Translation/IdentityTranslator.php deleted file mode 100644 index f30556b5..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/IdentityTranslator.php +++ /dev/null | |||
@@ -1,74 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of the Symfony package. | ||
5 | * | ||
6 | * (c) Fabien Potencier <fabien@symfony.com> | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | namespace Symfony\Component\Translation; | ||
13 | |||
14 | /** | ||
15 | * IdentityTranslator does not translate anything. | ||
16 | * | ||
17 | * @author Fabien Potencier <fabien@symfony.com> | ||
18 | * | ||
19 | * @api | ||
20 | */ | ||
21 | class IdentityTranslator implements TranslatorInterface | ||
22 | { | ||
23 | private $selector; | ||
24 | |||
25 | /** | ||
26 | * Constructor. | ||
27 | * | ||
28 | * @param MessageSelector $selector The message selector for pluralization | ||
29 | * | ||
30 | * @api | ||
31 | */ | ||
32 | public function __construct(MessageSelector $selector) | ||
33 | { | ||
34 | $this->selector = $selector; | ||
35 | } | ||
36 | |||
37 | /** | ||
38 | * {@inheritdoc} | ||
39 | * | ||
40 | * @api | ||
41 | */ | ||
42 | public function setLocale($locale) | ||
43 | { | ||
44 | } | ||
45 | |||
46 | /** | ||
47 | * {@inheritdoc} | ||
48 | * | ||
49 | * @api | ||
50 | */ | ||
51 | public function getLocale() | ||
52 | { | ||
53 | } | ||
54 | |||
55 | /** | ||
56 | * {@inheritdoc} | ||
57 | * | ||
58 | * @api | ||
59 | */ | ||
60 | public function trans($id, array $parameters = array(), $domain = 'messages', $locale = null) | ||
61 | { | ||
62 | return strtr((string) $id, $parameters); | ||
63 | } | ||
64 | |||
65 | /** | ||
66 | * {@inheritdoc} | ||
67 | * | ||
68 | * @api | ||
69 | */ | ||
70 | public function transChoice($id, $number, array $parameters = array(), $domain = 'messages', $locale = null) | ||
71 | { | ||
72 | return strtr($this->selector->choose((string) $id, (int) $number, $locale), $parameters); | ||
73 | } | ||
74 | } | ||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Interval.php b/vendor/symfony/translation/Symfony/Component/Translation/Interval.php deleted file mode 100644 index 033b0188..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/Interval.php +++ /dev/null | |||
@@ -1,107 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of the Symfony package. | ||
5 | * | ||
6 | * (c) Fabien Potencier <fabien@symfony.com> | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | namespace Symfony\Component\Translation; | ||
13 | |||
14 | /** | ||
15 | * Tests if a given number belongs to a given math interval. | ||
16 | * | ||
17 | * An interval can represent a finite set of numbers: | ||
18 | * | ||
19 | * {1,2,3,4} | ||
20 | * | ||
21 | * An interval can represent numbers between two numbers: | ||
22 | * | ||
23 | * [1, +Inf] | ||
24 | * ]-1,2[ | ||
25 | * | ||
26 | * The left delimiter can be [ (inclusive) or ] (exclusive). | ||
27 | * The right delimiter can be [ (exclusive) or ] (inclusive). | ||
28 | * Beside numbers, you can use -Inf and +Inf for the infinite. | ||
29 | * | ||
30 | * @author Fabien Potencier <fabien@symfony.com> | ||
31 | * | ||
32 | * @see http://en.wikipedia.org/wiki/Interval_%28mathematics%29#The_ISO_notation | ||
33 | */ | ||
34 | class Interval | ||
35 | { | ||
36 | /** | ||
37 | * Tests if the given number is in the math interval. | ||
38 | * | ||
39 | * @param integer $number A number | ||
40 | * @param string $interval An interval | ||
41 | * | ||
42 | * @return Boolean | ||
43 | * | ||
44 | * @throws \InvalidArgumentException | ||
45 | */ | ||
46 | public static function test($number, $interval) | ||
47 | { | ||
48 | $interval = trim($interval); | ||
49 | |||
50 | if (!preg_match('/^'.self::getIntervalRegexp().'$/x', $interval, $matches)) { | ||
51 | throw new \InvalidArgumentException(sprintf('"%s" is not a valid interval.', $interval)); | ||
52 | } | ||
53 | |||
54 | if ($matches[1]) { | ||
55 | foreach (explode(',', $matches[2]) as $n) { | ||
56 | if ($number == $n) { | ||
57 | return true; | ||
58 | } | ||
59 | } | ||
60 | } else { | ||
61 | $leftNumber = self::convertNumber($matches['left']); | ||
62 | $rightNumber = self::convertNumber($matches['right']); | ||
63 | |||
64 | return | ||
65 | ('[' === $matches['left_delimiter'] ? $number >= $leftNumber : $number > $leftNumber) | ||
66 | && (']' === $matches['right_delimiter'] ? $number <= $rightNumber : $number < $rightNumber) | ||
67 | ; | ||
68 | } | ||
69 | |||
70 | return false; | ||
71 | } | ||
72 | |||
73 | /** | ||
74 | * Returns a Regexp that matches valid intervals. | ||
75 | * | ||
76 | * @return string A Regexp (without the delimiters) | ||
77 | */ | ||
78 | public static function getIntervalRegexp() | ||
79 | { | ||
80 | return <<<EOF | ||
81 | ({\s* | ||
82 | (\-?\d+(\.\d+)?[\s*,\s*\-?\d+(\.\d+)?]*) | ||
83 | \s*}) | ||
84 | |||
85 | | | ||
86 | |||
87 | (?P<left_delimiter>[\[\]]) | ||
88 | \s* | ||
89 | (?P<left>-Inf|\-?\d+(\.\d+)?) | ||
90 | \s*,\s* | ||
91 | (?P<right>\+?Inf|\-?\d+(\.\d+)?) | ||
92 | \s* | ||
93 | (?P<right_delimiter>[\[\]]) | ||
94 | EOF; | ||
95 | } | ||
96 | |||
97 | private static function convertNumber($number) | ||
98 | { | ||
99 | if ('-Inf' === $number) { | ||
100 | return log(0); | ||
101 | } elseif ('+Inf' === $number || 'Inf' === $number) { | ||
102 | return -log(0); | ||
103 | } | ||
104 | |||
105 | return (float) $number; | ||
106 | } | ||
107 | } | ||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/LICENSE b/vendor/symfony/translation/Symfony/Component/Translation/LICENSE deleted file mode 100644 index 88a57f8d..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/LICENSE +++ /dev/null | |||
@@ -1,19 +0,0 @@ | |||
1 | Copyright (c) 2004-2013 Fabien Potencier | ||
2 | |||
3 | Permission is hereby granted, free of charge, to any person obtaining a copy | ||
4 | of this software and associated documentation files (the "Software"), to deal | ||
5 | in the Software without restriction, including without limitation the rights | ||
6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
7 | copies of the Software, and to permit persons to whom the Software is furnished | ||
8 | to do so, subject to the following conditions: | ||
9 | |||
10 | The above copyright notice and this permission notice shall be included in all | ||
11 | copies or substantial portions of the Software. | ||
12 | |||
13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
19 | THE SOFTWARE. | ||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Loader/ArrayLoader.php b/vendor/symfony/translation/Symfony/Component/Translation/Loader/ArrayLoader.php deleted file mode 100644 index 99058fbf..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/Loader/ArrayLoader.php +++ /dev/null | |||
@@ -1,70 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of the Symfony package. | ||
5 | * | ||
6 | * (c) Fabien Potencier <fabien@symfony.com> | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | namespace Symfony\Component\Translation\Loader; | ||
13 | |||
14 | use Symfony\Component\Translation\MessageCatalogue; | ||
15 | |||
16 | /** | ||
17 | * ArrayLoader loads translations from a PHP array. | ||
18 | * | ||
19 | * @author Fabien Potencier <fabien@symfony.com> | ||
20 | * | ||
21 | * @api | ||
22 | */ | ||
23 | class ArrayLoader implements LoaderInterface | ||
24 | { | ||
25 | /** | ||
26 | * {@inheritdoc} | ||
27 | * | ||
28 | * @api | ||
29 | */ | ||
30 | public function load($resource, $locale, $domain = 'messages') | ||
31 | { | ||
32 | $this->flatten($resource); | ||
33 | $catalogue = new MessageCatalogue($locale); | ||
34 | $catalogue->add($resource, $domain); | ||
35 | |||
36 | return $catalogue; | ||
37 | } | ||
38 | |||
39 | /** | ||
40 | * Flattens an nested array of translations | ||
41 | * | ||
42 | * The scheme used is: | ||
43 | * 'key' => array('key2' => array('key3' => 'value')) | ||
44 | * Becomes: | ||
45 | * 'key.key2.key3' => 'value' | ||
46 | * | ||
47 | * This function takes an array by reference and will modify it | ||
48 | * | ||
49 | * @param array &$messages The array that will be flattened | ||
50 | * @param array $subnode Current subnode being parsed, used internally for recursive calls | ||
51 | * @param string $path Current path being parsed, used internally for recursive calls | ||
52 | */ | ||
53 | private function flatten(array &$messages, array $subnode = null, $path = null) | ||
54 | { | ||
55 | if (null === $subnode) { | ||
56 | $subnode =& $messages; | ||
57 | } | ||
58 | foreach ($subnode as $key => $value) { | ||
59 | if (is_array($value)) { | ||
60 | $nodePath = $path ? $path.'.'.$key : $key; | ||
61 | $this->flatten($messages, $value, $nodePath); | ||
62 | if (null === $path) { | ||
63 | unset($messages[$key]); | ||
64 | } | ||
65 | } elseif (null !== $path) { | ||
66 | $messages[$path.'.'.$key] = $value; | ||
67 | } | ||
68 | } | ||
69 | } | ||
70 | } | ||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Loader/CsvFileLoader.php b/vendor/symfony/translation/Symfony/Component/Translation/Loader/CsvFileLoader.php deleted file mode 100644 index bc10188c..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/Loader/CsvFileLoader.php +++ /dev/null | |||
@@ -1,92 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of the Symfony package. | ||
5 | * | ||
6 | * (c) Fabien Potencier <fabien@symfony.com> | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | namespace Symfony\Component\Translation\Loader; | ||
13 | |||
14 | use Symfony\Component\Translation\Exception\InvalidResourceException; | ||
15 | use Symfony\Component\Translation\Exception\NotFoundResourceException; | ||
16 | use Symfony\Component\Config\Resource\FileResource; | ||
17 | |||
18 | /** | ||
19 | * CsvFileLoader loads translations from CSV files. | ||
20 | * | ||
21 | * @author Saša Stamenković <umpirsky@gmail.com> | ||
22 | * | ||
23 | * @api | ||
24 | */ | ||
25 | class CsvFileLoader extends ArrayLoader implements LoaderInterface | ||
26 | { | ||
27 | private $delimiter = ';'; | ||
28 | private $enclosure = '"'; | ||
29 | private $escape = '\\'; | ||
30 | |||
31 | /** | ||
32 | * {@inheritdoc} | ||
33 | * | ||
34 | * @api | ||
35 | */ | ||
36 | public function load($resource, $locale, $domain = 'messages') | ||
37 | { | ||
38 | if (!stream_is_local($resource)) { | ||
39 | throw new InvalidResourceException(sprintf('This is not a local file "%s".', $resource)); | ||
40 | } | ||
41 | |||
42 | if (!file_exists($resource)) { | ||
43 | throw new NotFoundResourceException(sprintf('File "%s" not found.', $resource)); | ||
44 | } | ||
45 | |||
46 | $messages = array(); | ||
47 | |||
48 | try { | ||
49 | $file = new \SplFileObject($resource, 'rb'); | ||
50 | } catch (\RuntimeException $e) { | ||
51 | throw new NotFoundResourceException(sprintf('Error opening file "%s".', $resource), 0, $e); | ||
52 | } | ||
53 | |||
54 | $file->setFlags(\SplFileObject::READ_CSV | \SplFileObject::SKIP_EMPTY); | ||
55 | $file->setCsvControl($this->delimiter, $this->enclosure, $this->escape); | ||
56 | |||
57 | foreach ($file as $data) { | ||
58 | if (substr($data[0], 0, 1) === '#') { | ||
59 | continue; | ||
60 | } | ||
61 | |||
62 | if (!isset($data[1])) { | ||
63 | continue; | ||
64 | } | ||
65 | |||
66 | if (count($data) == 2) { | ||
67 | $messages[$data[0]] = $data[1]; | ||
68 | } else { | ||
69 | continue; | ||
70 | } | ||
71 | } | ||
72 | |||
73 | $catalogue = parent::load($messages, $locale, $domain); | ||
74 | $catalogue->addResource(new FileResource($resource)); | ||
75 | |||
76 | return $catalogue; | ||
77 | } | ||
78 | |||
79 | /** | ||
80 | * Sets the delimiter, enclosure, and escape character for CSV. | ||
81 | * | ||
82 | * @param string $delimiter delimiter character | ||
83 | * @param string $enclosure enclosure character | ||
84 | * @param string $escape escape character | ||
85 | */ | ||
86 | public function setCsvControl($delimiter = ';', $enclosure = '"', $escape = '\\') | ||
87 | { | ||
88 | $this->delimiter = $delimiter; | ||
89 | $this->enclosure = $enclosure; | ||
90 | $this->escape = $escape; | ||
91 | } | ||
92 | } | ||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Loader/IcuDatFileLoader.php b/vendor/symfony/translation/Symfony/Component/Translation/Loader/IcuDatFileLoader.php deleted file mode 100644 index 104883b0..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/Loader/IcuDatFileLoader.php +++ /dev/null | |||
@@ -1,54 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of the Symfony package. | ||
5 | * | ||
6 | * (c) Fabien Potencier <fabien@symfony.com> | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | namespace Symfony\Component\Translation\Loader; | ||
13 | |||
14 | use Symfony\Component\Translation\MessageCatalogue; | ||
15 | use Symfony\Component\Translation\Exception\InvalidResourceException; | ||
16 | use Symfony\Component\Translation\Exception\NotFoundResourceException; | ||
17 | use Symfony\Component\Config\Resource\FileResource; | ||
18 | |||
19 | /** | ||
20 | * IcuResFileLoader loads translations from a resource bundle. | ||
21 | * | ||
22 | * @author stealth35 | ||
23 | */ | ||
24 | class IcuDatFileLoader extends IcuResFileLoader | ||
25 | { | ||
26 | /** | ||
27 | * {@inheritdoc} | ||
28 | */ | ||
29 | public function load($resource, $locale, $domain = 'messages') | ||
30 | { | ||
31 | if (!stream_is_local($resource.'.dat')) { | ||
32 | throw new InvalidResourceException(sprintf('This is not a local file "%s".', $resource)); | ||
33 | } | ||
34 | |||
35 | if (!file_exists($resource.'.dat')) { | ||
36 | throw new NotFoundResourceException(sprintf('File "%s" not found.', $resource)); | ||
37 | } | ||
38 | |||
39 | $rb = new \ResourceBundle($locale, $resource); | ||
40 | |||
41 | if (!$rb) { | ||
42 | throw new InvalidResourceException(sprintf('Cannot load resource "%s"', $resource)); | ||
43 | } elseif (intl_is_failure($rb->getErrorCode())) { | ||
44 | throw new InvalidResourceException($rb->getErrorMessage(), $rb->getErrorCode()); | ||
45 | } | ||
46 | |||
47 | $messages = $this->flatten($rb); | ||
48 | $catalogue = new MessageCatalogue($locale); | ||
49 | $catalogue->add($messages, $domain); | ||
50 | $catalogue->addResource(new FileResource($resource.'.dat')); | ||
51 | |||
52 | return $catalogue; | ||
53 | } | ||
54 | } | ||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Loader/IcuResFileLoader.php b/vendor/symfony/translation/Symfony/Component/Translation/Loader/IcuResFileLoader.php deleted file mode 100644 index 81b8e0fc..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/Loader/IcuResFileLoader.php +++ /dev/null | |||
@@ -1,84 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of the Symfony package. | ||
5 | * | ||
6 | * (c) Fabien Potencier <fabien@symfony.com> | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | namespace Symfony\Component\Translation\Loader; | ||
13 | |||
14 | use Symfony\Component\Translation\MessageCatalogue; | ||
15 | use Symfony\Component\Translation\Exception\InvalidResourceException; | ||
16 | use Symfony\Component\Translation\Exception\NotFoundResourceException; | ||
17 | use Symfony\Component\Config\Resource\DirectoryResource; | ||
18 | |||
19 | /** | ||
20 | * IcuResFileLoader loads translations from a resource bundle. | ||
21 | * | ||
22 | * @author stealth35 | ||
23 | */ | ||
24 | class IcuResFileLoader implements LoaderInterface | ||
25 | { | ||
26 | /** | ||
27 | * {@inheritdoc} | ||
28 | */ | ||
29 | public function load($resource, $locale, $domain = 'messages') | ||
30 | { | ||
31 | if (!stream_is_local($resource)) { | ||
32 | throw new InvalidResourceException(sprintf('This is not a local file "%s".', $resource)); | ||
33 | } | ||
34 | |||
35 | if (!is_dir($resource)) { | ||
36 | throw new NotFoundResourceException(sprintf('File "%s" not found.', $resource)); | ||
37 | } | ||
38 | |||
39 | $rb = new \ResourceBundle($locale, $resource); | ||
40 | |||
41 | if (!$rb) { | ||
42 | throw new InvalidResourceException(sprintf('Cannot load resource "%s"', $resource)); | ||
43 | } elseif (intl_is_failure($rb->getErrorCode())) { | ||
44 | throw new InvalidResourceException($rb->getErrorMessage(), $rb->getErrorCode()); | ||
45 | } | ||
46 | |||
47 | $messages = $this->flatten($rb); | ||
48 | $catalogue = new MessageCatalogue($locale); | ||
49 | $catalogue->add($messages, $domain); | ||
50 | $catalogue->addResource(new DirectoryResource($resource)); | ||
51 | |||
52 | return $catalogue; | ||
53 | } | ||
54 | |||
55 | /** | ||
56 | * Flattens an ResourceBundle | ||
57 | * | ||
58 | * The scheme used is: | ||
59 | * key { key2 { key3 { "value" } } } | ||
60 | * Becomes: | ||
61 | * 'key.key2.key3' => 'value' | ||
62 | * | ||
63 | * This function takes an array by reference and will modify it | ||
64 | * | ||
65 | * @param \ResourceBundle $rb the ResourceBundle that will be flattened | ||
66 | * @param array $messages used internally for recursive calls | ||
67 | * @param string $path current path being parsed, used internally for recursive calls | ||
68 | * | ||
69 | * @return array the flattened ResourceBundle | ||
70 | */ | ||
71 | protected function flatten(\ResourceBundle $rb, array &$messages = array(), $path = null) | ||
72 | { | ||
73 | foreach ($rb as $key => $value) { | ||
74 | $nodePath = $path ? $path.'.'.$key : $key; | ||
75 | if ($value instanceof \ResourceBundle) { | ||
76 | $this->flatten($value, $messages, $nodePath); | ||
77 | } else { | ||
78 | $messages[$nodePath] = $value; | ||
79 | } | ||
80 | } | ||
81 | |||
82 | return $messages; | ||
83 | } | ||
84 | } | ||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Loader/IniFileLoader.php b/vendor/symfony/translation/Symfony/Component/Translation/Loader/IniFileLoader.php deleted file mode 100644 index 616fa7e0..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/Loader/IniFileLoader.php +++ /dev/null | |||
@@ -1,45 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of the Symfony package. | ||
5 | * | ||
6 | * (c) Fabien Potencier <fabien@symfony.com> | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | namespace Symfony\Component\Translation\Loader; | ||
13 | |||
14 | use Symfony\Component\Translation\Exception\InvalidResourceException; | ||
15 | use Symfony\Component\Translation\Exception\NotFoundResourceException; | ||
16 | use Symfony\Component\Config\Resource\FileResource; | ||
17 | |||
18 | /** | ||
19 | * IniFileLoader loads translations from an ini file. | ||
20 | * | ||
21 | * @author stealth35 | ||
22 | */ | ||
23 | class IniFileLoader extends ArrayLoader implements LoaderInterface | ||
24 | { | ||
25 | /** | ||
26 | * {@inheritdoc} | ||
27 | */ | ||
28 | public function load($resource, $locale, $domain = 'messages') | ||
29 | { | ||
30 | if (!stream_is_local($resource)) { | ||
31 | throw new InvalidResourceException(sprintf('This is not a local file "%s".', $resource)); | ||
32 | } | ||
33 | |||
34 | if (!file_exists($resource)) { | ||
35 | throw new NotFoundResourceException(sprintf('File "%s" not found.', $resource)); | ||
36 | } | ||
37 | |||
38 | $messages = parse_ini_file($resource, true); | ||
39 | |||
40 | $catalogue = parent::load($messages, $locale, $domain); | ||
41 | $catalogue->addResource(new FileResource($resource)); | ||
42 | |||
43 | return $catalogue; | ||
44 | } | ||
45 | } | ||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Loader/LoaderInterface.php b/vendor/symfony/translation/Symfony/Component/Translation/Loader/LoaderInterface.php deleted file mode 100644 index 4d9965ce..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/Loader/LoaderInterface.php +++ /dev/null | |||
@@ -1,41 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of the Symfony package. | ||
5 | * | ||
6 | * (c) Fabien Potencier <fabien@symfony.com> | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | namespace Symfony\Component\Translation\Loader; | ||
13 | |||
14 | use Symfony\Component\Translation\MessageCatalogue; | ||
15 | use Symfony\Component\Translation\Exception\InvalidResourceException; | ||
16 | |||
17 | /** | ||
18 | * LoaderInterface is the interface implemented by all translation loaders. | ||
19 | * | ||
20 | * @author Fabien Potencier <fabien@symfony.com> | ||
21 | * | ||
22 | * @api | ||
23 | */ | ||
24 | interface LoaderInterface | ||
25 | { | ||
26 | /** | ||
27 | * Loads a locale. | ||
28 | * | ||
29 | * @param mixed $resource A resource | ||
30 | * @param string $locale A locale | ||
31 | * @param string $domain The domain | ||
32 | * | ||
33 | * @return MessageCatalogue A MessageCatalogue instance | ||
34 | * | ||
35 | * @api | ||
36 | * | ||
37 | * @throws NotFoundResourceException when the resource cannot be found | ||
38 | * @throws InvalidResourceException when the resource cannot be loaded | ||
39 | */ | ||
40 | public function load($resource, $locale, $domain = 'messages'); | ||
41 | } | ||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Loader/MoFileLoader.php b/vendor/symfony/translation/Symfony/Component/Translation/Loader/MoFileLoader.php deleted file mode 100644 index 9d1cacb3..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/Loader/MoFileLoader.php +++ /dev/null | |||
@@ -1,179 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of the Symfony package. | ||
5 | * | ||
6 | * (c) Fabien Potencier <fabien@symfony.com> | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | namespace Symfony\Component\Translation\Loader; | ||
13 | |||
14 | use Symfony\Component\Translation\Exception\InvalidResourceException; | ||
15 | use Symfony\Component\Translation\Exception\NotFoundResourceException; | ||
16 | use Symfony\Component\Config\Resource\FileResource; | ||
17 | |||
18 | /** | ||
19 | * @copyright Copyright (c) 2010, Union of RAD http://union-of-rad.org (http://lithify.me/) | ||
20 | */ | ||
21 | class MoFileLoader extends ArrayLoader implements LoaderInterface | ||
22 | { | ||
23 | /** | ||
24 | * Magic used for validating the format of a MO file as well as | ||
25 | * detecting if the machine used to create that file was little endian. | ||
26 | * | ||
27 | * @var float | ||
28 | */ | ||
29 | const MO_LITTLE_ENDIAN_MAGIC = 0x950412de; | ||
30 | |||
31 | /** | ||
32 | * Magic used for validating the format of a MO file as well as | ||
33 | * detecting if the machine used to create that file was big endian. | ||
34 | * | ||
35 | * @var float | ||
36 | */ | ||
37 | const MO_BIG_ENDIAN_MAGIC = 0xde120495; | ||
38 | |||
39 | /** | ||
40 | * The size of the header of a MO file in bytes. | ||
41 | * | ||
42 | * @var integer Number of bytes. | ||
43 | */ | ||
44 | const MO_HEADER_SIZE = 28; | ||
45 | |||
46 | public function load($resource, $locale, $domain = 'messages') | ||
47 | { | ||
48 | if (!stream_is_local($resource)) { | ||
49 | throw new InvalidResourceException(sprintf('This is not a local file "%s".', $resource)); | ||
50 | } | ||
51 | |||
52 | if (!file_exists($resource)) { | ||
53 | throw new NotFoundResourceException(sprintf('File "%s" not found.', $resource)); | ||
54 | } | ||
55 | |||
56 | $messages = $this->parse($resource); | ||
57 | |||
58 | // empty file | ||
59 | if (null === $messages) { | ||
60 | $messages = array(); | ||
61 | } | ||
62 | |||
63 | // not an array | ||
64 | if (!is_array($messages)) { | ||
65 | throw new InvalidResourceException(sprintf('The file "%s" must contain a valid mo file.', $resource)); | ||
66 | } | ||
67 | |||
68 | $catalogue = parent::load($messages, $locale, $domain); | ||
69 | $catalogue->addResource(new FileResource($resource)); | ||
70 | |||
71 | return $catalogue; | ||
72 | } | ||
73 | |||
74 | /** | ||
75 | * Parses machine object (MO) format, independent of the machine's endian it | ||
76 | * was created on. Both 32bit and 64bit systems are supported. | ||
77 | * | ||
78 | * @param resource $resource | ||
79 | * | ||
80 | * @return array | ||
81 | * @throws InvalidResourceException If stream content has an invalid format. | ||
82 | */ | ||
83 | private function parse($resource) | ||
84 | { | ||
85 | $stream = fopen($resource, 'r'); | ||
86 | |||
87 | $stat = fstat($stream); | ||
88 | |||
89 | if ($stat['size'] < self::MO_HEADER_SIZE) { | ||
90 | throw new InvalidResourceException("MO stream content has an invalid format."); | ||
91 | } | ||
92 | $magic = unpack('V1', fread($stream, 4)); | ||
93 | $magic = hexdec(substr(dechex(current($magic)), -8)); | ||
94 | |||
95 | if ($magic == self::MO_LITTLE_ENDIAN_MAGIC) { | ||
96 | $isBigEndian = false; | ||
97 | } elseif ($magic == self::MO_BIG_ENDIAN_MAGIC) { | ||
98 | $isBigEndian = true; | ||
99 | } else { | ||
100 | throw new InvalidResourceException("MO stream content has an invalid format."); | ||
101 | } | ||
102 | |||
103 | $formatRevision = $this->readLong($stream, $isBigEndian); | ||
104 | $count = $this->readLong($stream, $isBigEndian); | ||
105 | $offsetId = $this->readLong($stream, $isBigEndian); | ||
106 | $offsetTranslated = $this->readLong($stream, $isBigEndian); | ||
107 | $sizeHashes = $this->readLong($stream, $isBigEndian); | ||
108 | $offsetHashes = $this->readLong($stream, $isBigEndian); | ||
109 | |||
110 | $messages = array(); | ||
111 | |||
112 | for ($i = 0; $i < $count; $i++) { | ||
113 | $singularId = $pluralId = null; | ||
114 | $translated = null; | ||
115 | |||
116 | fseek($stream, $offsetId + $i * 8); | ||
117 | |||
118 | $length = $this->readLong($stream, $isBigEndian); | ||
119 | $offset = $this->readLong($stream, $isBigEndian); | ||
120 | |||
121 | if ($length < 1) { | ||
122 | continue; | ||
123 | } | ||
124 | |||
125 | fseek($stream, $offset); | ||
126 | $singularId = fread($stream, $length); | ||
127 | |||
128 | if (strpos($singularId, "\000") !== false) { | ||
129 | list($singularId, $pluralId) = explode("\000", $singularId); | ||
130 | } | ||
131 | |||
132 | fseek($stream, $offsetTranslated + $i * 8); | ||
133 | $length = $this->readLong($stream, $isBigEndian); | ||
134 | $offset = $this->readLong($stream, $isBigEndian); | ||
135 | |||
136 | fseek($stream, $offset); | ||
137 | $translated = fread($stream, $length); | ||
138 | |||
139 | if (strpos($translated, "\000") !== false) { | ||
140 | $translated = explode("\000", $translated); | ||
141 | } | ||
142 | |||
143 | $ids = array('singular' => $singularId, 'plural' => $pluralId); | ||
144 | $item = compact('ids', 'translated'); | ||
145 | |||
146 | if (is_array($item['translated'])) { | ||
147 | $messages[$item['ids']['singular']] = stripcslashes($item['translated'][0]); | ||
148 | if (isset($item['ids']['plural'])) { | ||
149 | $plurals = array(); | ||
150 | foreach ($item['translated'] as $plural => $translated) { | ||
151 | $plurals[] = sprintf('{%d} %s', $plural, $translated); | ||
152 | } | ||
153 | $messages[$item['ids']['plural']] = stripcslashes(implode('|', $plurals)); | ||
154 | } | ||
155 | } elseif (!empty($item['ids']['singular'])) { | ||
156 | $messages[$item['ids']['singular']] = stripcslashes($item['translated']); | ||
157 | } | ||
158 | } | ||
159 | |||
160 | fclose($stream); | ||
161 | |||
162 | return array_filter($messages); | ||
163 | } | ||
164 | |||
165 | /** | ||
166 | * Reads an unsigned long from stream respecting endianess. | ||
167 | * | ||
168 | * @param resource $stream | ||
169 | * @param boolean $isBigEndian | ||
170 | * @return integer | ||
171 | */ | ||
172 | private function readLong($stream, $isBigEndian) | ||
173 | { | ||
174 | $result = unpack($isBigEndian ? 'N1' : 'V1', fread($stream, 4)); | ||
175 | $result = current($result); | ||
176 | |||
177 | return (integer) substr($result, -8); | ||
178 | } | ||
179 | } | ||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Loader/PhpFileLoader.php b/vendor/symfony/translation/Symfony/Component/Translation/Loader/PhpFileLoader.php deleted file mode 100644 index 4737d1bf..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/Loader/PhpFileLoader.php +++ /dev/null | |||
@@ -1,49 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of the Symfony package. | ||
5 | * | ||
6 | * (c) Fabien Potencier <fabien@symfony.com> | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | namespace Symfony\Component\Translation\Loader; | ||
13 | |||
14 | use Symfony\Component\Translation\Exception\InvalidResourceException; | ||
15 | use Symfony\Component\Translation\Exception\NotFoundResourceException; | ||
16 | use Symfony\Component\Config\Resource\FileResource; | ||
17 | |||
18 | /** | ||
19 | * PhpFileLoader loads translations from PHP files returning an array of translations. | ||
20 | * | ||
21 | * @author Fabien Potencier <fabien@symfony.com> | ||
22 | * | ||
23 | * @api | ||
24 | */ | ||
25 | class PhpFileLoader extends ArrayLoader implements LoaderInterface | ||
26 | { | ||
27 | /** | ||
28 | * {@inheritdoc} | ||
29 | * | ||
30 | * @api | ||
31 | */ | ||
32 | public function load($resource, $locale, $domain = 'messages') | ||
33 | { | ||
34 | if (!stream_is_local($resource)) { | ||
35 | throw new InvalidResourceException(sprintf('This is not a local file "%s".', $resource)); | ||
36 | } | ||
37 | |||
38 | if (!file_exists($resource)) { | ||
39 | throw new NotFoundResourceException(sprintf('File "%s" not found.', $resource)); | ||
40 | } | ||
41 | |||
42 | $messages = require($resource); | ||
43 | |||
44 | $catalogue = parent::load($messages, $locale, $domain); | ||
45 | $catalogue->addResource(new FileResource($resource)); | ||
46 | |||
47 | return $catalogue; | ||
48 | } | ||
49 | } | ||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Loader/PoFileLoader.php b/vendor/symfony/translation/Symfony/Component/Translation/Loader/PoFileLoader.php deleted file mode 100644 index 58ec6c7a..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/Loader/PoFileLoader.php +++ /dev/null | |||
@@ -1,178 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of the Symfony package. | ||
5 | * | ||
6 | * (c) Fabien Potencier <fabien@symfony.com> | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | namespace Symfony\Component\Translation\Loader; | ||
13 | |||
14 | use Symfony\Component\Translation\Exception\InvalidResourceException; | ||
15 | use Symfony\Component\Translation\Exception\NotFoundResourceException; | ||
16 | use Symfony\Component\Config\Resource\FileResource; | ||
17 | |||
18 | /** | ||
19 | * @copyright Copyright (c) 2010, Union of RAD http://union-of-rad.org (http://lithify.me/) | ||
20 | * @copyright Copyright (c) 2012, Clemens Tolboom | ||
21 | */ | ||
22 | class PoFileLoader extends ArrayLoader implements LoaderInterface | ||
23 | { | ||
24 | public function load($resource, $locale, $domain = 'messages') | ||
25 | { | ||
26 | if (!stream_is_local($resource)) { | ||
27 | throw new InvalidResourceException(sprintf('This is not a local file "%s".', $resource)); | ||
28 | } | ||
29 | |||
30 | if (!file_exists($resource)) { | ||
31 | throw new NotFoundResourceException(sprintf('File "%s" not found.', $resource)); | ||
32 | } | ||
33 | |||
34 | $messages = $this->parse($resource); | ||
35 | |||
36 | // empty file | ||
37 | if (null === $messages) { | ||
38 | $messages = array(); | ||
39 | } | ||
40 | |||
41 | // not an array | ||
42 | if (!is_array($messages)) { | ||
43 | throw new InvalidResourceException(sprintf('The file "%s" must contain a valid po file.', $resource)); | ||
44 | } | ||
45 | |||
46 | $catalogue = parent::load($messages, $locale, $domain); | ||
47 | $catalogue->addResource(new FileResource($resource)); | ||
48 | |||
49 | return $catalogue; | ||
50 | } | ||
51 | |||
52 | /** | ||
53 | * Parses portable object (PO) format. | ||
54 | * | ||
55 | * From http://www.gnu.org/software/gettext/manual/gettext.html#PO-Files | ||
56 | * we should be able to parse files having: | ||
57 | * | ||
58 | * white-space | ||
59 | * # translator-comments | ||
60 | * #. extracted-comments | ||
61 | * #: reference... | ||
62 | * #, flag... | ||
63 | * #| msgid previous-untranslated-string | ||
64 | * msgid untranslated-string | ||
65 | * msgstr translated-string | ||
66 | * | ||
67 | * extra or different lines are: | ||
68 | * | ||
69 | * #| msgctxt previous-context | ||
70 | * #| msgid previous-untranslated-string | ||
71 | * msgctxt context | ||
72 | * | ||
73 | * #| msgid previous-untranslated-string-singular | ||
74 | * #| msgid_plural previous-untranslated-string-plural | ||
75 | * msgid untranslated-string-singular | ||
76 | * msgid_plural untranslated-string-plural | ||
77 | * msgstr[0] translated-string-case-0 | ||
78 | * ... | ||
79 | * msgstr[N] translated-string-case-n | ||
80 | * | ||
81 | * The definition states: | ||
82 | * - white-space and comments are optional. | ||
83 | * - msgid "" that an empty singleline defines a header. | ||
84 | * | ||
85 | * This parser sacrifices some features of the reference implementation the | ||
86 | * differences to that implementation are as follows. | ||
87 | * - No support for comments spanning multiple lines. | ||
88 | * - Translator and extracted comments are treated as being the same type. | ||
89 | * - Message IDs are allowed to have other encodings as just US-ASCII. | ||
90 | * | ||
91 | * Items with an empty id are ignored. | ||
92 | * | ||
93 | * @param resource $resource | ||
94 | * | ||
95 | * @return array | ||
96 | */ | ||
97 | private function parse($resource) | ||
98 | { | ||
99 | $stream = fopen($resource, 'r'); | ||
100 | |||
101 | $defaults = array( | ||
102 | 'ids' => array(), | ||
103 | 'translated' => null, | ||
104 | ); | ||
105 | |||
106 | $messages = array(); | ||
107 | $item = $defaults; | ||
108 | |||
109 | while ($line = fgets($stream)) { | ||
110 | $line = trim($line); | ||
111 | |||
112 | if ($line === '') { | ||
113 | // Whitespace indicated current item is done | ||
114 | $this->addMessage($messages, $item); | ||
115 | $item = $defaults; | ||
116 | } elseif (substr($line, 0, 7) === 'msgid "') { | ||
117 | // We start a new msg so save previous | ||
118 | // TODO: this fails when comments or contexts are added | ||
119 | $this->addMessage($messages, $item); | ||
120 | $item = $defaults; | ||
121 | $item['ids']['singular'] = substr($line, 7, -1); | ||
122 | } elseif (substr($line, 0, 8) === 'msgstr "') { | ||
123 | $item['translated'] = substr($line, 8, -1); | ||
124 | } elseif ($line[0] === '"') { | ||
125 | $continues = isset($item['translated']) ? 'translated' : 'ids'; | ||
126 | |||
127 | if (is_array($item[$continues])) { | ||
128 | end($item[$continues]); | ||
129 | $item[$continues][key($item[$continues])] .= substr($line, 1, -1); | ||
130 | } else { | ||
131 | $item[$continues] .= substr($line, 1, -1); | ||
132 | } | ||
133 | } elseif (substr($line, 0, 14) === 'msgid_plural "') { | ||
134 | $item['ids']['plural'] = substr($line, 14, -1); | ||
135 | } elseif (substr($line, 0, 7) === 'msgstr[') { | ||
136 | $size = strpos($line, ']'); | ||
137 | $item['translated'][(integer) substr($line, 7, 1)] = substr($line, $size + 3, -1); | ||
138 | } | ||
139 | |||
140 | } | ||
141 | // save last item | ||
142 | $this->addMessage($messages, $item); | ||
143 | fclose($stream); | ||
144 | |||
145 | return $messages; | ||
146 | } | ||
147 | |||
148 | /** | ||
149 | * Save a translation item to the messeages. | ||
150 | * | ||
151 | * A .po file could contain by error missing plural indexes. We need to | ||
152 | * fix these before saving them. | ||
153 | * | ||
154 | * @param array $messages | ||
155 | * @param array $item | ||
156 | */ | ||
157 | private function addMessage(array &$messages, array $item) | ||
158 | { | ||
159 | if (is_array($item['translated'])) { | ||
160 | $messages[$item['ids']['singular']] = stripslashes($item['translated'][0]); | ||
161 | if (isset($item['ids']['plural'])) { | ||
162 | $plurals = $item['translated']; | ||
163 | // PO are by definition indexed so sort by index. | ||
164 | ksort($plurals); | ||
165 | // Make sure every index is filled. | ||
166 | end($plurals); | ||
167 | $count = key($plurals); | ||
168 | // Fill missing spots with '-'. | ||
169 | $empties = array_fill(0, $count+1, '-'); | ||
170 | $plurals += $empties; | ||
171 | ksort($plurals); | ||
172 | $messages[$item['ids']['plural']] = stripcslashes(implode('|', $plurals)); | ||
173 | } | ||
174 | } elseif (!empty($item['ids']['singular'])) { | ||
175 | $messages[$item['ids']['singular']] = stripslashes($item['translated']); | ||
176 | } | ||
177 | } | ||
178 | } | ||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Loader/QtFileLoader.php b/vendor/symfony/translation/Symfony/Component/Translation/Loader/QtFileLoader.php deleted file mode 100644 index d64494b8..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/Loader/QtFileLoader.php +++ /dev/null | |||
@@ -1,95 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of the Symfony package. | ||
5 | * | ||
6 | * (c) Fabien Potencier <fabien@symfony.com> | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | namespace Symfony\Component\Translation\Loader; | ||
13 | |||
14 | use Symfony\Component\Translation\MessageCatalogue; | ||
15 | use Symfony\Component\Translation\Exception\InvalidResourceException; | ||
16 | use Symfony\Component\Translation\Exception\NotFoundResourceException; | ||
17 | use Symfony\Component\Config\Resource\FileResource; | ||
18 | |||
19 | /** | ||
20 | * QtFileLoader loads translations from QT Translations XML files. | ||
21 | * | ||
22 | * @author Benjamin Eberlei <kontakt@beberlei.de> | ||
23 | * | ||
24 | * @api | ||
25 | */ | ||
26 | class QtFileLoader implements LoaderInterface | ||
27 | { | ||
28 | /** | ||
29 | * {@inheritdoc} | ||
30 | * | ||
31 | * @api | ||
32 | */ | ||
33 | public function load($resource, $locale, $domain = 'messages') | ||
34 | { | ||
35 | if (!stream_is_local($resource)) { | ||
36 | throw new InvalidResourceException(sprintf('This is not a local file "%s".', $resource)); | ||
37 | } | ||
38 | |||
39 | if (!file_exists($resource)) { | ||
40 | throw new NotFoundResourceException(sprintf('File "%s" not found.', $resource)); | ||
41 | } | ||
42 | |||
43 | $dom = new \DOMDocument(); | ||
44 | $current = libxml_use_internal_errors(true); | ||
45 | if (!@$dom->load($resource, defined('LIBXML_COMPACT') ? LIBXML_COMPACT : 0)) { | ||
46 | throw new InvalidResourceException(implode("\n", $this->getXmlErrors())); | ||
47 | } | ||
48 | |||
49 | $xpath = new \DOMXPath($dom); | ||
50 | $nodes = $xpath->evaluate('//TS/context/name[text()="'.$domain.'"]'); | ||
51 | |||
52 | $catalogue = new MessageCatalogue($locale); | ||
53 | if ($nodes->length == 1) { | ||
54 | $translations = $nodes->item(0)->nextSibling->parentNode->parentNode->getElementsByTagName('message'); | ||
55 | foreach ($translations as $translation) { | ||
56 | $catalogue->set( | ||
57 | (string) $translation->getElementsByTagName('source')->item(0)->nodeValue, | ||
58 | (string) $translation->getElementsByTagName('translation')->item(0)->nodeValue, | ||
59 | $domain | ||
60 | ); | ||
61 | $translation = $translation->nextSibling; | ||
62 | } | ||
63 | $catalogue->addResource(new FileResource($resource)); | ||
64 | } | ||
65 | |||
66 | libxml_use_internal_errors($current); | ||
67 | |||
68 | return $catalogue; | ||
69 | } | ||
70 | |||
71 | /** | ||
72 | * Returns the XML errors of the internal XML parser | ||
73 | * | ||
74 | * @return array An array of errors | ||
75 | */ | ||
76 | private function getXmlErrors() | ||
77 | { | ||
78 | $errors = array(); | ||
79 | foreach (libxml_get_errors() as $error) { | ||
80 | $errors[] = sprintf('[%s %s] %s (in %s - line %d, column %d)', | ||
81 | LIBXML_ERR_WARNING == $error->level ? 'WARNING' : 'ERROR', | ||
82 | $error->code, | ||
83 | trim($error->message), | ||
84 | $error->file ? $error->file : 'n/a', | ||
85 | $error->line, | ||
86 | $error->column | ||
87 | ); | ||
88 | } | ||
89 | |||
90 | libxml_clear_errors(); | ||
91 | libxml_use_internal_errors(false); | ||
92 | |||
93 | return $errors; | ||
94 | } | ||
95 | } | ||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Loader/XliffFileLoader.php b/vendor/symfony/translation/Symfony/Component/Translation/Loader/XliffFileLoader.php deleted file mode 100644 index 0cafc043..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/Loader/XliffFileLoader.php +++ /dev/null | |||
@@ -1,163 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of the Symfony package. | ||
5 | * | ||
6 | * (c) Fabien Potencier <fabien@symfony.com> | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | namespace Symfony\Component\Translation\Loader; | ||
13 | |||
14 | use Symfony\Component\Translation\MessageCatalogue; | ||
15 | use Symfony\Component\Translation\Exception\InvalidResourceException; | ||
16 | use Symfony\Component\Translation\Exception\NotFoundResourceException; | ||
17 | use Symfony\Component\Config\Resource\FileResource; | ||
18 | |||
19 | /** | ||
20 | * XliffFileLoader loads translations from XLIFF files. | ||
21 | * | ||
22 | * @author Fabien Potencier <fabien@symfony.com> | ||
23 | * | ||
24 | * @api | ||
25 | */ | ||
26 | class XliffFileLoader implements LoaderInterface | ||
27 | { | ||
28 | /** | ||
29 | * {@inheritdoc} | ||
30 | * | ||
31 | * @api | ||
32 | */ | ||
33 | public function load($resource, $locale, $domain = 'messages') | ||
34 | { | ||
35 | if (!stream_is_local($resource)) { | ||
36 | throw new InvalidResourceException(sprintf('This is not a local file "%s".', $resource)); | ||
37 | } | ||
38 | |||
39 | if (!file_exists($resource)) { | ||
40 | throw new NotFoundResourceException(sprintf('File "%s" not found.', $resource)); | ||
41 | } | ||
42 | |||
43 | list($xml, $encoding) = $this->parseFile($resource); | ||
44 | $xml->registerXPathNamespace('xliff', 'urn:oasis:names:tc:xliff:document:1.2'); | ||
45 | |||
46 | $catalogue = new MessageCatalogue($locale); | ||
47 | foreach ($xml->xpath('//xliff:trans-unit') as $translation) { | ||
48 | $attributes = $translation->attributes(); | ||
49 | |||
50 | if (!(isset($attributes['resname']) || isset($translation->source)) || !isset($translation->target)) { | ||
51 | continue; | ||
52 | } | ||
53 | |||
54 | $source = isset($attributes['resname']) && $attributes['resname'] ? $attributes['resname'] : $translation->source; | ||
55 | $target = (string) $translation->target; | ||
56 | |||
57 | // If the xlf file has another encoding specified, try to convert it because | ||
58 | // simple_xml will always return utf-8 encoded values | ||
59 | if ('UTF-8' !== $encoding && !empty($encoding)) { | ||
60 | if (function_exists('mb_convert_encoding')) { | ||
61 | $target = mb_convert_encoding($target, $encoding, 'UTF-8'); | ||
62 | } elseif (function_exists('iconv')) { | ||
63 | $target = iconv('UTF-8', $encoding, $target); | ||
64 | } else { | ||
65 | throw new \RuntimeException('No suitable convert encoding function (use UTF-8 as your encoding or install the iconv or mbstring extension).'); | ||
66 | } | ||
67 | } | ||
68 | |||
69 | $catalogue->set((string) $source, $target, $domain); | ||
70 | } | ||
71 | $catalogue->addResource(new FileResource($resource)); | ||
72 | |||
73 | return $catalogue; | ||
74 | } | ||
75 | |||
76 | /** | ||
77 | * Validates and parses the given file into a SimpleXMLElement | ||
78 | * | ||
79 | * @param string $file | ||
80 | * | ||
81 | * @throws \RuntimeException | ||
82 | * | ||
83 | * @return \SimpleXMLElement | ||
84 | * | ||
85 | * @throws InvalidResourceException | ||
86 | */ | ||
87 | private function parseFile($file) | ||
88 | { | ||
89 | $internalErrors = libxml_use_internal_errors(true); | ||
90 | $disableEntities = libxml_disable_entity_loader(true); | ||
91 | libxml_clear_errors(); | ||
92 | |||
93 | $dom = new \DOMDocument(); | ||
94 | $dom->validateOnParse = true; | ||
95 | if (!@$dom->loadXML(file_get_contents($file), LIBXML_NONET | (defined('LIBXML_COMPACT') ? LIBXML_COMPACT : 0))) { | ||
96 | libxml_disable_entity_loader($disableEntities); | ||
97 | |||
98 | throw new InvalidResourceException(implode("\n", $this->getXmlErrors($internalErrors))); | ||
99 | } | ||
100 | |||
101 | libxml_disable_entity_loader($disableEntities); | ||
102 | |||
103 | foreach ($dom->childNodes as $child) { | ||
104 | if ($child->nodeType === XML_DOCUMENT_TYPE_NODE) { | ||
105 | libxml_use_internal_errors($internalErrors); | ||
106 | |||
107 | throw new InvalidResourceException('Document types are not allowed.'); | ||
108 | } | ||
109 | } | ||
110 | |||
111 | $location = str_replace('\\', '/', __DIR__).'/schema/dic/xliff-core/xml.xsd'; | ||
112 | $parts = explode('/', $location); | ||
113 | if (0 === stripos($location, 'phar://')) { | ||
114 | $tmpfile = tempnam(sys_get_temp_dir(), 'sf2'); | ||
115 | if ($tmpfile) { | ||
116 | copy($location, $tmpfile); | ||
117 | $parts = explode('/', str_replace('\\', '/', $tmpfile)); | ||
118 | } | ||
119 | } | ||
120 | $drive = '\\' === DIRECTORY_SEPARATOR ? array_shift($parts).'/' : ''; | ||
121 | $location = 'file:///'.$drive.implode('/', array_map('rawurlencode', $parts)); | ||
122 | |||
123 | $source = file_get_contents(__DIR__.'/schema/dic/xliff-core/xliff-core-1.2-strict.xsd'); | ||
124 | $source = str_replace('http://www.w3.org/2001/xml.xsd', $location, $source); | ||
125 | |||
126 | if (!@$dom->schemaValidateSource($source)) { | ||
127 | throw new InvalidResourceException(implode("\n", $this->getXmlErrors($internalErrors))); | ||
128 | } | ||
129 | |||
130 | $dom->normalizeDocument(); | ||
131 | |||
132 | libxml_use_internal_errors($internalErrors); | ||
133 | |||
134 | return array(simplexml_import_dom($dom), strtoupper($dom->encoding)); | ||
135 | } | ||
136 | |||
137 | /** | ||
138 | * Returns the XML errors of the internal XML parser | ||
139 | * | ||
140 | * @param Boolean $internalErrors | ||
141 | * | ||
142 | * @return array An array of errors | ||
143 | */ | ||
144 | private function getXmlErrors($internalErrors) | ||
145 | { | ||
146 | $errors = array(); | ||
147 | foreach (libxml_get_errors() as $error) { | ||
148 | $errors[] = sprintf('[%s %s] %s (in %s - line %d, column %d)', | ||
149 | LIBXML_ERR_WARNING == $error->level ? 'WARNING' : 'ERROR', | ||
150 | $error->code, | ||
151 | trim($error->message), | ||
152 | $error->file ? $error->file : 'n/a', | ||
153 | $error->line, | ||
154 | $error->column | ||
155 | ); | ||
156 | } | ||
157 | |||
158 | libxml_clear_errors(); | ||
159 | libxml_use_internal_errors($internalErrors); | ||
160 | |||
161 | return $errors; | ||
162 | } | ||
163 | } | ||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Loader/YamlFileLoader.php b/vendor/symfony/translation/Symfony/Component/Translation/Loader/YamlFileLoader.php deleted file mode 100644 index 66ab2ba5..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/Loader/YamlFileLoader.php +++ /dev/null | |||
@@ -1,71 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of the Symfony package. | ||
5 | * | ||
6 | * (c) Fabien Potencier <fabien@symfony.com> | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | namespace Symfony\Component\Translation\Loader; | ||
13 | |||
14 | use Symfony\Component\Translation\Exception\InvalidResourceException; | ||
15 | use Symfony\Component\Translation\Exception\NotFoundResourceException; | ||
16 | use Symfony\Component\Config\Resource\FileResource; | ||
17 | use Symfony\Component\Yaml\Parser as YamlParser; | ||
18 | use Symfony\Component\Yaml\Exception\ParseException; | ||
19 | |||
20 | /** | ||
21 | * YamlFileLoader loads translations from Yaml files. | ||
22 | * | ||
23 | * @author Fabien Potencier <fabien@symfony.com> | ||
24 | * | ||
25 | * @api | ||
26 | */ | ||
27 | class YamlFileLoader extends ArrayLoader implements LoaderInterface | ||
28 | { | ||
29 | private $yamlParser; | ||
30 | |||
31 | /** | ||
32 | * {@inheritdoc} | ||
33 | * | ||
34 | * @api | ||
35 | */ | ||
36 | public function load($resource, $locale, $domain = 'messages') | ||
37 | { | ||
38 | if (!stream_is_local($resource)) { | ||
39 | throw new InvalidResourceException(sprintf('This is not a local file "%s".', $resource)); | ||
40 | } | ||
41 | |||
42 | if (!file_exists($resource)) { | ||
43 | throw new NotFoundResourceException(sprintf('File "%s" not found.', $resource)); | ||
44 | } | ||
45 | |||
46 | if (null === $this->yamlParser) { | ||
47 | $this->yamlParser = new YamlParser(); | ||
48 | } | ||
49 | |||
50 | try { | ||
51 | $messages = $this->yamlParser->parse(file_get_contents($resource)); | ||
52 | } catch (ParseException $e) { | ||
53 | throw new InvalidResourceException('Error parsing YAML.', 0, $e); | ||
54 | } | ||
55 | |||
56 | // empty file | ||
57 | if (null === $messages) { | ||
58 | $messages = array(); | ||
59 | } | ||
60 | |||
61 | // not an array | ||
62 | if (!is_array($messages)) { | ||
63 | throw new InvalidResourceException(sprintf('The file "%s" must contain a YAML array.', $resource)); | ||
64 | } | ||
65 | |||
66 | $catalogue = parent::load($messages, $locale, $domain); | ||
67 | $catalogue->addResource(new FileResource($resource)); | ||
68 | |||
69 | return $catalogue; | ||
70 | } | ||
71 | } | ||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Loader/schema/dic/xliff-core/xliff-core-1.2-strict.xsd b/vendor/symfony/translation/Symfony/Component/Translation/Loader/schema/dic/xliff-core/xliff-core-1.2-strict.xsd deleted file mode 100644 index 3ce2a8e8..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/Loader/schema/dic/xliff-core/xliff-core-1.2-strict.xsd +++ /dev/null | |||
@@ -1,2223 +0,0 @@ | |||
1 | <?xml version="1.0" encoding="UTF-8"?> | ||
2 | |||
3 | <!-- | ||
4 | |||
5 | May-19-2004: | ||
6 | - Changed the <choice> for ElemType_header, moving minOccurs="0" maxOccurs="unbounded" from its elements | ||
7 | to <choice> itself. | ||
8 | - Added <choice> for ElemType_trans-unit to allow "any order" for <context-group>, <count-group>, <prop-group>, <note>, and | ||
9 | <alt-trans>. | ||
10 | |||
11 | Oct-2005 | ||
12 | - updated version info to 1.2 | ||
13 | - equiv-trans attribute to <trans-unit> element | ||
14 | - merged-trans attribute for <group> element | ||
15 | - Add the <seg-source> element as optional in the <trans-unit> and <alt-trans> content models, at the same level as <source> | ||
16 | - Create a new value "seg" for the mtype attribute of the <mrk> element | ||
17 | - Add mid as an optional attribute for the <alt-trans> element | ||
18 | |||
19 | Nov-14-2005 | ||
20 | - Changed name attribute for <context-group> from required to optional | ||
21 | - Added extension point at <xliff> | ||
22 | |||
23 | Jan-9-2006 | ||
24 | - Added alttranstype type attribute to <alt-trans>, and values | ||
25 | |||
26 | Jan-10-2006 | ||
27 | - Corrected error with overwritten purposeValueList | ||
28 | - Corrected name="AttrType_Version", attribute should have been "name" | ||
29 | |||
30 | --> | ||
31 | <xsd:schema xmlns:xlf="urn:oasis:names:tc:xliff:document:1.2" xmlns:xsd="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="urn:oasis:names:tc:xliff:document:1.2" xml:lang="en"> | ||
32 | <!-- Import for xml:lang and xml:space --> | ||
33 | <xsd:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2001/xml.xsd"/> | ||
34 | <!-- Attributes Lists --> | ||
35 | <xsd:simpleType name="XTend"> | ||
36 | <xsd:restriction base="xsd:string"> | ||
37 | <xsd:pattern value="x-[^\s]+"/> | ||
38 | </xsd:restriction> | ||
39 | </xsd:simpleType> | ||
40 | <xsd:simpleType name="context-typeValueList"> | ||
41 | <xsd:annotation> | ||
42 | <xsd:documentation>Values for the attribute 'context-type'.</xsd:documentation> | ||
43 | </xsd:annotation> | ||
44 | <xsd:restriction base="xsd:string"> | ||
45 | <xsd:enumeration value="database"> | ||
46 | <xsd:annotation> | ||
47 | <xsd:documentation>Indicates a database content.</xsd:documentation> | ||
48 | </xsd:annotation> | ||
49 | </xsd:enumeration> | ||
50 | <xsd:enumeration value="element"> | ||
51 | <xsd:annotation> | ||
52 | <xsd:documentation>Indicates the content of an element within an XML document.</xsd:documentation> | ||
53 | </xsd:annotation> | ||
54 | </xsd:enumeration> | ||
55 | <xsd:enumeration value="elementtitle"> | ||
56 | <xsd:annotation> | ||
57 | <xsd:documentation>Indicates the name of an element within an XML document.</xsd:documentation> | ||
58 | </xsd:annotation> | ||
59 | </xsd:enumeration> | ||
60 | <xsd:enumeration value="linenumber"> | ||
61 | <xsd:annotation> | ||
62 | <xsd:documentation>Indicates the line number from the sourcefile (see context-type="sourcefile") where the <source> is found.</xsd:documentation> | ||
63 | </xsd:annotation> | ||
64 | </xsd:enumeration> | ||
65 | <xsd:enumeration value="numparams"> | ||
66 | <xsd:annotation> | ||
67 | <xsd:documentation>Indicates a the number of parameters contained within the <source>.</xsd:documentation> | ||
68 | </xsd:annotation> | ||
69 | </xsd:enumeration> | ||
70 | <xsd:enumeration value="paramnotes"> | ||
71 | <xsd:annotation> | ||
72 | <xsd:documentation>Indicates notes pertaining to the parameters in the <source>.</xsd:documentation> | ||
73 | </xsd:annotation> | ||
74 | </xsd:enumeration> | ||
75 | <xsd:enumeration value="record"> | ||
76 | <xsd:annotation> | ||
77 | <xsd:documentation>Indicates the content of a record within a database.</xsd:documentation> | ||
78 | </xsd:annotation> | ||
79 | </xsd:enumeration> | ||
80 | <xsd:enumeration value="recordtitle"> | ||
81 | <xsd:annotation> | ||
82 | <xsd:documentation>Indicates the name of a record within a database.</xsd:documentation> | ||
83 | </xsd:annotation> | ||
84 | </xsd:enumeration> | ||
85 | <xsd:enumeration value="sourcefile"> | ||
86 | <xsd:annotation> | ||
87 | <xsd:documentation>Indicates the original source file in the case that multiple files are merged to form the original file from which the XLIFF file is created. This differs from the original <file> attribute in that this sourcefile is one of many that make up that file.</xsd:documentation> | ||
88 | </xsd:annotation> | ||
89 | </xsd:enumeration> | ||
90 | </xsd:restriction> | ||
91 | </xsd:simpleType> | ||
92 | <xsd:simpleType name="count-typeValueList"> | ||
93 | <xsd:annotation> | ||
94 | <xsd:documentation>Values for the attribute 'count-type'.</xsd:documentation> | ||
95 | </xsd:annotation> | ||
96 | <xsd:restriction base="xsd:NMTOKEN"> | ||
97 | <xsd:enumeration value="num-usages"> | ||
98 | <xsd:annotation> | ||
99 | <xsd:documentation>Indicates the count units are items that are used X times in a certain context; example: this is a reusable text unit which is used 42 times in other texts.</xsd:documentation> | ||
100 | </xsd:annotation> | ||
101 | </xsd:enumeration> | ||
102 | <xsd:enumeration value="repetition"> | ||
103 | <xsd:annotation> | ||
104 | <xsd:documentation>Indicates the count units are translation units existing already in the same document.</xsd:documentation> | ||
105 | </xsd:annotation> | ||
106 | </xsd:enumeration> | ||
107 | <xsd:enumeration value="total"> | ||
108 | <xsd:annotation> | ||
109 | <xsd:documentation>Indicates a total count.</xsd:documentation> | ||
110 | </xsd:annotation> | ||
111 | </xsd:enumeration> | ||
112 | </xsd:restriction> | ||
113 | </xsd:simpleType> | ||
114 | <xsd:simpleType name="InlineDelimitersValueList"> | ||
115 | <xsd:annotation> | ||
116 | <xsd:documentation>Values for the attribute 'ctype' when used other elements than <ph> or <x>.</xsd:documentation> | ||
117 | </xsd:annotation> | ||
118 | <xsd:restriction base="xsd:NMTOKEN"> | ||
119 | <xsd:enumeration value="bold"> | ||
120 | <xsd:annotation> | ||
121 | <xsd:documentation>Indicates a run of bolded text.</xsd:documentation> | ||
122 | </xsd:annotation> | ||
123 | </xsd:enumeration> | ||
124 | <xsd:enumeration value="italic"> | ||
125 | <xsd:annotation> | ||
126 | <xsd:documentation>Indicates a run of text in italics.</xsd:documentation> | ||
127 | </xsd:annotation> | ||
128 | </xsd:enumeration> | ||
129 | <xsd:enumeration value="underlined"> | ||
130 | <xsd:annotation> | ||
131 | <xsd:documentation>Indicates a run of underlined text.</xsd:documentation> | ||
132 | </xsd:annotation> | ||
133 | </xsd:enumeration> | ||
134 | <xsd:enumeration value="link"> | ||
135 | <xsd:annotation> | ||
136 | <xsd:documentation>Indicates a run of hyper-text.</xsd:documentation> | ||
137 | </xsd:annotation> | ||
138 | </xsd:enumeration> | ||
139 | </xsd:restriction> | ||
140 | </xsd:simpleType> | ||
141 | <xsd:simpleType name="InlinePlaceholdersValueList"> | ||
142 | <xsd:annotation> | ||
143 | <xsd:documentation>Values for the attribute 'ctype' when used with <ph> or <x>.</xsd:documentation> | ||
144 | </xsd:annotation> | ||
145 | <xsd:restriction base="xsd:NMTOKEN"> | ||
146 | <xsd:enumeration value="image"> | ||
147 | <xsd:annotation> | ||
148 | <xsd:documentation>Indicates a inline image.</xsd:documentation> | ||
149 | </xsd:annotation> | ||
150 | </xsd:enumeration> | ||
151 | <xsd:enumeration value="pb"> | ||
152 | <xsd:annotation> | ||
153 | <xsd:documentation>Indicates a page break.</xsd:documentation> | ||
154 | </xsd:annotation> | ||
155 | </xsd:enumeration> | ||
156 | <xsd:enumeration value="lb"> | ||
157 | <xsd:annotation> | ||
158 | <xsd:documentation>Indicates a line break.</xsd:documentation> | ||
159 | </xsd:annotation> | ||
160 | </xsd:enumeration> | ||
161 | </xsd:restriction> | ||
162 | </xsd:simpleType> | ||
163 | <xsd:simpleType name="mime-typeValueList"> | ||
164 | <xsd:restriction base="xsd:string"> | ||
165 | <xsd:pattern value="(text|multipart|message|application|image|audio|video|model)(/.+)*"/> | ||
166 | </xsd:restriction> | ||
167 | </xsd:simpleType> | ||
168 | <xsd:simpleType name="datatypeValueList"> | ||
169 | <xsd:annotation> | ||
170 | <xsd:documentation>Values for the attribute 'datatype'.</xsd:documentation> | ||
171 | </xsd:annotation> | ||
172 | <xsd:restriction base="xsd:NMTOKEN"> | ||
173 | <xsd:enumeration value="asp"> | ||
174 | <xsd:annotation> | ||
175 | <xsd:documentation>Indicates Active Server Page data.</xsd:documentation> | ||
176 | </xsd:annotation> | ||
177 | </xsd:enumeration> | ||
178 | <xsd:enumeration value="c"> | ||
179 | <xsd:annotation> | ||
180 | <xsd:documentation>Indicates C source file data.</xsd:documentation> | ||
181 | </xsd:annotation> | ||
182 | </xsd:enumeration> | ||
183 | <xsd:enumeration value="cdf"> | ||
184 | <xsd:annotation> | ||
185 | <xsd:documentation>Indicates Channel Definition Format (CDF) data.</xsd:documentation> | ||
186 | </xsd:annotation> | ||
187 | </xsd:enumeration> | ||
188 | <xsd:enumeration value="cfm"> | ||
189 | <xsd:annotation> | ||
190 | <xsd:documentation>Indicates ColdFusion data.</xsd:documentation> | ||
191 | </xsd:annotation> | ||
192 | </xsd:enumeration> | ||
193 | <xsd:enumeration value="cpp"> | ||
194 | <xsd:annotation> | ||
195 | <xsd:documentation>Indicates C++ source file data.</xsd:documentation> | ||
196 | </xsd:annotation> | ||
197 | </xsd:enumeration> | ||
198 | <xsd:enumeration value="csharp"> | ||
199 | <xsd:annotation> | ||
200 | <xsd:documentation>Indicates C-Sharp data.</xsd:documentation> | ||
201 | </xsd:annotation> | ||
202 | </xsd:enumeration> | ||
203 | <xsd:enumeration value="cstring"> | ||
204 | <xsd:annotation> | ||
205 | <xsd:documentation>Indicates strings from C, ASM, and driver files data.</xsd:documentation> | ||
206 | </xsd:annotation> | ||
207 | </xsd:enumeration> | ||
208 | <xsd:enumeration value="csv"> | ||
209 | <xsd:annotation> | ||
210 | <xsd:documentation>Indicates comma-separated values data.</xsd:documentation> | ||
211 | </xsd:annotation> | ||
212 | </xsd:enumeration> | ||
213 | <xsd:enumeration value="database"> | ||
214 | <xsd:annotation> | ||
215 | <xsd:documentation>Indicates database data.</xsd:documentation> | ||
216 | </xsd:annotation> | ||
217 | </xsd:enumeration> | ||
218 | <xsd:enumeration value="documentfooter"> | ||
219 | <xsd:annotation> | ||
220 | <xsd:documentation>Indicates portions of document that follows data and contains metadata.</xsd:documentation> | ||
221 | </xsd:annotation> | ||
222 | </xsd:enumeration> | ||
223 | <xsd:enumeration value="documentheader"> | ||
224 | <xsd:annotation> | ||
225 | <xsd:documentation>Indicates portions of document that precedes data and contains metadata.</xsd:documentation> | ||
226 | </xsd:annotation> | ||
227 | </xsd:enumeration> | ||
228 | <xsd:enumeration value="filedialog"> | ||
229 | <xsd:annotation> | ||
230 | <xsd:documentation>Indicates data from standard UI file operations dialogs (e.g., Open, Save, Save As, Export, Import).</xsd:documentation> | ||
231 | </xsd:annotation> | ||
232 | </xsd:enumeration> | ||
233 | <xsd:enumeration value="form"> | ||
234 | <xsd:annotation> | ||
235 | <xsd:documentation>Indicates standard user input screen data.</xsd:documentation> | ||
236 | </xsd:annotation> | ||
237 | </xsd:enumeration> | ||
238 | <xsd:enumeration value="html"> | ||
239 | <xsd:annotation> | ||
240 | <xsd:documentation>Indicates HyperText Markup Language (HTML) data - document instance.</xsd:documentation> | ||
241 | </xsd:annotation> | ||
242 | </xsd:enumeration> | ||
243 | <xsd:enumeration value="htmlbody"> | ||
244 | <xsd:annotation> | ||
245 | <xsd:documentation>Indicates content within an HTML document’s <body> element.</xsd:documentation> | ||
246 | </xsd:annotation> | ||
247 | </xsd:enumeration> | ||
248 | <xsd:enumeration value="ini"> | ||
249 | <xsd:annotation> | ||
250 | <xsd:documentation>Indicates Windows INI file data.</xsd:documentation> | ||
251 | </xsd:annotation> | ||
252 | </xsd:enumeration> | ||
253 | <xsd:enumeration value="interleaf"> | ||
254 | <xsd:annotation> | ||
255 | <xsd:documentation>Indicates Interleaf data.</xsd:documentation> | ||
256 | </xsd:annotation> | ||
257 | </xsd:enumeration> | ||
258 | <xsd:enumeration value="javaclass"> | ||
259 | <xsd:annotation> | ||
260 | <xsd:documentation>Indicates Java source file data (extension '.java').</xsd:documentation> | ||
261 | </xsd:annotation> | ||
262 | </xsd:enumeration> | ||
263 | <xsd:enumeration value="javapropertyresourcebundle"> | ||
264 | <xsd:annotation> | ||
265 | <xsd:documentation>Indicates Java property resource bundle data.</xsd:documentation> | ||
266 | </xsd:annotation> | ||
267 | </xsd:enumeration> | ||
268 | <xsd:enumeration value="javalistresourcebundle"> | ||
269 | <xsd:annotation> | ||
270 | <xsd:documentation>Indicates Java list resource bundle data.</xsd:documentation> | ||
271 | </xsd:annotation> | ||
272 | </xsd:enumeration> | ||
273 | <xsd:enumeration value="javascript"> | ||
274 | <xsd:annotation> | ||
275 | <xsd:documentation>Indicates JavaScript source file data.</xsd:documentation> | ||
276 | </xsd:annotation> | ||
277 | </xsd:enumeration> | ||
278 | <xsd:enumeration value="jscript"> | ||
279 | <xsd:annotation> | ||
280 | <xsd:documentation>Indicates JScript source file data.</xsd:documentation> | ||
281 | </xsd:annotation> | ||
282 | </xsd:enumeration> | ||
283 | <xsd:enumeration value="layout"> | ||
284 | <xsd:annotation> | ||
285 | <xsd:documentation>Indicates information relating to formatting.</xsd:documentation> | ||
286 | </xsd:annotation> | ||
287 | </xsd:enumeration> | ||
288 | <xsd:enumeration value="lisp"> | ||
289 | <xsd:annotation> | ||
290 | <xsd:documentation>Indicates LISP source file data.</xsd:documentation> | ||
291 | </xsd:annotation> | ||
292 | </xsd:enumeration> | ||
293 | <xsd:enumeration value="margin"> | ||
294 | <xsd:annotation> | ||
295 | <xsd:documentation>Indicates information relating to margin formats.</xsd:documentation> | ||
296 | </xsd:annotation> | ||
297 | </xsd:enumeration> | ||
298 | <xsd:enumeration value="menufile"> | ||
299 | <xsd:annotation> | ||
300 | <xsd:documentation>Indicates a file containing menu.</xsd:documentation> | ||
301 | </xsd:annotation> | ||
302 | </xsd:enumeration> | ||
303 | <xsd:enumeration value="messagefile"> | ||
304 | <xsd:annotation> | ||
305 | <xsd:documentation>Indicates numerically identified string table.</xsd:documentation> | ||
306 | </xsd:annotation> | ||
307 | </xsd:enumeration> | ||
308 | <xsd:enumeration value="mif"> | ||
309 | <xsd:annotation> | ||
310 | <xsd:documentation>Indicates Maker Interchange Format (MIF) data.</xsd:documentation> | ||
311 | </xsd:annotation> | ||
312 | </xsd:enumeration> | ||
313 | <xsd:enumeration value="mimetype"> | ||
314 | <xsd:annotation> | ||
315 | <xsd:documentation>Indicates that the datatype attribute value is a MIME Type value and is defined in the mime-type attribute.</xsd:documentation> | ||
316 | </xsd:annotation> | ||
317 | </xsd:enumeration> | ||
318 | <xsd:enumeration value="mo"> | ||
319 | <xsd:annotation> | ||
320 | <xsd:documentation>Indicates GNU Machine Object data.</xsd:documentation> | ||
321 | </xsd:annotation> | ||
322 | </xsd:enumeration> | ||
323 | <xsd:enumeration value="msglib"> | ||
324 | <xsd:annotation> | ||
325 | <xsd:documentation>Indicates Message Librarian strings created by Novell's Message Librarian Tool.</xsd:documentation> | ||
326 | </xsd:annotation> | ||
327 | </xsd:enumeration> | ||
328 | <xsd:enumeration value="pagefooter"> | ||
329 | <xsd:annotation> | ||
330 | <xsd:documentation>Indicates information to be displayed at the bottom of each page of a document.</xsd:documentation> | ||
331 | </xsd:annotation> | ||
332 | </xsd:enumeration> | ||
333 | <xsd:enumeration value="pageheader"> | ||
334 | <xsd:annotation> | ||
335 | <xsd:documentation>Indicates information to be displayed at the top of each page of a document.</xsd:documentation> | ||
336 | </xsd:annotation> | ||
337 | </xsd:enumeration> | ||
338 | <xsd:enumeration value="parameters"> | ||
339 | <xsd:annotation> | ||
340 | <xsd:documentation>Indicates a list of property values (e.g., settings within INI files or preferences dialog).</xsd:documentation> | ||
341 | </xsd:annotation> | ||
342 | </xsd:enumeration> | ||
343 | <xsd:enumeration value="pascal"> | ||
344 | <xsd:annotation> | ||
345 | <xsd:documentation>Indicates Pascal source file data.</xsd:documentation> | ||
346 | </xsd:annotation> | ||
347 | </xsd:enumeration> | ||
348 | <xsd:enumeration value="php"> | ||
349 | <xsd:annotation> | ||
350 | <xsd:documentation>Indicates Hypertext Preprocessor data.</xsd:documentation> | ||
351 | </xsd:annotation> | ||
352 | </xsd:enumeration> | ||
353 | <xsd:enumeration value="plaintext"> | ||
354 | <xsd:annotation> | ||
355 | <xsd:documentation>Indicates plain text file (no formatting other than, possibly, wrapping).</xsd:documentation> | ||
356 | </xsd:annotation> | ||
357 | </xsd:enumeration> | ||
358 | <xsd:enumeration value="po"> | ||
359 | <xsd:annotation> | ||
360 | <xsd:documentation>Indicates GNU Portable Object file.</xsd:documentation> | ||
361 | </xsd:annotation> | ||
362 | </xsd:enumeration> | ||
363 | <xsd:enumeration value="report"> | ||
364 | <xsd:annotation> | ||
365 | <xsd:documentation>Indicates dynamically generated user defined document. e.g. Oracle Report, Crystal Report, etc.</xsd:documentation> | ||
366 | </xsd:annotation> | ||
367 | </xsd:enumeration> | ||
368 | <xsd:enumeration value="resources"> | ||
369 | <xsd:annotation> | ||
370 | <xsd:documentation>Indicates Windows .NET binary resources.</xsd:documentation> | ||
371 | </xsd:annotation> | ||
372 | </xsd:enumeration> | ||
373 | <xsd:enumeration value="resx"> | ||
374 | <xsd:annotation> | ||
375 | <xsd:documentation>Indicates Windows .NET Resources.</xsd:documentation> | ||
376 | </xsd:annotation> | ||
377 | </xsd:enumeration> | ||
378 | <xsd:enumeration value="rtf"> | ||
379 | <xsd:annotation> | ||
380 | <xsd:documentation>Indicates Rich Text Format (RTF) data.</xsd:documentation> | ||
381 | </xsd:annotation> | ||
382 | </xsd:enumeration> | ||
383 | <xsd:enumeration value="sgml"> | ||
384 | <xsd:annotation> | ||
385 | <xsd:documentation>Indicates Standard Generalized Markup Language (SGML) data - document instance.</xsd:documentation> | ||
386 | </xsd:annotation> | ||
387 | </xsd:enumeration> | ||
388 | <xsd:enumeration value="sgmldtd"> | ||
389 | <xsd:annotation> | ||
390 | <xsd:documentation>Indicates Standard Generalized Markup Language (SGML) data - Document Type Definition (DTD).</xsd:documentation> | ||
391 | </xsd:annotation> | ||
392 | </xsd:enumeration> | ||
393 | <xsd:enumeration value="svg"> | ||
394 | <xsd:annotation> | ||
395 | <xsd:documentation>Indicates Scalable Vector Graphic (SVG) data.</xsd:documentation> | ||
396 | </xsd:annotation> | ||
397 | </xsd:enumeration> | ||
398 | <xsd:enumeration value="vbscript"> | ||
399 | <xsd:annotation> | ||
400 | <xsd:documentation>Indicates VisualBasic Script source file.</xsd:documentation> | ||
401 | </xsd:annotation> | ||
402 | </xsd:enumeration> | ||
403 | <xsd:enumeration value="warning"> | ||
404 | <xsd:annotation> | ||
405 | <xsd:documentation>Indicates warning message.</xsd:documentation> | ||
406 | </xsd:annotation> | ||
407 | </xsd:enumeration> | ||
408 | <xsd:enumeration value="winres"> | ||
409 | <xsd:annotation> | ||
410 | <xsd:documentation>Indicates Windows (Win32) resources (i.e. resources extracted from an RC script, a message file, or a compiled file).</xsd:documentation> | ||
411 | </xsd:annotation> | ||
412 | </xsd:enumeration> | ||
413 | <xsd:enumeration value="xhtml"> | ||
414 | <xsd:annotation> | ||
415 | <xsd:documentation>Indicates Extensible HyperText Markup Language (XHTML) data - document instance.</xsd:documentation> | ||
416 | </xsd:annotation> | ||
417 | </xsd:enumeration> | ||
418 | <xsd:enumeration value="xml"> | ||
419 | <xsd:annotation> | ||
420 | <xsd:documentation>Indicates Extensible Markup Language (XML) data - document instance.</xsd:documentation> | ||
421 | </xsd:annotation> | ||
422 | </xsd:enumeration> | ||
423 | <xsd:enumeration value="xmldtd"> | ||
424 | <xsd:annotation> | ||
425 | <xsd:documentation>Indicates Extensible Markup Language (XML) data - Document Type Definition (DTD).</xsd:documentation> | ||
426 | </xsd:annotation> | ||
427 | </xsd:enumeration> | ||
428 | <xsd:enumeration value="xsl"> | ||
429 | <xsd:annotation> | ||
430 | <xsd:documentation>Indicates Extensible Stylesheet Language (XSL) data.</xsd:documentation> | ||
431 | </xsd:annotation> | ||
432 | </xsd:enumeration> | ||
433 | <xsd:enumeration value="xul"> | ||
434 | <xsd:annotation> | ||
435 | <xsd:documentation>Indicates XUL elements.</xsd:documentation> | ||
436 | </xsd:annotation> | ||
437 | </xsd:enumeration> | ||
438 | </xsd:restriction> | ||
439 | </xsd:simpleType> | ||
440 | <xsd:simpleType name="mtypeValueList"> | ||
441 | <xsd:annotation> | ||
442 | <xsd:documentation>Values for the attribute 'mtype'.</xsd:documentation> | ||
443 | </xsd:annotation> | ||
444 | <xsd:restriction base="xsd:NMTOKEN"> | ||
445 | <xsd:enumeration value="abbrev"> | ||
446 | <xsd:annotation> | ||
447 | <xsd:documentation>Indicates the marked text is an abbreviation.</xsd:documentation> | ||
448 | </xsd:annotation> | ||
449 | </xsd:enumeration> | ||
450 | <xsd:enumeration value="abbreviated-form"> | ||
451 | <xsd:annotation> | ||
452 | <xsd:documentation>ISO-12620 2.1.8: A term resulting from the omission of any part of the full term while designating the same concept.</xsd:documentation> | ||
453 | </xsd:annotation> | ||
454 | </xsd:enumeration> | ||
455 | <xsd:enumeration value="abbreviation"> | ||
456 | <xsd:annotation> | ||
457 | <xsd:documentation>ISO-12620 2.1.8.1: An abbreviated form of a simple term resulting from the omission of some of its letters (e.g. 'adj.' for 'adjective').</xsd:documentation> | ||
458 | </xsd:annotation> | ||
459 | </xsd:enumeration> | ||
460 | <xsd:enumeration value="acronym"> | ||
461 | <xsd:annotation> | ||
462 | <xsd:documentation>ISO-12620 2.1.8.4: An abbreviated form of a term made up of letters from the full form of a multiword term strung together into a sequence pronounced only syllabically (e.g. 'radar' for 'radio detecting and ranging').</xsd:documentation> | ||
463 | </xsd:annotation> | ||
464 | </xsd:enumeration> | ||
465 | <xsd:enumeration value="appellation"> | ||
466 | <xsd:annotation> | ||
467 | <xsd:documentation>ISO-12620: A proper-name term, such as the name of an agency or other proper entity.</xsd:documentation> | ||
468 | </xsd:annotation> | ||
469 | </xsd:enumeration> | ||
470 | <xsd:enumeration value="collocation"> | ||
471 | <xsd:annotation> | ||
472 | <xsd:documentation>ISO-12620 2.1.18.1: A recurrent word combination characterized by cohesion in that the components of the collocation must co-occur within an utterance or series of utterances, even though they do not necessarily have to maintain immediate proximity to one another.</xsd:documentation> | ||
473 | </xsd:annotation> | ||
474 | </xsd:enumeration> | ||
475 | <xsd:enumeration value="common-name"> | ||
476 | <xsd:annotation> | ||
477 | <xsd:documentation>ISO-12620 2.1.5: A synonym for an international scientific term that is used in general discourse in a given language.</xsd:documentation> | ||
478 | </xsd:annotation> | ||
479 | </xsd:enumeration> | ||
480 | <xsd:enumeration value="datetime"> | ||
481 | <xsd:annotation> | ||
482 | <xsd:documentation>Indicates the marked text is a date and/or time.</xsd:documentation> | ||
483 | </xsd:annotation> | ||
484 | </xsd:enumeration> | ||
485 | <xsd:enumeration value="equation"> | ||
486 | <xsd:annotation> | ||
487 | <xsd:documentation>ISO-12620 2.1.15: An expression used to represent a concept based on a statement that two mathematical expressions are, for instance, equal as identified by the equal sign (=), or assigned to one another by a similar sign.</xsd:documentation> | ||
488 | </xsd:annotation> | ||
489 | </xsd:enumeration> | ||
490 | <xsd:enumeration value="expanded-form"> | ||
491 | <xsd:annotation> | ||
492 | <xsd:documentation>ISO-12620 2.1.7: The complete representation of a term for which there is an abbreviated form.</xsd:documentation> | ||
493 | </xsd:annotation> | ||
494 | </xsd:enumeration> | ||
495 | <xsd:enumeration value="formula"> | ||
496 | <xsd:annotation> | ||
497 | <xsd:documentation>ISO-12620 2.1.14: Figures, symbols or the like used to express a concept briefly, such as a mathematical or chemical formula.</xsd:documentation> | ||
498 | </xsd:annotation> | ||
499 | </xsd:enumeration> | ||
500 | <xsd:enumeration value="head-term"> | ||
501 | <xsd:annotation> | ||
502 | <xsd:documentation>ISO-12620 2.1.1: The concept designation that has been chosen to head a terminological record.</xsd:documentation> | ||
503 | </xsd:annotation> | ||
504 | </xsd:enumeration> | ||
505 | <xsd:enumeration value="initialism"> | ||
506 | <xsd:annotation> | ||
507 | <xsd:documentation>ISO-12620 2.1.8.3: An abbreviated form of a term consisting of some of the initial letters of the words making up a multiword term or the term elements making up a compound term when these letters are pronounced individually (e.g. 'BSE' for 'bovine spongiform encephalopathy').</xsd:documentation> | ||
508 | </xsd:annotation> | ||
509 | </xsd:enumeration> | ||
510 | <xsd:enumeration value="international-scientific-term"> | ||
511 | <xsd:annotation> | ||
512 | <xsd:documentation>ISO-12620 2.1.4: A term that is part of an international scientific nomenclature as adopted by an appropriate scientific body.</xsd:documentation> | ||
513 | </xsd:annotation> | ||
514 | </xsd:enumeration> | ||
515 | <xsd:enumeration value="internationalism"> | ||
516 | <xsd:annotation> | ||
517 | <xsd:documentation>ISO-12620 2.1.6: A term that has the same or nearly identical orthographic or phonemic form in many languages.</xsd:documentation> | ||
518 | </xsd:annotation> | ||
519 | </xsd:enumeration> | ||
520 | <xsd:enumeration value="logical-expression"> | ||
521 | <xsd:annotation> | ||
522 | <xsd:documentation>ISO-12620 2.1.16: An expression used to represent a concept based on mathematical or logical relations, such as statements of inequality, set relationships, Boolean operations, and the like.</xsd:documentation> | ||
523 | </xsd:annotation> | ||
524 | </xsd:enumeration> | ||
525 | <xsd:enumeration value="materials-management-unit"> | ||
526 | <xsd:annotation> | ||
527 | <xsd:documentation>ISO-12620 2.1.17: A unit to track object.</xsd:documentation> | ||
528 | </xsd:annotation> | ||
529 | </xsd:enumeration> | ||
530 | <xsd:enumeration value="name"> | ||
531 | <xsd:annotation> | ||
532 | <xsd:documentation>Indicates the marked text is a name.</xsd:documentation> | ||
533 | </xsd:annotation> | ||
534 | </xsd:enumeration> | ||
535 | <xsd:enumeration value="near-synonym"> | ||
536 | <xsd:annotation> | ||
537 | <xsd:documentation>ISO-12620 2.1.3: A term that represents the same or a very similar concept as another term in the same language, but for which interchangeability is limited to some contexts and inapplicable in others.</xsd:documentation> | ||
538 | </xsd:annotation> | ||
539 | </xsd:enumeration> | ||
540 | <xsd:enumeration value="part-number"> | ||
541 | <xsd:annotation> | ||
542 | <xsd:documentation>ISO-12620 2.1.17.2: A unique alphanumeric designation assigned to an object in a manufacturing system.</xsd:documentation> | ||
543 | </xsd:annotation> | ||
544 | </xsd:enumeration> | ||
545 | <xsd:enumeration value="phrase"> | ||
546 | <xsd:annotation> | ||
547 | <xsd:documentation>Indicates the marked text is a phrase.</xsd:documentation> | ||
548 | </xsd:annotation> | ||
549 | </xsd:enumeration> | ||
550 | <xsd:enumeration value="phraseological-unit"> | ||
551 | <xsd:annotation> | ||
552 | <xsd:documentation>ISO-12620 2.1.18: Any group of two or more words that form a unit, the meaning of which frequently cannot be deduced based on the combined sense of the words making up the phrase.</xsd:documentation> | ||
553 | </xsd:annotation> | ||
554 | </xsd:enumeration> | ||
555 | <xsd:enumeration value="protected"> | ||
556 | <xsd:annotation> | ||
557 | <xsd:documentation>Indicates the marked text should not be translated.</xsd:documentation> | ||
558 | </xsd:annotation> | ||
559 | </xsd:enumeration> | ||
560 | <xsd:enumeration value="romanized-form"> | ||
561 | <xsd:annotation> | ||
562 | <xsd:documentation>ISO-12620 2.1.12: A form of a term resulting from an operation whereby non-Latin writing systems are converted to the Latin alphabet.</xsd:documentation> | ||
563 | </xsd:annotation> | ||
564 | </xsd:enumeration> | ||
565 | <xsd:enumeration value="seg"> | ||
566 | <xsd:annotation> | ||
567 | <xsd:documentation>Indicates that the marked text represents a segment.</xsd:documentation> | ||
568 | </xsd:annotation> | ||
569 | </xsd:enumeration> | ||
570 | <xsd:enumeration value="set-phrase"> | ||
571 | <xsd:annotation> | ||
572 | <xsd:documentation>ISO-12620 2.1.18.2: A fixed, lexicalized phrase.</xsd:documentation> | ||
573 | </xsd:annotation> | ||
574 | </xsd:enumeration> | ||
575 | <xsd:enumeration value="short-form"> | ||
576 | <xsd:annotation> | ||
577 | <xsd:documentation>ISO-12620 2.1.8.2: A variant of a multiword term that includes fewer words than the full form of the term (e.g. 'Group of Twenty-four' for 'Intergovernmental Group of Twenty-four on International Monetary Affairs').</xsd:documentation> | ||
578 | </xsd:annotation> | ||
579 | </xsd:enumeration> | ||
580 | <xsd:enumeration value="sku"> | ||
581 | <xsd:annotation> | ||
582 | <xsd:documentation>ISO-12620 2.1.17.1: Stock keeping unit, an inventory item identified by a unique alphanumeric designation assigned to an object in an inventory control system.</xsd:documentation> | ||
583 | </xsd:annotation> | ||
584 | </xsd:enumeration> | ||
585 | <xsd:enumeration value="standard-text"> | ||
586 | <xsd:annotation> | ||
587 | <xsd:documentation>ISO-12620 2.1.19: A fixed chunk of recurring text.</xsd:documentation> | ||
588 | </xsd:annotation> | ||
589 | </xsd:enumeration> | ||
590 | <xsd:enumeration value="symbol"> | ||
591 | <xsd:annotation> | ||
592 | <xsd:documentation>ISO-12620 2.1.13: A designation of a concept by letters, numerals, pictograms or any combination thereof.</xsd:documentation> | ||
593 | </xsd:annotation> | ||
594 | </xsd:enumeration> | ||
595 | <xsd:enumeration value="synonym"> | ||
596 | <xsd:annotation> | ||
597 | <xsd:documentation>ISO-12620 2.1.2: Any term that represents the same or a very similar concept as the main entry term in a term entry.</xsd:documentation> | ||
598 | </xsd:annotation> | ||
599 | </xsd:enumeration> | ||
600 | <xsd:enumeration value="synonymous-phrase"> | ||
601 | <xsd:annotation> | ||
602 | <xsd:documentation>ISO-12620 2.1.18.3: Phraseological unit in a language that expresses the same semantic content as another phrase in that same language.</xsd:documentation> | ||
603 | </xsd:annotation> | ||
604 | </xsd:enumeration> | ||
605 | <xsd:enumeration value="term"> | ||
606 | <xsd:annotation> | ||
607 | <xsd:documentation>Indicates the marked text is a term.</xsd:documentation> | ||
608 | </xsd:annotation> | ||
609 | </xsd:enumeration> | ||
610 | <xsd:enumeration value="transcribed-form"> | ||
611 | <xsd:annotation> | ||
612 | <xsd:documentation>ISO-12620 2.1.11: A form of a term resulting from an operation whereby the characters of one writing system are represented by characters from another writing system, taking into account the pronunciation of the characters converted.</xsd:documentation> | ||
613 | </xsd:annotation> | ||
614 | </xsd:enumeration> | ||
615 | <xsd:enumeration value="transliterated-form"> | ||
616 | <xsd:annotation> | ||
617 | <xsd:documentation>ISO-12620 2.1.10: A form of a term resulting from an operation whereby the characters of an alphabetic writing system are represented by characters from another alphabetic writing system.</xsd:documentation> | ||
618 | </xsd:annotation> | ||
619 | </xsd:enumeration> | ||
620 | <xsd:enumeration value="truncated-term"> | ||
621 | <xsd:annotation> | ||
622 | <xsd:documentation>ISO-12620 2.1.8.5: An abbreviated form of a term resulting from the omission of one or more term elements or syllables (e.g. 'flu' for 'influenza').</xsd:documentation> | ||
623 | </xsd:annotation> | ||
624 | </xsd:enumeration> | ||
625 | <xsd:enumeration value="variant"> | ||
626 | <xsd:annotation> | ||
627 | <xsd:documentation>ISO-12620 2.1.9: One of the alternate forms of a term.</xsd:documentation> | ||
628 | </xsd:annotation> | ||
629 | </xsd:enumeration> | ||
630 | </xsd:restriction> | ||
631 | </xsd:simpleType> | ||
632 | <xsd:simpleType name="restypeValueList"> | ||
633 | <xsd:annotation> | ||
634 | <xsd:documentation>Values for the attribute 'restype'.</xsd:documentation> | ||
635 | </xsd:annotation> | ||
636 | <xsd:restriction base="xsd:NMTOKEN"> | ||
637 | <xsd:enumeration value="auto3state"> | ||
638 | <xsd:annotation> | ||
639 | <xsd:documentation>Indicates a Windows RC AUTO3STATE control.</xsd:documentation> | ||
640 | </xsd:annotation> | ||
641 | </xsd:enumeration> | ||
642 | <xsd:enumeration value="autocheckbox"> | ||
643 | <xsd:annotation> | ||
644 | <xsd:documentation>Indicates a Windows RC AUTOCHECKBOX control.</xsd:documentation> | ||
645 | </xsd:annotation> | ||
646 | </xsd:enumeration> | ||
647 | <xsd:enumeration value="autoradiobutton"> | ||
648 | <xsd:annotation> | ||
649 | <xsd:documentation>Indicates a Windows RC AUTORADIOBUTTON control.</xsd:documentation> | ||
650 | </xsd:annotation> | ||
651 | </xsd:enumeration> | ||
652 | <xsd:enumeration value="bedit"> | ||
653 | <xsd:annotation> | ||
654 | <xsd:documentation>Indicates a Windows RC BEDIT control.</xsd:documentation> | ||
655 | </xsd:annotation> | ||
656 | </xsd:enumeration> | ||
657 | <xsd:enumeration value="bitmap"> | ||
658 | <xsd:annotation> | ||
659 | <xsd:documentation>Indicates a bitmap, for example a BITMAP resource in Windows.</xsd:documentation> | ||
660 | </xsd:annotation> | ||
661 | </xsd:enumeration> | ||
662 | <xsd:enumeration value="button"> | ||
663 | <xsd:annotation> | ||
664 | <xsd:documentation>Indicates a button object, for example a BUTTON control Windows.</xsd:documentation> | ||
665 | </xsd:annotation> | ||
666 | </xsd:enumeration> | ||
667 | <xsd:enumeration value="caption"> | ||
668 | <xsd:annotation> | ||
669 | <xsd:documentation>Indicates a caption, such as the caption of a dialog box.</xsd:documentation> | ||
670 | </xsd:annotation> | ||
671 | </xsd:enumeration> | ||
672 | <xsd:enumeration value="cell"> | ||
673 | <xsd:annotation> | ||
674 | <xsd:documentation>Indicates the cell in a table, for example the content of the <td> element in HTML.</xsd:documentation> | ||
675 | </xsd:annotation> | ||
676 | </xsd:enumeration> | ||
677 | <xsd:enumeration value="checkbox"> | ||
678 | <xsd:annotation> | ||
679 | <xsd:documentation>Indicates check box object, for example a CHECKBOX control in Windows.</xsd:documentation> | ||
680 | </xsd:annotation> | ||
681 | </xsd:enumeration> | ||
682 | <xsd:enumeration value="checkboxmenuitem"> | ||
683 | <xsd:annotation> | ||
684 | <xsd:documentation>Indicates a menu item with an associated checkbox.</xsd:documentation> | ||
685 | </xsd:annotation> | ||
686 | </xsd:enumeration> | ||
687 | <xsd:enumeration value="checkedlistbox"> | ||
688 | <xsd:annotation> | ||
689 | <xsd:documentation>Indicates a list box, but with a check-box for each item.</xsd:documentation> | ||
690 | </xsd:annotation> | ||
691 | </xsd:enumeration> | ||
692 | <xsd:enumeration value="colorchooser"> | ||
693 | <xsd:annotation> | ||
694 | <xsd:documentation>Indicates a color selection dialog.</xsd:documentation> | ||
695 | </xsd:annotation> | ||
696 | </xsd:enumeration> | ||
697 | <xsd:enumeration value="combobox"> | ||
698 | <xsd:annotation> | ||
699 | <xsd:documentation>Indicates a combination of edit box and listbox object, for example a COMBOBOX control in Windows.</xsd:documentation> | ||
700 | </xsd:annotation> | ||
701 | </xsd:enumeration> | ||
702 | <xsd:enumeration value="comboboxexitem"> | ||
703 | <xsd:annotation> | ||
704 | <xsd:documentation>Indicates an initialization entry of an extended combobox DLGINIT resource block. (code 0x1234).</xsd:documentation> | ||
705 | </xsd:annotation> | ||
706 | </xsd:enumeration> | ||
707 | <xsd:enumeration value="comboboxitem"> | ||
708 | <xsd:annotation> | ||
709 | <xsd:documentation>Indicates an initialization entry of a combobox DLGINIT resource block (code 0x0403).</xsd:documentation> | ||
710 | </xsd:annotation> | ||
711 | </xsd:enumeration> | ||
712 | <xsd:enumeration value="component"> | ||
713 | <xsd:annotation> | ||
714 | <xsd:documentation>Indicates a UI base class element that cannot be represented by any other element.</xsd:documentation> | ||
715 | </xsd:annotation> | ||
716 | </xsd:enumeration> | ||
717 | <xsd:enumeration value="contextmenu"> | ||
718 | <xsd:annotation> | ||
719 | <xsd:documentation>Indicates a context menu.</xsd:documentation> | ||
720 | </xsd:annotation> | ||
721 | </xsd:enumeration> | ||
722 | <xsd:enumeration value="ctext"> | ||
723 | <xsd:annotation> | ||
724 | <xsd:documentation>Indicates a Windows RC CTEXT control.</xsd:documentation> | ||
725 | </xsd:annotation> | ||
726 | </xsd:enumeration> | ||
727 | <xsd:enumeration value="cursor"> | ||
728 | <xsd:annotation> | ||
729 | <xsd:documentation>Indicates a cursor, for example a CURSOR resource in Windows.</xsd:documentation> | ||
730 | </xsd:annotation> | ||
731 | </xsd:enumeration> | ||
732 | <xsd:enumeration value="datetimepicker"> | ||
733 | <xsd:annotation> | ||
734 | <xsd:documentation>Indicates a date/time picker.</xsd:documentation> | ||
735 | </xsd:annotation> | ||
736 | </xsd:enumeration> | ||
737 | <xsd:enumeration value="defpushbutton"> | ||
738 | <xsd:annotation> | ||
739 | <xsd:documentation>Indicates a Windows RC DEFPUSHBUTTON control.</xsd:documentation> | ||
740 | </xsd:annotation> | ||
741 | </xsd:enumeration> | ||
742 | <xsd:enumeration value="dialog"> | ||
743 | <xsd:annotation> | ||
744 | <xsd:documentation>Indicates a dialog box.</xsd:documentation> | ||
745 | </xsd:annotation> | ||
746 | </xsd:enumeration> | ||
747 | <xsd:enumeration value="dlginit"> | ||
748 | <xsd:annotation> | ||
749 | <xsd:documentation>Indicates a Windows RC DLGINIT resource block.</xsd:documentation> | ||
750 | </xsd:annotation> | ||
751 | </xsd:enumeration> | ||
752 | <xsd:enumeration value="edit"> | ||
753 | <xsd:annotation> | ||
754 | <xsd:documentation>Indicates an edit box object, for example an EDIT control in Windows.</xsd:documentation> | ||
755 | </xsd:annotation> | ||
756 | </xsd:enumeration> | ||
757 | <xsd:enumeration value="file"> | ||
758 | <xsd:annotation> | ||
759 | <xsd:documentation>Indicates a filename.</xsd:documentation> | ||
760 | </xsd:annotation> | ||
761 | </xsd:enumeration> | ||
762 | <xsd:enumeration value="filechooser"> | ||
763 | <xsd:annotation> | ||
764 | <xsd:documentation>Indicates a file dialog.</xsd:documentation> | ||
765 | </xsd:annotation> | ||
766 | </xsd:enumeration> | ||
767 | <xsd:enumeration value="fn"> | ||
768 | <xsd:annotation> | ||
769 | <xsd:documentation>Indicates a footnote.</xsd:documentation> | ||
770 | </xsd:annotation> | ||
771 | </xsd:enumeration> | ||
772 | <xsd:enumeration value="font"> | ||
773 | <xsd:annotation> | ||
774 | <xsd:documentation>Indicates a font name.</xsd:documentation> | ||
775 | </xsd:annotation> | ||
776 | </xsd:enumeration> | ||
777 | <xsd:enumeration value="footer"> | ||
778 | <xsd:annotation> | ||
779 | <xsd:documentation>Indicates a footer.</xsd:documentation> | ||
780 | </xsd:annotation> | ||
781 | </xsd:enumeration> | ||
782 | <xsd:enumeration value="frame"> | ||
783 | <xsd:annotation> | ||
784 | <xsd:documentation>Indicates a frame object.</xsd:documentation> | ||
785 | </xsd:annotation> | ||
786 | </xsd:enumeration> | ||
787 | <xsd:enumeration value="grid"> | ||
788 | <xsd:annotation> | ||
789 | <xsd:documentation>Indicates a XUL grid element.</xsd:documentation> | ||
790 | </xsd:annotation> | ||
791 | </xsd:enumeration> | ||
792 | <xsd:enumeration value="groupbox"> | ||
793 | <xsd:annotation> | ||
794 | <xsd:documentation>Indicates a groupbox object, for example a GROUPBOX control in Windows.</xsd:documentation> | ||
795 | </xsd:annotation> | ||
796 | </xsd:enumeration> | ||
797 | <xsd:enumeration value="header"> | ||
798 | <xsd:annotation> | ||
799 | <xsd:documentation>Indicates a header item.</xsd:documentation> | ||
800 | </xsd:annotation> | ||
801 | </xsd:enumeration> | ||
802 | <xsd:enumeration value="heading"> | ||
803 | <xsd:annotation> | ||
804 | <xsd:documentation>Indicates a heading, such has the content of <h1>, <h2>, etc. in HTML.</xsd:documentation> | ||
805 | </xsd:annotation> | ||
806 | </xsd:enumeration> | ||
807 | <xsd:enumeration value="hedit"> | ||
808 | <xsd:annotation> | ||
809 | <xsd:documentation>Indicates a Windows RC HEDIT control.</xsd:documentation> | ||
810 | </xsd:annotation> | ||
811 | </xsd:enumeration> | ||
812 | <xsd:enumeration value="hscrollbar"> | ||
813 | <xsd:annotation> | ||
814 | <xsd:documentation>Indicates a horizontal scrollbar.</xsd:documentation> | ||
815 | </xsd:annotation> | ||
816 | </xsd:enumeration> | ||
817 | <xsd:enumeration value="icon"> | ||
818 | <xsd:annotation> | ||
819 | <xsd:documentation>Indicates an icon, for example an ICON resource in Windows.</xsd:documentation> | ||
820 | </xsd:annotation> | ||
821 | </xsd:enumeration> | ||
822 | <xsd:enumeration value="iedit"> | ||
823 | <xsd:annotation> | ||
824 | <xsd:documentation>Indicates a Windows RC IEDIT control.</xsd:documentation> | ||
825 | </xsd:annotation> | ||
826 | </xsd:enumeration> | ||
827 | <xsd:enumeration value="keywords"> | ||
828 | <xsd:annotation> | ||
829 | <xsd:documentation>Indicates keyword list, such as the content of the Keywords meta-data in HTML, or a K footnote in WinHelp RTF.</xsd:documentation> | ||
830 | </xsd:annotation> | ||
831 | </xsd:enumeration> | ||
832 | <xsd:enumeration value="label"> | ||
833 | <xsd:annotation> | ||
834 | <xsd:documentation>Indicates a label object.</xsd:documentation> | ||
835 | </xsd:annotation> | ||
836 | </xsd:enumeration> | ||
837 | <xsd:enumeration value="linklabel"> | ||
838 | <xsd:annotation> | ||
839 | <xsd:documentation>Indicates a label that is also a HTML link (not necessarily a URL).</xsd:documentation> | ||
840 | </xsd:annotation> | ||
841 | </xsd:enumeration> | ||
842 | <xsd:enumeration value="list"> | ||
843 | <xsd:annotation> | ||
844 | <xsd:documentation>Indicates a list (a group of list-items, for example an <ol> or <ul> element in HTML).</xsd:documentation> | ||
845 | </xsd:annotation> | ||
846 | </xsd:enumeration> | ||
847 | <xsd:enumeration value="listbox"> | ||
848 | <xsd:annotation> | ||
849 | <xsd:documentation>Indicates a listbox object, for example an LISTBOX control in Windows.</xsd:documentation> | ||
850 | </xsd:annotation> | ||
851 | </xsd:enumeration> | ||
852 | <xsd:enumeration value="listitem"> | ||
853 | <xsd:annotation> | ||
854 | <xsd:documentation>Indicates an list item (an entry in a list).</xsd:documentation> | ||
855 | </xsd:annotation> | ||
856 | </xsd:enumeration> | ||
857 | <xsd:enumeration value="ltext"> | ||
858 | <xsd:annotation> | ||
859 | <xsd:documentation>Indicates a Windows RC LTEXT control.</xsd:documentation> | ||
860 | </xsd:annotation> | ||
861 | </xsd:enumeration> | ||
862 | <xsd:enumeration value="menu"> | ||
863 | <xsd:annotation> | ||
864 | <xsd:documentation>Indicates a menu (a group of menu-items).</xsd:documentation> | ||
865 | </xsd:annotation> | ||
866 | </xsd:enumeration> | ||
867 | <xsd:enumeration value="menubar"> | ||
868 | <xsd:annotation> | ||
869 | <xsd:documentation>Indicates a toolbar containing one or more tope level menus.</xsd:documentation> | ||
870 | </xsd:annotation> | ||
871 | </xsd:enumeration> | ||
872 | <xsd:enumeration value="menuitem"> | ||
873 | <xsd:annotation> | ||
874 | <xsd:documentation>Indicates a menu item (an entry in a menu).</xsd:documentation> | ||
875 | </xsd:annotation> | ||
876 | </xsd:enumeration> | ||
877 | <xsd:enumeration value="menuseparator"> | ||
878 | <xsd:annotation> | ||
879 | <xsd:documentation>Indicates a XUL menuseparator element.</xsd:documentation> | ||
880 | </xsd:annotation> | ||
881 | </xsd:enumeration> | ||
882 | <xsd:enumeration value="message"> | ||
883 | <xsd:annotation> | ||
884 | <xsd:documentation>Indicates a message, for example an entry in a MESSAGETABLE resource in Windows.</xsd:documentation> | ||
885 | </xsd:annotation> | ||
886 | </xsd:enumeration> | ||
887 | <xsd:enumeration value="monthcalendar"> | ||
888 | <xsd:annotation> | ||
889 | <xsd:documentation>Indicates a calendar control.</xsd:documentation> | ||
890 | </xsd:annotation> | ||
891 | </xsd:enumeration> | ||
892 | <xsd:enumeration value="numericupdown"> | ||
893 | <xsd:annotation> | ||
894 | <xsd:documentation>Indicates an edit box beside a spin control.</xsd:documentation> | ||
895 | </xsd:annotation> | ||
896 | </xsd:enumeration> | ||
897 | <xsd:enumeration value="panel"> | ||
898 | <xsd:annotation> | ||
899 | <xsd:documentation>Indicates a catch all for rectangular areas.</xsd:documentation> | ||
900 | </xsd:annotation> | ||
901 | </xsd:enumeration> | ||
902 | <xsd:enumeration value="popupmenu"> | ||
903 | <xsd:annotation> | ||
904 | <xsd:documentation>Indicates a standalone menu not necessarily associated with a menubar.</xsd:documentation> | ||
905 | </xsd:annotation> | ||
906 | </xsd:enumeration> | ||
907 | <xsd:enumeration value="pushbox"> | ||
908 | <xsd:annotation> | ||
909 | <xsd:documentation>Indicates a pushbox object, for example a PUSHBOX control in Windows.</xsd:documentation> | ||
910 | </xsd:annotation> | ||
911 | </xsd:enumeration> | ||
912 | <xsd:enumeration value="pushbutton"> | ||
913 | <xsd:annotation> | ||
914 | <xsd:documentation>Indicates a Windows RC PUSHBUTTON control.</xsd:documentation> | ||
915 | </xsd:annotation> | ||
916 | </xsd:enumeration> | ||
917 | <xsd:enumeration value="radio"> | ||
918 | <xsd:annotation> | ||
919 | <xsd:documentation>Indicates a radio button object.</xsd:documentation> | ||
920 | </xsd:annotation> | ||
921 | </xsd:enumeration> | ||
922 | <xsd:enumeration value="radiobuttonmenuitem"> | ||
923 | <xsd:annotation> | ||
924 | <xsd:documentation>Indicates a menuitem with associated radio button.</xsd:documentation> | ||
925 | </xsd:annotation> | ||
926 | </xsd:enumeration> | ||
927 | <xsd:enumeration value="rcdata"> | ||
928 | <xsd:annotation> | ||
929 | <xsd:documentation>Indicates raw data resources for an application.</xsd:documentation> | ||
930 | </xsd:annotation> | ||
931 | </xsd:enumeration> | ||
932 | <xsd:enumeration value="row"> | ||
933 | <xsd:annotation> | ||
934 | <xsd:documentation>Indicates a row in a table.</xsd:documentation> | ||
935 | </xsd:annotation> | ||
936 | </xsd:enumeration> | ||
937 | <xsd:enumeration value="rtext"> | ||
938 | <xsd:annotation> | ||
939 | <xsd:documentation>Indicates a Windows RC RTEXT control.</xsd:documentation> | ||
940 | </xsd:annotation> | ||
941 | </xsd:enumeration> | ||
942 | <xsd:enumeration value="scrollpane"> | ||
943 | <xsd:annotation> | ||
944 | <xsd:documentation>Indicates a user navigable container used to show a portion of a document.</xsd:documentation> | ||
945 | </xsd:annotation> | ||
946 | </xsd:enumeration> | ||
947 | <xsd:enumeration value="separator"> | ||
948 | <xsd:annotation> | ||
949 | <xsd:documentation>Indicates a generic divider object (e.g. menu group separator).</xsd:documentation> | ||
950 | </xsd:annotation> | ||
951 | </xsd:enumeration> | ||
952 | <xsd:enumeration value="shortcut"> | ||
953 | <xsd:annotation> | ||
954 | <xsd:documentation>Windows accelerators, shortcuts in resource or property files.</xsd:documentation> | ||
955 | </xsd:annotation> | ||
956 | </xsd:enumeration> | ||
957 | <xsd:enumeration value="spinner"> | ||
958 | <xsd:annotation> | ||
959 | <xsd:documentation>Indicates a UI control to indicate process activity but not progress.</xsd:documentation> | ||
960 | </xsd:annotation> | ||
961 | </xsd:enumeration> | ||
962 | <xsd:enumeration value="splitter"> | ||
963 | <xsd:annotation> | ||
964 | <xsd:documentation>Indicates a splitter bar.</xsd:documentation> | ||
965 | </xsd:annotation> | ||
966 | </xsd:enumeration> | ||
967 | <xsd:enumeration value="state3"> | ||
968 | <xsd:annotation> | ||
969 | <xsd:documentation>Indicates a Windows RC STATE3 control.</xsd:documentation> | ||
970 | </xsd:annotation> | ||
971 | </xsd:enumeration> | ||
972 | <xsd:enumeration value="statusbar"> | ||
973 | <xsd:annotation> | ||
974 | <xsd:documentation>Indicates a window for providing feedback to the users, like 'read-only', etc.</xsd:documentation> | ||
975 | </xsd:annotation> | ||
976 | </xsd:enumeration> | ||
977 | <xsd:enumeration value="string"> | ||
978 | <xsd:annotation> | ||
979 | <xsd:documentation>Indicates a string, for example an entry in a STRINGTABLE resource in Windows.</xsd:documentation> | ||
980 | </xsd:annotation> | ||
981 | </xsd:enumeration> | ||
982 | <xsd:enumeration value="tabcontrol"> | ||
983 | <xsd:annotation> | ||
984 | <xsd:documentation>Indicates a layers of controls with a tab to select layers.</xsd:documentation> | ||
985 | </xsd:annotation> | ||
986 | </xsd:enumeration> | ||
987 | <xsd:enumeration value="table"> | ||
988 | <xsd:annotation> | ||
989 | <xsd:documentation>Indicates a display and edits regular two-dimensional tables of cells.</xsd:documentation> | ||
990 | </xsd:annotation> | ||
991 | </xsd:enumeration> | ||
992 | <xsd:enumeration value="textbox"> | ||
993 | <xsd:annotation> | ||
994 | <xsd:documentation>Indicates a XUL textbox element.</xsd:documentation> | ||
995 | </xsd:annotation> | ||
996 | </xsd:enumeration> | ||
997 | <xsd:enumeration value="togglebutton"> | ||
998 | <xsd:annotation> | ||
999 | <xsd:documentation>Indicates a UI button that can be toggled to on or off state.</xsd:documentation> | ||
1000 | </xsd:annotation> | ||
1001 | </xsd:enumeration> | ||
1002 | <xsd:enumeration value="toolbar"> | ||
1003 | <xsd:annotation> | ||
1004 | <xsd:documentation>Indicates an array of controls, usually buttons.</xsd:documentation> | ||
1005 | </xsd:annotation> | ||
1006 | </xsd:enumeration> | ||
1007 | <xsd:enumeration value="tooltip"> | ||
1008 | <xsd:annotation> | ||
1009 | <xsd:documentation>Indicates a pop up tool tip text.</xsd:documentation> | ||
1010 | </xsd:annotation> | ||
1011 | </xsd:enumeration> | ||
1012 | <xsd:enumeration value="trackbar"> | ||
1013 | <xsd:annotation> | ||
1014 | <xsd:documentation>Indicates a bar with a pointer indicating a position within a certain range.</xsd:documentation> | ||
1015 | </xsd:annotation> | ||
1016 | </xsd:enumeration> | ||
1017 | <xsd:enumeration value="tree"> | ||
1018 | <xsd:annotation> | ||
1019 | <xsd:documentation>Indicates a control that displays a set of hierarchical data.</xsd:documentation> | ||
1020 | </xsd:annotation> | ||
1021 | </xsd:enumeration> | ||
1022 | <xsd:enumeration value="uri"> | ||
1023 | <xsd:annotation> | ||
1024 | <xsd:documentation>Indicates a URI (URN or URL).</xsd:documentation> | ||
1025 | </xsd:annotation> | ||
1026 | </xsd:enumeration> | ||
1027 | <xsd:enumeration value="userbutton"> | ||
1028 | <xsd:annotation> | ||
1029 | <xsd:documentation>Indicates a Windows RC USERBUTTON control.</xsd:documentation> | ||
1030 | </xsd:annotation> | ||
1031 | </xsd:enumeration> | ||
1032 | <xsd:enumeration value="usercontrol"> | ||
1033 | <xsd:annotation> | ||
1034 | <xsd:documentation>Indicates a user-defined control like CONTROL control in Windows.</xsd:documentation> | ||
1035 | </xsd:annotation> | ||
1036 | </xsd:enumeration> | ||
1037 | <xsd:enumeration value="var"> | ||
1038 | <xsd:annotation> | ||
1039 | <xsd:documentation>Indicates the text of a variable.</xsd:documentation> | ||
1040 | </xsd:annotation> | ||
1041 | </xsd:enumeration> | ||
1042 | <xsd:enumeration value="versioninfo"> | ||
1043 | <xsd:annotation> | ||
1044 | <xsd:documentation>Indicates version information about a resource like VERSIONINFO in Windows.</xsd:documentation> | ||
1045 | </xsd:annotation> | ||
1046 | </xsd:enumeration> | ||
1047 | <xsd:enumeration value="vscrollbar"> | ||
1048 | <xsd:annotation> | ||
1049 | <xsd:documentation>Indicates a vertical scrollbar.</xsd:documentation> | ||
1050 | </xsd:annotation> | ||
1051 | </xsd:enumeration> | ||
1052 | <xsd:enumeration value="window"> | ||
1053 | <xsd:annotation> | ||
1054 | <xsd:documentation>Indicates a graphical window.</xsd:documentation> | ||
1055 | </xsd:annotation> | ||
1056 | </xsd:enumeration> | ||
1057 | </xsd:restriction> | ||
1058 | </xsd:simpleType> | ||
1059 | <xsd:simpleType name="size-unitValueList"> | ||
1060 | <xsd:annotation> | ||
1061 | <xsd:documentation>Values for the attribute 'size-unit'.</xsd:documentation> | ||
1062 | </xsd:annotation> | ||
1063 | <xsd:restriction base="xsd:NMTOKEN"> | ||
1064 | <xsd:enumeration value="byte"> | ||
1065 | <xsd:annotation> | ||
1066 | <xsd:documentation>Indicates a size in 8-bit bytes.</xsd:documentation> | ||
1067 | </xsd:annotation> | ||
1068 | </xsd:enumeration> | ||
1069 | <xsd:enumeration value="char"> | ||
1070 | <xsd:annotation> | ||
1071 | <xsd:documentation>Indicates a size in Unicode characters.</xsd:documentation> | ||
1072 | </xsd:annotation> | ||
1073 | </xsd:enumeration> | ||
1074 | <xsd:enumeration value="col"> | ||
1075 | <xsd:annotation> | ||
1076 | <xsd:documentation>Indicates a size in columns. Used for HTML text area.</xsd:documentation> | ||
1077 | </xsd:annotation> | ||
1078 | </xsd:enumeration> | ||
1079 | <xsd:enumeration value="cm"> | ||
1080 | <xsd:annotation> | ||
1081 | <xsd:documentation>Indicates a size in centimeters.</xsd:documentation> | ||
1082 | </xsd:annotation> | ||
1083 | </xsd:enumeration> | ||
1084 | <xsd:enumeration value="dlgunit"> | ||
1085 | <xsd:annotation> | ||
1086 | <xsd:documentation>Indicates a size in dialog units, as defined in Windows resources.</xsd:documentation> | ||
1087 | </xsd:annotation> | ||
1088 | </xsd:enumeration> | ||
1089 | <xsd:enumeration value="em"> | ||
1090 | <xsd:annotation> | ||
1091 | <xsd:documentation>Indicates a size in 'font-size' units (as defined in CSS).</xsd:documentation> | ||
1092 | </xsd:annotation> | ||
1093 | </xsd:enumeration> | ||
1094 | <xsd:enumeration value="ex"> | ||
1095 | <xsd:annotation> | ||
1096 | <xsd:documentation>Indicates a size in 'x-height' units (as defined in CSS).</xsd:documentation> | ||
1097 | </xsd:annotation> | ||
1098 | </xsd:enumeration> | ||
1099 | <xsd:enumeration value="glyph"> | ||
1100 | <xsd:annotation> | ||
1101 | <xsd:documentation>Indicates a size in glyphs. A glyph is considered to be one or more combined Unicode characters that represent a single displayable text character. Sometimes referred to as a 'grapheme cluster'</xsd:documentation> | ||
1102 | </xsd:annotation> | ||
1103 | </xsd:enumeration> | ||
1104 | <xsd:enumeration value="in"> | ||
1105 | <xsd:annotation> | ||
1106 | <xsd:documentation>Indicates a size in inches.</xsd:documentation> | ||
1107 | </xsd:annotation> | ||
1108 | </xsd:enumeration> | ||
1109 | <xsd:enumeration value="mm"> | ||
1110 | <xsd:annotation> | ||
1111 | <xsd:documentation>Indicates a size in millimeters.</xsd:documentation> | ||
1112 | </xsd:annotation> | ||
1113 | </xsd:enumeration> | ||
1114 | <xsd:enumeration value="percent"> | ||
1115 | <xsd:annotation> | ||
1116 | <xsd:documentation>Indicates a size in percentage.</xsd:documentation> | ||
1117 | </xsd:annotation> | ||
1118 | </xsd:enumeration> | ||
1119 | <xsd:enumeration value="pixel"> | ||
1120 | <xsd:annotation> | ||
1121 | <xsd:documentation>Indicates a size in pixels.</xsd:documentation> | ||
1122 | </xsd:annotation> | ||
1123 | </xsd:enumeration> | ||
1124 | <xsd:enumeration value="point"> | ||
1125 | <xsd:annotation> | ||
1126 | <xsd:documentation>Indicates a size in point.</xsd:documentation> | ||
1127 | </xsd:annotation> | ||
1128 | </xsd:enumeration> | ||
1129 | <xsd:enumeration value="row"> | ||
1130 | <xsd:annotation> | ||
1131 | <xsd:documentation>Indicates a size in rows. Used for HTML text area.</xsd:documentation> | ||
1132 | </xsd:annotation> | ||
1133 | </xsd:enumeration> | ||
1134 | </xsd:restriction> | ||
1135 | </xsd:simpleType> | ||
1136 | <xsd:simpleType name="stateValueList"> | ||
1137 | <xsd:annotation> | ||
1138 | <xsd:documentation>Values for the attribute 'state'.</xsd:documentation> | ||
1139 | </xsd:annotation> | ||
1140 | <xsd:restriction base="xsd:NMTOKEN"> | ||
1141 | <xsd:enumeration value="final"> | ||
1142 | <xsd:annotation> | ||
1143 | <xsd:documentation>Indicates the terminating state.</xsd:documentation> | ||
1144 | </xsd:annotation> | ||
1145 | </xsd:enumeration> | ||
1146 | <xsd:enumeration value="needs-adaptation"> | ||
1147 | <xsd:annotation> | ||
1148 | <xsd:documentation>Indicates only non-textual information needs adaptation.</xsd:documentation> | ||
1149 | </xsd:annotation> | ||
1150 | </xsd:enumeration> | ||
1151 | <xsd:enumeration value="needs-l10n"> | ||
1152 | <xsd:annotation> | ||
1153 | <xsd:documentation>Indicates both text and non-textual information needs adaptation.</xsd:documentation> | ||
1154 | </xsd:annotation> | ||
1155 | </xsd:enumeration> | ||
1156 | <xsd:enumeration value="needs-review-adaptation"> | ||
1157 | <xsd:annotation> | ||
1158 | <xsd:documentation>Indicates only non-textual information needs review.</xsd:documentation> | ||
1159 | </xsd:annotation> | ||
1160 | </xsd:enumeration> | ||
1161 | <xsd:enumeration value="needs-review-l10n"> | ||
1162 | <xsd:annotation> | ||
1163 | <xsd:documentation>Indicates both text and non-textual information needs review.</xsd:documentation> | ||
1164 | </xsd:annotation> | ||
1165 | </xsd:enumeration> | ||
1166 | <xsd:enumeration value="needs-review-translation"> | ||
1167 | <xsd:annotation> | ||
1168 | <xsd:documentation>Indicates that only the text of the item needs to be reviewed.</xsd:documentation> | ||
1169 | </xsd:annotation> | ||
1170 | </xsd:enumeration> | ||
1171 | <xsd:enumeration value="needs-translation"> | ||
1172 | <xsd:annotation> | ||
1173 | <xsd:documentation>Indicates that the item needs to be translated.</xsd:documentation> | ||
1174 | </xsd:annotation> | ||
1175 | </xsd:enumeration> | ||
1176 | <xsd:enumeration value="new"> | ||
1177 | <xsd:annotation> | ||
1178 | <xsd:documentation>Indicates that the item is new. For example, translation units that were not in a previous version of the document.</xsd:documentation> | ||
1179 | </xsd:annotation> | ||
1180 | </xsd:enumeration> | ||
1181 | <xsd:enumeration value="signed-off"> | ||
1182 | <xsd:annotation> | ||
1183 | <xsd:documentation>Indicates that changes are reviewed and approved.</xsd:documentation> | ||
1184 | </xsd:annotation> | ||
1185 | </xsd:enumeration> | ||
1186 | <xsd:enumeration value="translated"> | ||
1187 | <xsd:annotation> | ||
1188 | <xsd:documentation>Indicates that the item has been translated.</xsd:documentation> | ||
1189 | </xsd:annotation> | ||
1190 | </xsd:enumeration> | ||
1191 | </xsd:restriction> | ||
1192 | </xsd:simpleType> | ||
1193 | <xsd:simpleType name="state-qualifierValueList"> | ||
1194 | <xsd:annotation> | ||
1195 | <xsd:documentation>Values for the attribute 'state-qualifier'.</xsd:documentation> | ||
1196 | </xsd:annotation> | ||
1197 | <xsd:restriction base="xsd:NMTOKEN"> | ||
1198 | <xsd:enumeration value="exact-match"> | ||
1199 | <xsd:annotation> | ||
1200 | <xsd:documentation>Indicates an exact match. An exact match occurs when a source text of a segment is exactly the same as the source text of a segment that was translated previously.</xsd:documentation> | ||
1201 | </xsd:annotation> | ||
1202 | </xsd:enumeration> | ||
1203 | <xsd:enumeration value="fuzzy-match"> | ||
1204 | <xsd:annotation> | ||
1205 | <xsd:documentation>Indicates a fuzzy match. A fuzzy match occurs when a source text of a segment is very similar to the source text of a segment that was translated previously (e.g. when the difference is casing, a few changed words, white-space discripancy, etc.).</xsd:documentation> | ||
1206 | </xsd:annotation> | ||
1207 | </xsd:enumeration> | ||
1208 | <xsd:enumeration value="id-match"> | ||
1209 | <xsd:annotation> | ||
1210 | <xsd:documentation>Indicates a match based on matching IDs (in addition to matching text).</xsd:documentation> | ||
1211 | </xsd:annotation> | ||
1212 | </xsd:enumeration> | ||
1213 | <xsd:enumeration value="leveraged-glossary"> | ||
1214 | <xsd:annotation> | ||
1215 | <xsd:documentation>Indicates a translation derived from a glossary.</xsd:documentation> | ||
1216 | </xsd:annotation> | ||
1217 | </xsd:enumeration> | ||
1218 | <xsd:enumeration value="leveraged-inherited"> | ||
1219 | <xsd:annotation> | ||
1220 | <xsd:documentation>Indicates a translation derived from existing translation.</xsd:documentation> | ||
1221 | </xsd:annotation> | ||
1222 | </xsd:enumeration> | ||
1223 | <xsd:enumeration value="leveraged-mt"> | ||
1224 | <xsd:annotation> | ||
1225 | <xsd:documentation>Indicates a translation derived from machine translation.</xsd:documentation> | ||
1226 | </xsd:annotation> | ||
1227 | </xsd:enumeration> | ||
1228 | <xsd:enumeration value="leveraged-repository"> | ||
1229 | <xsd:annotation> | ||
1230 | <xsd:documentation>Indicates a translation derived from a translation repository.</xsd:documentation> | ||
1231 | </xsd:annotation> | ||
1232 | </xsd:enumeration> | ||
1233 | <xsd:enumeration value="leveraged-tm"> | ||
1234 | <xsd:annotation> | ||
1235 | <xsd:documentation>Indicates a translation derived from a translation memory.</xsd:documentation> | ||
1236 | </xsd:annotation> | ||
1237 | </xsd:enumeration> | ||
1238 | <xsd:enumeration value="mt-suggestion"> | ||
1239 | <xsd:annotation> | ||
1240 | <xsd:documentation>Indicates the translation is suggested by machine translation.</xsd:documentation> | ||
1241 | </xsd:annotation> | ||
1242 | </xsd:enumeration> | ||
1243 | <xsd:enumeration value="rejected-grammar"> | ||
1244 | <xsd:annotation> | ||
1245 | <xsd:documentation>Indicates that the item has been rejected because of incorrect grammar.</xsd:documentation> | ||
1246 | </xsd:annotation> | ||
1247 | </xsd:enumeration> | ||
1248 | <xsd:enumeration value="rejected-inaccurate"> | ||
1249 | <xsd:annotation> | ||
1250 | <xsd:documentation>Indicates that the item has been rejected because it is incorrect.</xsd:documentation> | ||
1251 | </xsd:annotation> | ||
1252 | </xsd:enumeration> | ||
1253 | <xsd:enumeration value="rejected-length"> | ||
1254 | <xsd:annotation> | ||
1255 | <xsd:documentation>Indicates that the item has been rejected because it is too long or too short.</xsd:documentation> | ||
1256 | </xsd:annotation> | ||
1257 | </xsd:enumeration> | ||
1258 | <xsd:enumeration value="rejected-spelling"> | ||
1259 | <xsd:annotation> | ||
1260 | <xsd:documentation>Indicates that the item has been rejected because of incorrect spelling.</xsd:documentation> | ||
1261 | </xsd:annotation> | ||
1262 | </xsd:enumeration> | ||
1263 | <xsd:enumeration value="tm-suggestion"> | ||
1264 | <xsd:annotation> | ||
1265 | <xsd:documentation>Indicates the translation is suggested by translation memory.</xsd:documentation> | ||
1266 | </xsd:annotation> | ||
1267 | </xsd:enumeration> | ||
1268 | </xsd:restriction> | ||
1269 | </xsd:simpleType> | ||
1270 | <xsd:simpleType name="unitValueList"> | ||
1271 | <xsd:annotation> | ||
1272 | <xsd:documentation>Values for the attribute 'unit'.</xsd:documentation> | ||
1273 | </xsd:annotation> | ||
1274 | <xsd:restriction base="xsd:NMTOKEN"> | ||
1275 | <xsd:enumeration value="word"> | ||
1276 | <xsd:annotation> | ||
1277 | <xsd:documentation>Refers to words.</xsd:documentation> | ||
1278 | </xsd:annotation> | ||
1279 | </xsd:enumeration> | ||
1280 | <xsd:enumeration value="page"> | ||
1281 | <xsd:annotation> | ||
1282 | <xsd:documentation>Refers to pages.</xsd:documentation> | ||
1283 | </xsd:annotation> | ||
1284 | </xsd:enumeration> | ||
1285 | <xsd:enumeration value="trans-unit"> | ||
1286 | <xsd:annotation> | ||
1287 | <xsd:documentation>Refers to <trans-unit> elements.</xsd:documentation> | ||
1288 | </xsd:annotation> | ||
1289 | </xsd:enumeration> | ||
1290 | <xsd:enumeration value="bin-unit"> | ||
1291 | <xsd:annotation> | ||
1292 | <xsd:documentation>Refers to <bin-unit> elements.</xsd:documentation> | ||
1293 | </xsd:annotation> | ||
1294 | </xsd:enumeration> | ||
1295 | <xsd:enumeration value="glyph"> | ||
1296 | <xsd:annotation> | ||
1297 | <xsd:documentation>Refers to glyphs.</xsd:documentation> | ||
1298 | </xsd:annotation> | ||
1299 | </xsd:enumeration> | ||
1300 | <xsd:enumeration value="item"> | ||
1301 | <xsd:annotation> | ||
1302 | <xsd:documentation>Refers to <trans-unit> and/or <bin-unit> elements.</xsd:documentation> | ||
1303 | </xsd:annotation> | ||
1304 | </xsd:enumeration> | ||
1305 | <xsd:enumeration value="instance"> | ||
1306 | <xsd:annotation> | ||
1307 | <xsd:documentation>Refers to the occurrences of instances defined by the count-type value.</xsd:documentation> | ||
1308 | </xsd:annotation> | ||
1309 | </xsd:enumeration> | ||
1310 | <xsd:enumeration value="character"> | ||
1311 | <xsd:annotation> | ||
1312 | <xsd:documentation>Refers to characters.</xsd:documentation> | ||
1313 | </xsd:annotation> | ||
1314 | </xsd:enumeration> | ||
1315 | <xsd:enumeration value="line"> | ||
1316 | <xsd:annotation> | ||
1317 | <xsd:documentation>Refers to lines.</xsd:documentation> | ||
1318 | </xsd:annotation> | ||
1319 | </xsd:enumeration> | ||
1320 | <xsd:enumeration value="sentence"> | ||
1321 | <xsd:annotation> | ||
1322 | <xsd:documentation>Refers to sentences.</xsd:documentation> | ||
1323 | </xsd:annotation> | ||
1324 | </xsd:enumeration> | ||
1325 | <xsd:enumeration value="paragraph"> | ||
1326 | <xsd:annotation> | ||
1327 | <xsd:documentation>Refers to paragraphs.</xsd:documentation> | ||
1328 | </xsd:annotation> | ||
1329 | </xsd:enumeration> | ||
1330 | <xsd:enumeration value="segment"> | ||
1331 | <xsd:annotation> | ||
1332 | <xsd:documentation>Refers to segments.</xsd:documentation> | ||
1333 | </xsd:annotation> | ||
1334 | </xsd:enumeration> | ||
1335 | <xsd:enumeration value="placeable"> | ||
1336 | <xsd:annotation> | ||
1337 | <xsd:documentation>Refers to placeables (inline elements).</xsd:documentation> | ||
1338 | </xsd:annotation> | ||
1339 | </xsd:enumeration> | ||
1340 | </xsd:restriction> | ||
1341 | </xsd:simpleType> | ||
1342 | <xsd:simpleType name="priorityValueList"> | ||
1343 | <xsd:annotation> | ||
1344 | <xsd:documentation>Values for the attribute 'priority'.</xsd:documentation> | ||
1345 | </xsd:annotation> | ||
1346 | <xsd:restriction base="xsd:positiveInteger"> | ||
1347 | <xsd:enumeration value="1"> | ||
1348 | <xsd:annotation> | ||
1349 | <xsd:documentation>Highest priority.</xsd:documentation> | ||
1350 | </xsd:annotation> | ||
1351 | </xsd:enumeration> | ||
1352 | <xsd:enumeration value="2"> | ||
1353 | <xsd:annotation> | ||
1354 | <xsd:documentation>High priority.</xsd:documentation> | ||
1355 | </xsd:annotation> | ||
1356 | </xsd:enumeration> | ||
1357 | <xsd:enumeration value="3"> | ||
1358 | <xsd:annotation> | ||
1359 | <xsd:documentation>High priority, but not as important as 2.</xsd:documentation> | ||
1360 | </xsd:annotation> | ||
1361 | </xsd:enumeration> | ||
1362 | <xsd:enumeration value="4"> | ||
1363 | <xsd:annotation> | ||
1364 | <xsd:documentation>High priority, but not as important as 3.</xsd:documentation> | ||
1365 | </xsd:annotation> | ||
1366 | </xsd:enumeration> | ||
1367 | <xsd:enumeration value="5"> | ||
1368 | <xsd:annotation> | ||
1369 | <xsd:documentation>Medium priority, but more important than 6.</xsd:documentation> | ||
1370 | </xsd:annotation> | ||
1371 | </xsd:enumeration> | ||
1372 | <xsd:enumeration value="6"> | ||
1373 | <xsd:annotation> | ||
1374 | <xsd:documentation>Medium priority, but less important than 5.</xsd:documentation> | ||
1375 | </xsd:annotation> | ||
1376 | </xsd:enumeration> | ||
1377 | <xsd:enumeration value="7"> | ||
1378 | <xsd:annotation> | ||
1379 | <xsd:documentation>Low priority, but more important than 8.</xsd:documentation> | ||
1380 | </xsd:annotation> | ||
1381 | </xsd:enumeration> | ||
1382 | <xsd:enumeration value="8"> | ||
1383 | <xsd:annotation> | ||
1384 | <xsd:documentation>Low priority, but more important than 9.</xsd:documentation> | ||
1385 | </xsd:annotation> | ||
1386 | </xsd:enumeration> | ||
1387 | <xsd:enumeration value="9"> | ||
1388 | <xsd:annotation> | ||
1389 | <xsd:documentation>Low priority.</xsd:documentation> | ||
1390 | </xsd:annotation> | ||
1391 | </xsd:enumeration> | ||
1392 | <xsd:enumeration value="10"> | ||
1393 | <xsd:annotation> | ||
1394 | <xsd:documentation>Lowest priority.</xsd:documentation> | ||
1395 | </xsd:annotation> | ||
1396 | </xsd:enumeration> | ||
1397 | </xsd:restriction> | ||
1398 | </xsd:simpleType> | ||
1399 | <xsd:simpleType name="reformatValueYesNo"> | ||
1400 | <xsd:restriction base="xsd:string"> | ||
1401 | <xsd:enumeration value="yes"> | ||
1402 | <xsd:annotation> | ||
1403 | <xsd:documentation>This value indicates that all properties can be reformatted. This value must be used alone.</xsd:documentation> | ||
1404 | </xsd:annotation> | ||
1405 | </xsd:enumeration> | ||
1406 | <xsd:enumeration value="no"> | ||
1407 | <xsd:annotation> | ||
1408 | <xsd:documentation>This value indicates that no properties should be reformatted. This value must be used alone.</xsd:documentation> | ||
1409 | </xsd:annotation> | ||
1410 | </xsd:enumeration> | ||
1411 | </xsd:restriction> | ||
1412 | </xsd:simpleType> | ||
1413 | <xsd:simpleType name="reformatValueList"> | ||
1414 | <xsd:list> | ||
1415 | <xsd:simpleType> | ||
1416 | <xsd:union memberTypes="xlf:XTend"> | ||
1417 | <xsd:simpleType> | ||
1418 | <xsd:restriction base="xsd:string"> | ||
1419 | <xsd:enumeration value="coord"> | ||
1420 | <xsd:annotation> | ||
1421 | <xsd:documentation>This value indicates that all information in the coord attribute can be modified.</xsd:documentation> | ||
1422 | </xsd:annotation> | ||
1423 | </xsd:enumeration> | ||
1424 | <xsd:enumeration value="coord-x"> | ||
1425 | <xsd:annotation> | ||
1426 | <xsd:documentation>This value indicates that the x information in the coord attribute can be modified.</xsd:documentation> | ||
1427 | </xsd:annotation> | ||
1428 | </xsd:enumeration> | ||
1429 | <xsd:enumeration value="coord-y"> | ||
1430 | <xsd:annotation> | ||
1431 | <xsd:documentation>This value indicates that the y information in the coord attribute can be modified.</xsd:documentation> | ||
1432 | </xsd:annotation> | ||
1433 | </xsd:enumeration> | ||
1434 | <xsd:enumeration value="coord-cx"> | ||
1435 | <xsd:annotation> | ||
1436 | <xsd:documentation>This value indicates that the cx information in the coord attribute can be modified.</xsd:documentation> | ||
1437 | </xsd:annotation> | ||
1438 | </xsd:enumeration> | ||
1439 | <xsd:enumeration value="coord-cy"> | ||
1440 | <xsd:annotation> | ||
1441 | <xsd:documentation>This value indicates that the cy information in the coord attribute can be modified.</xsd:documentation> | ||
1442 | </xsd:annotation> | ||
1443 | </xsd:enumeration> | ||
1444 | <xsd:enumeration value="font"> | ||
1445 | <xsd:annotation> | ||
1446 | <xsd:documentation>This value indicates that all the information in the font attribute can be modified.</xsd:documentation> | ||
1447 | </xsd:annotation> | ||
1448 | </xsd:enumeration> | ||
1449 | <xsd:enumeration value="font-name"> | ||
1450 | <xsd:annotation> | ||
1451 | <xsd:documentation>This value indicates that the name information in the font attribute can be modified.</xsd:documentation> | ||
1452 | </xsd:annotation> | ||
1453 | </xsd:enumeration> | ||
1454 | <xsd:enumeration value="font-size"> | ||
1455 | <xsd:annotation> | ||
1456 | <xsd:documentation>This value indicates that the size information in the font attribute can be modified.</xsd:documentation> | ||
1457 | </xsd:annotation> | ||
1458 | </xsd:enumeration> | ||
1459 | <xsd:enumeration value="font-weight"> | ||
1460 | <xsd:annotation> | ||
1461 | <xsd:documentation>This value indicates that the weight information in the font attribute can be modified.</xsd:documentation> | ||
1462 | </xsd:annotation> | ||
1463 | </xsd:enumeration> | ||
1464 | <xsd:enumeration value="css-style"> | ||
1465 | <xsd:annotation> | ||
1466 | <xsd:documentation>This value indicates that the information in the css-style attribute can be modified.</xsd:documentation> | ||
1467 | </xsd:annotation> | ||
1468 | </xsd:enumeration> | ||
1469 | <xsd:enumeration value="style"> | ||
1470 | <xsd:annotation> | ||
1471 | <xsd:documentation>This value indicates that the information in the style attribute can be modified.</xsd:documentation> | ||
1472 | </xsd:annotation> | ||
1473 | </xsd:enumeration> | ||
1474 | <xsd:enumeration value="ex-style"> | ||
1475 | <xsd:annotation> | ||
1476 | <xsd:documentation>This value indicates that the information in the exstyle attribute can be modified.</xsd:documentation> | ||
1477 | </xsd:annotation> | ||
1478 | </xsd:enumeration> | ||
1479 | </xsd:restriction> | ||
1480 | </xsd:simpleType> | ||
1481 | </xsd:union> | ||
1482 | </xsd:simpleType> | ||
1483 | </xsd:list> | ||
1484 | </xsd:simpleType> | ||
1485 | <xsd:simpleType name="purposeValueList"> | ||
1486 | <xsd:restriction base="xsd:string"> | ||
1487 | <xsd:enumeration value="information"> | ||
1488 | <xsd:annotation> | ||
1489 | <xsd:documentation>Indicates that the context is informational in nature, specifying for example, how a term should be translated. Thus, should be displayed to anyone editing the XLIFF document.</xsd:documentation> | ||
1490 | </xsd:annotation> | ||
1491 | </xsd:enumeration> | ||
1492 | <xsd:enumeration value="location"> | ||
1493 | <xsd:annotation> | ||
1494 | <xsd:documentation>Indicates that the context-group is used to specify where the term was found in the translatable source. Thus, it is not displayed.</xsd:documentation> | ||
1495 | </xsd:annotation> | ||
1496 | </xsd:enumeration> | ||
1497 | <xsd:enumeration value="match"> | ||
1498 | <xsd:annotation> | ||
1499 | <xsd:documentation>Indicates that the context information should be used during translation memory lookups. Thus, it is not displayed.</xsd:documentation> | ||
1500 | </xsd:annotation> | ||
1501 | </xsd:enumeration> | ||
1502 | </xsd:restriction> | ||
1503 | </xsd:simpleType> | ||
1504 | <xsd:simpleType name="alttranstypeValueList"> | ||
1505 | <xsd:restriction base="xsd:string"> | ||
1506 | <xsd:enumeration value="proposal"> | ||
1507 | <xsd:annotation> | ||
1508 | <xsd:documentation>Represents a translation proposal from a translation memory or other resource.</xsd:documentation> | ||
1509 | </xsd:annotation> | ||
1510 | </xsd:enumeration> | ||
1511 | <xsd:enumeration value="previous-version"> | ||
1512 | <xsd:annotation> | ||
1513 | <xsd:documentation>Represents a previous version of the target element.</xsd:documentation> | ||
1514 | </xsd:annotation> | ||
1515 | </xsd:enumeration> | ||
1516 | <xsd:enumeration value="rejected"> | ||
1517 | <xsd:annotation> | ||
1518 | <xsd:documentation>Represents a rejected version of the target element.</xsd:documentation> | ||
1519 | </xsd:annotation> | ||
1520 | </xsd:enumeration> | ||
1521 | <xsd:enumeration value="reference"> | ||
1522 | <xsd:annotation> | ||
1523 | <xsd:documentation>Represents a translation to be used for reference purposes only, for example from a related product or a different language.</xsd:documentation> | ||
1524 | </xsd:annotation> | ||
1525 | </xsd:enumeration> | ||
1526 | <xsd:enumeration value="accepted"> | ||
1527 | <xsd:annotation> | ||
1528 | <xsd:documentation>Represents a proposed translation that was used for the translation of the trans-unit, possibly modified.</xsd:documentation> | ||
1529 | </xsd:annotation> | ||
1530 | </xsd:enumeration> | ||
1531 | </xsd:restriction> | ||
1532 | </xsd:simpleType> | ||
1533 | <!-- Other Types --> | ||
1534 | <xsd:complexType name="ElemType_ExternalReference"> | ||
1535 | <xsd:choice> | ||
1536 | <xsd:element ref="xlf:internal-file"/> | ||
1537 | <xsd:element ref="xlf:external-file"/> | ||
1538 | </xsd:choice> | ||
1539 | </xsd:complexType> | ||
1540 | <xsd:simpleType name="AttrType_purpose"> | ||
1541 | <xsd:list> | ||
1542 | <xsd:simpleType> | ||
1543 | <xsd:union memberTypes="xlf:purposeValueList xlf:XTend"/> | ||
1544 | </xsd:simpleType> | ||
1545 | </xsd:list> | ||
1546 | </xsd:simpleType> | ||
1547 | <xsd:simpleType name="AttrType_datatype"> | ||
1548 | <xsd:union memberTypes="xlf:datatypeValueList xlf:XTend"/> | ||
1549 | </xsd:simpleType> | ||
1550 | <xsd:simpleType name="AttrType_restype"> | ||
1551 | <xsd:union memberTypes="xlf:restypeValueList xlf:XTend"/> | ||
1552 | </xsd:simpleType> | ||
1553 | <xsd:simpleType name="AttrType_alttranstype"> | ||
1554 | <xsd:union memberTypes="xlf:alttranstypeValueList xlf:XTend"/> | ||
1555 | </xsd:simpleType> | ||
1556 | <xsd:simpleType name="AttrType_context-type"> | ||
1557 | <xsd:union memberTypes="xlf:context-typeValueList xlf:XTend"/> | ||
1558 | </xsd:simpleType> | ||
1559 | <xsd:simpleType name="AttrType_state"> | ||
1560 | <xsd:union memberTypes="xlf:stateValueList xlf:XTend"/> | ||
1561 | </xsd:simpleType> | ||
1562 | <xsd:simpleType name="AttrType_state-qualifier"> | ||
1563 | <xsd:union memberTypes="xlf:state-qualifierValueList xlf:XTend"/> | ||
1564 | </xsd:simpleType> | ||
1565 | <xsd:simpleType name="AttrType_count-type"> | ||
1566 | <xsd:union memberTypes="xlf:restypeValueList xlf:count-typeValueList xlf:datatypeValueList xlf:stateValueList xlf:state-qualifierValueList xlf:XTend"/> | ||
1567 | </xsd:simpleType> | ||
1568 | <xsd:simpleType name="AttrType_InlineDelimiters"> | ||
1569 | <xsd:union memberTypes="xlf:InlineDelimitersValueList xlf:XTend"/> | ||
1570 | </xsd:simpleType> | ||
1571 | <xsd:simpleType name="AttrType_InlinePlaceholders"> | ||
1572 | <xsd:union memberTypes="xlf:InlinePlaceholdersValueList xlf:XTend"/> | ||
1573 | </xsd:simpleType> | ||
1574 | <xsd:simpleType name="AttrType_size-unit"> | ||
1575 | <xsd:union memberTypes="xlf:size-unitValueList xlf:XTend"/> | ||
1576 | </xsd:simpleType> | ||
1577 | <xsd:simpleType name="AttrType_mtype"> | ||
1578 | <xsd:union memberTypes="xlf:mtypeValueList xlf:XTend"/> | ||
1579 | </xsd:simpleType> | ||
1580 | <xsd:simpleType name="AttrType_unit"> | ||
1581 | <xsd:union memberTypes="xlf:unitValueList xlf:XTend"/> | ||
1582 | </xsd:simpleType> | ||
1583 | <xsd:simpleType name="AttrType_priority"> | ||
1584 | <xsd:union memberTypes="xlf:priorityValueList"/> | ||
1585 | </xsd:simpleType> | ||
1586 | <xsd:simpleType name="AttrType_reformat"> | ||
1587 | <xsd:union memberTypes="xlf:reformatValueYesNo xlf:reformatValueList"/> | ||
1588 | </xsd:simpleType> | ||
1589 | <xsd:simpleType name="AttrType_YesNo"> | ||
1590 | <xsd:restriction base="xsd:NMTOKEN"> | ||
1591 | <xsd:enumeration value="yes"/> | ||
1592 | <xsd:enumeration value="no"/> | ||
1593 | </xsd:restriction> | ||
1594 | </xsd:simpleType> | ||
1595 | <xsd:simpleType name="AttrType_Position"> | ||
1596 | <xsd:restriction base="xsd:NMTOKEN"> | ||
1597 | <xsd:enumeration value="open"/> | ||
1598 | <xsd:enumeration value="close"/> | ||
1599 | </xsd:restriction> | ||
1600 | </xsd:simpleType> | ||
1601 | <xsd:simpleType name="AttrType_assoc"> | ||
1602 | <xsd:restriction base="xsd:NMTOKEN"> | ||
1603 | <xsd:enumeration value="preceding"/> | ||
1604 | <xsd:enumeration value="following"/> | ||
1605 | <xsd:enumeration value="both"/> | ||
1606 | </xsd:restriction> | ||
1607 | </xsd:simpleType> | ||
1608 | <xsd:simpleType name="AttrType_annotates"> | ||
1609 | <xsd:restriction base="xsd:NMTOKEN"> | ||
1610 | <xsd:enumeration value="source"/> | ||
1611 | <xsd:enumeration value="target"/> | ||
1612 | <xsd:enumeration value="general"/> | ||
1613 | </xsd:restriction> | ||
1614 | </xsd:simpleType> | ||
1615 | <xsd:simpleType name="AttrType_Coordinates"> | ||
1616 | <xsd:annotation> | ||
1617 | <xsd:documentation>Values for the attribute 'coord'.</xsd:documentation> | ||
1618 | </xsd:annotation> | ||
1619 | <xsd:restriction base="xsd:string"> | ||
1620 | <xsd:pattern value="(-?\d+|#);(-?\d+|#);(-?\d+|#);(-?\d+|#)"/> | ||
1621 | </xsd:restriction> | ||
1622 | </xsd:simpleType> | ||
1623 | <xsd:simpleType name="AttrType_Version"> | ||
1624 | <xsd:annotation> | ||
1625 | <xsd:documentation>Version values: 1.0 and 1.1 are allowed for backward compatibility.</xsd:documentation> | ||
1626 | </xsd:annotation> | ||
1627 | <xsd:restriction base="xsd:string"> | ||
1628 | <xsd:enumeration value="1.2"/> | ||
1629 | <xsd:enumeration value="1.1"/> | ||
1630 | <xsd:enumeration value="1.0"/> | ||
1631 | </xsd:restriction> | ||
1632 | </xsd:simpleType> | ||
1633 | <!-- Groups --> | ||
1634 | <xsd:group name="ElemGroup_TextContent"> | ||
1635 | <xsd:choice> | ||
1636 | <xsd:element ref="xlf:g"/> | ||
1637 | <xsd:element ref="xlf:bpt"/> | ||
1638 | <xsd:element ref="xlf:ept"/> | ||
1639 | <xsd:element ref="xlf:ph"/> | ||
1640 | <xsd:element ref="xlf:it"/> | ||
1641 | <xsd:element ref="xlf:mrk"/> | ||
1642 | <xsd:element ref="xlf:x"/> | ||
1643 | <xsd:element ref="xlf:bx"/> | ||
1644 | <xsd:element ref="xlf:ex"/> | ||
1645 | </xsd:choice> | ||
1646 | </xsd:group> | ||
1647 | <xsd:attributeGroup name="AttrGroup_TextContent"> | ||
1648 | <xsd:attribute name="id" type="xsd:string" use="required"/> | ||
1649 | <xsd:attribute name="xid" type="xsd:string" use="optional"/> | ||
1650 | <xsd:attribute name="equiv-text" type="xsd:string" use="optional"/> | ||
1651 | <xsd:anyAttribute namespace="##other" processContents="strict"/> | ||
1652 | </xsd:attributeGroup> | ||
1653 | <!-- XLIFF Structure --> | ||
1654 | <xsd:element name="xliff"> | ||
1655 | <xsd:complexType> | ||
1656 | <xsd:sequence maxOccurs="unbounded"> | ||
1657 | <xsd:any maxOccurs="unbounded" minOccurs="0" namespace="##other" processContents="strict"/> | ||
1658 | <xsd:element ref="xlf:file"/> | ||
1659 | </xsd:sequence> | ||
1660 | <xsd:attribute name="version" type="xlf:AttrType_Version" use="required"/> | ||
1661 | <xsd:attribute ref="xml:lang" use="optional"/> | ||
1662 | <xsd:anyAttribute namespace="##other" processContents="strict"/> | ||
1663 | </xsd:complexType> | ||
1664 | </xsd:element> | ||
1665 | <xsd:element name="file"> | ||
1666 | <xsd:complexType> | ||
1667 | <xsd:sequence> | ||
1668 | <xsd:element minOccurs="0" ref="xlf:header"/> | ||
1669 | <xsd:element ref="xlf:body"/> | ||
1670 | </xsd:sequence> | ||
1671 | <xsd:attribute name="original" type="xsd:string" use="required"/> | ||
1672 | <xsd:attribute name="source-language" type="xsd:language" use="required"/> | ||
1673 | <xsd:attribute name="datatype" type="xlf:AttrType_datatype" use="required"/> | ||
1674 | <xsd:attribute name="tool-id" type="xsd:string" use="optional"/> | ||
1675 | <xsd:attribute name="date" type="xsd:dateTime" use="optional"/> | ||
1676 | <xsd:attribute ref="xml:space" use="optional"/> | ||
1677 | <xsd:attribute name="category" type="xsd:string" use="optional"/> | ||
1678 | <xsd:attribute name="target-language" type="xsd:language" use="optional"/> | ||
1679 | <xsd:attribute name="product-name" type="xsd:string" use="optional"/> | ||
1680 | <xsd:attribute name="product-version" type="xsd:string" use="optional"/> | ||
1681 | <xsd:attribute name="build-num" type="xsd:string" use="optional"/> | ||
1682 | <xsd:anyAttribute namespace="##other" processContents="strict"/> | ||
1683 | </xsd:complexType> | ||
1684 | <xsd:unique name="U_group_id"> | ||
1685 | <xsd:selector xpath=".//xlf:group"/> | ||
1686 | <xsd:field xpath="@id"/> | ||
1687 | </xsd:unique> | ||
1688 | <xsd:key name="K_unit_id"> | ||
1689 | <xsd:selector xpath=".//xlf:trans-unit|.//xlf:bin-unit"/> | ||
1690 | <xsd:field xpath="@id"/> | ||
1691 | </xsd:key> | ||
1692 | <xsd:keyref name="KR_unit_id" refer="xlf:K_unit_id"> | ||
1693 | <xsd:selector xpath=".//bpt|.//ept|.//it|.//ph|.//g|.//x|.//bx|.//ex|.//sub"/> | ||
1694 | <xsd:field xpath="@xid"/> | ||
1695 | </xsd:keyref> | ||
1696 | <xsd:key name="K_tool-id"> | ||
1697 | <xsd:selector xpath="xlf:header/xlf:tool"/> | ||
1698 | <xsd:field xpath="@tool-id"/> | ||
1699 | </xsd:key> | ||
1700 | <xsd:keyref name="KR_file_tool-id" refer="xlf:K_tool-id"> | ||
1701 | <xsd:selector xpath="."/> | ||
1702 | <xsd:field xpath="@tool-id"/> | ||
1703 | </xsd:keyref> | ||
1704 | <xsd:keyref name="KR_phase_tool-id" refer="xlf:K_tool-id"> | ||
1705 | <xsd:selector xpath="xlf:header/xlf:phase-group/xlf:phase"/> | ||
1706 | <xsd:field xpath="@tool-id"/> | ||
1707 | </xsd:keyref> | ||
1708 | <xsd:keyref name="KR_alt-trans_tool-id" refer="xlf:K_tool-id"> | ||
1709 | <xsd:selector xpath=".//xlf:trans-unit/xlf:alt-trans"/> | ||
1710 | <xsd:field xpath="@tool-id"/> | ||
1711 | </xsd:keyref> | ||
1712 | <xsd:key name="K_count-group_name"> | ||
1713 | <xsd:selector xpath=".//xlf:count-group"/> | ||
1714 | <xsd:field xpath="@name"/> | ||
1715 | </xsd:key> | ||
1716 | <xsd:unique name="U_context-group_name"> | ||
1717 | <xsd:selector xpath=".//xlf:context-group"/> | ||
1718 | <xsd:field xpath="@name"/> | ||
1719 | </xsd:unique> | ||
1720 | <xsd:key name="K_phase-name"> | ||
1721 | <xsd:selector xpath="xlf:header/xlf:phase-group/xlf:phase"/> | ||
1722 | <xsd:field xpath="@phase-name"/> | ||
1723 | </xsd:key> | ||
1724 | <xsd:keyref name="KR_phase-name" refer="xlf:K_phase-name"> | ||
1725 | <xsd:selector xpath=".//xlf:count|.//xlf:trans-unit|.//xlf:target|.//bin-unit|.//bin-target"/> | ||
1726 | <xsd:field xpath="@phase-name"/> | ||
1727 | </xsd:keyref> | ||
1728 | <xsd:unique name="U_uid"> | ||
1729 | <xsd:selector xpath=".//xlf:external-file"/> | ||
1730 | <xsd:field xpath="@uid"/> | ||
1731 | </xsd:unique> | ||
1732 | </xsd:element> | ||
1733 | <xsd:element name="header"> | ||
1734 | <xsd:complexType> | ||
1735 | <xsd:sequence> | ||
1736 | <xsd:element minOccurs="0" name="skl" type="xlf:ElemType_ExternalReference"/> | ||
1737 | <xsd:element minOccurs="0" ref="xlf:phase-group"/> | ||
1738 | <xsd:choice maxOccurs="unbounded" minOccurs="0"> | ||
1739 | <xsd:element name="glossary" type="xlf:ElemType_ExternalReference"/> | ||
1740 | <xsd:element name="reference" type="xlf:ElemType_ExternalReference"/> | ||
1741 | <xsd:element ref="xlf:count-group"/> | ||
1742 | <xsd:element ref="xlf:note"/> | ||
1743 | <xsd:element ref="xlf:tool"/> | ||
1744 | </xsd:choice> | ||
1745 | <xsd:any maxOccurs="unbounded" minOccurs="0" namespace="##other" processContents="strict"/> | ||
1746 | </xsd:sequence> | ||
1747 | </xsd:complexType> | ||
1748 | </xsd:element> | ||
1749 | <xsd:element name="internal-file"> | ||
1750 | <xsd:complexType> | ||
1751 | <xsd:simpleContent> | ||
1752 | <xsd:extension base="xsd:string"> | ||
1753 | <xsd:attribute name="form" type="xsd:string"/> | ||
1754 | <xsd:attribute name="crc" type="xsd:NMTOKEN"/> | ||
1755 | </xsd:extension> | ||
1756 | </xsd:simpleContent> | ||
1757 | </xsd:complexType> | ||
1758 | </xsd:element> | ||
1759 | <xsd:element name="external-file"> | ||
1760 | <xsd:complexType> | ||
1761 | <xsd:attribute name="href" type="xsd:string" use="required"/> | ||
1762 | <xsd:attribute name="crc" type="xsd:NMTOKEN"/> | ||
1763 | <xsd:attribute name="uid" type="xsd:NMTOKEN"/> | ||
1764 | </xsd:complexType> | ||
1765 | </xsd:element> | ||
1766 | <xsd:element name="note"> | ||
1767 | <xsd:complexType> | ||
1768 | <xsd:simpleContent> | ||
1769 | <xsd:extension base="xsd:string"> | ||
1770 | <xsd:attribute ref="xml:lang" use="optional"/> | ||
1771 | <xsd:attribute default="1" name="priority" type="xlf:AttrType_priority" use="optional"/> | ||
1772 | <xsd:attribute name="from" type="xsd:string" use="optional"/> | ||
1773 | <xsd:attribute default="general" name="annotates" type="xlf:AttrType_annotates" use="optional"/> | ||
1774 | </xsd:extension> | ||
1775 | </xsd:simpleContent> | ||
1776 | </xsd:complexType> | ||
1777 | </xsd:element> | ||
1778 | <xsd:element name="phase-group"> | ||
1779 | <xsd:complexType> | ||
1780 | <xsd:sequence maxOccurs="unbounded"> | ||
1781 | <xsd:element ref="xlf:phase"/> | ||
1782 | </xsd:sequence> | ||
1783 | </xsd:complexType> | ||
1784 | </xsd:element> | ||
1785 | <xsd:element name="phase"> | ||
1786 | <xsd:complexType> | ||
1787 | <xsd:sequence maxOccurs="unbounded" minOccurs="0"> | ||
1788 | <xsd:element ref="xlf:note"/> | ||
1789 | </xsd:sequence> | ||
1790 | <xsd:attribute name="phase-name" type="xsd:string" use="required"/> | ||
1791 | <xsd:attribute name="process-name" type="xsd:string" use="required"/> | ||
1792 | <xsd:attribute name="company-name" type="xsd:string" use="optional"/> | ||
1793 | <xsd:attribute name="tool-id" type="xsd:string" use="optional"/> | ||
1794 | <xsd:attribute name="date" type="xsd:dateTime" use="optional"/> | ||
1795 | <xsd:attribute name="job-id" type="xsd:string" use="optional"/> | ||
1796 | <xsd:attribute name="contact-name" type="xsd:string" use="optional"/> | ||
1797 | <xsd:attribute name="contact-email" type="xsd:string" use="optional"/> | ||
1798 | <xsd:attribute name="contact-phone" type="xsd:string" use="optional"/> | ||
1799 | </xsd:complexType> | ||
1800 | </xsd:element> | ||
1801 | <xsd:element name="count-group"> | ||
1802 | <xsd:complexType> | ||
1803 | <xsd:sequence maxOccurs="unbounded" minOccurs="0"> | ||
1804 | <xsd:element ref="xlf:count"/> | ||
1805 | </xsd:sequence> | ||
1806 | <xsd:attribute name="name" type="xsd:string" use="required"/> | ||
1807 | </xsd:complexType> | ||
1808 | </xsd:element> | ||
1809 | <xsd:element name="count"> | ||
1810 | <xsd:complexType> | ||
1811 | <xsd:simpleContent> | ||
1812 | <xsd:extension base="xsd:string"> | ||
1813 | <xsd:attribute name="count-type" type="xlf:AttrType_count-type" use="optional"/> | ||
1814 | <xsd:attribute name="phase-name" type="xsd:string" use="optional"/> | ||
1815 | <xsd:attribute default="word" name="unit" type="xlf:AttrType_unit" use="optional"/> | ||
1816 | </xsd:extension> | ||
1817 | </xsd:simpleContent> | ||
1818 | </xsd:complexType> | ||
1819 | </xsd:element> | ||
1820 | <xsd:element name="context-group"> | ||
1821 | <xsd:complexType> | ||
1822 | <xsd:sequence maxOccurs="unbounded"> | ||
1823 | <xsd:element ref="xlf:context"/> | ||
1824 | </xsd:sequence> | ||
1825 | <xsd:attribute name="name" type="xsd:string" use="optional"/> | ||
1826 | <xsd:attribute name="crc" type="xsd:NMTOKEN" use="optional"/> | ||
1827 | <xsd:attribute name="purpose" type="xlf:AttrType_purpose" use="optional"/> | ||
1828 | </xsd:complexType> | ||
1829 | </xsd:element> | ||
1830 | <xsd:element name="context"> | ||
1831 | <xsd:complexType> | ||
1832 | <xsd:simpleContent> | ||
1833 | <xsd:extension base="xsd:string"> | ||
1834 | <xsd:attribute name="context-type" type="xlf:AttrType_context-type" use="required"/> | ||
1835 | <xsd:attribute default="no" name="match-mandatory" type="xlf:AttrType_YesNo" use="optional"/> | ||
1836 | <xsd:attribute name="crc" type="xsd:NMTOKEN" use="optional"/> | ||
1837 | </xsd:extension> | ||
1838 | </xsd:simpleContent> | ||
1839 | </xsd:complexType> | ||
1840 | </xsd:element> | ||
1841 | <xsd:element name="tool"> | ||
1842 | <xsd:complexType mixed="true"> | ||
1843 | <xsd:sequence> | ||
1844 | <xsd:any namespace="##any" processContents="strict" minOccurs="0" maxOccurs="unbounded"/> | ||
1845 | </xsd:sequence> | ||
1846 | <xsd:attribute name="tool-id" type="xsd:string" use="required"/> | ||
1847 | <xsd:attribute name="tool-name" type="xsd:string" use="required"/> | ||
1848 | <xsd:attribute name="tool-version" type="xsd:string" use="optional"/> | ||
1849 | <xsd:attribute name="tool-company" type="xsd:string" use="optional"/> | ||
1850 | <xsd:anyAttribute namespace="##other" processContents="strict"/> | ||
1851 | </xsd:complexType> | ||
1852 | </xsd:element> | ||
1853 | <xsd:element name="body"> | ||
1854 | <xsd:complexType> | ||
1855 | <xsd:choice maxOccurs="unbounded" minOccurs="0"> | ||
1856 | <xsd:element maxOccurs="unbounded" minOccurs="0" ref="xlf:group"/> | ||
1857 | <xsd:element maxOccurs="unbounded" minOccurs="0" ref="xlf:trans-unit"/> | ||
1858 | <xsd:element maxOccurs="unbounded" minOccurs="0" ref="xlf:bin-unit"/> | ||
1859 | </xsd:choice> | ||
1860 | </xsd:complexType> | ||
1861 | </xsd:element> | ||
1862 | <xsd:element name="group"> | ||
1863 | <xsd:complexType> | ||
1864 | <xsd:sequence> | ||
1865 | <xsd:sequence> | ||
1866 | <xsd:element maxOccurs="unbounded" minOccurs="0" ref="xlf:context-group"/> | ||
1867 | <xsd:element maxOccurs="unbounded" minOccurs="0" ref="xlf:count-group"/> | ||
1868 | <xsd:element maxOccurs="unbounded" minOccurs="0" ref="xlf:note"/> | ||
1869 | <xsd:any maxOccurs="unbounded" minOccurs="0" namespace="##other" processContents="strict"/> | ||
1870 | </xsd:sequence> | ||
1871 | <xsd:choice maxOccurs="unbounded"> | ||
1872 | <xsd:element maxOccurs="unbounded" minOccurs="0" ref="xlf:group"/> | ||
1873 | <xsd:element maxOccurs="unbounded" minOccurs="0" ref="xlf:trans-unit"/> | ||
1874 | <xsd:element maxOccurs="unbounded" minOccurs="0" ref="xlf:bin-unit"/> | ||
1875 | </xsd:choice> | ||
1876 | </xsd:sequence> | ||
1877 | <xsd:attribute name="id" type="xsd:string" use="optional"/> | ||
1878 | <xsd:attribute name="datatype" type="xlf:AttrType_datatype" use="optional"/> | ||
1879 | <xsd:attribute default="default" ref="xml:space" use="optional"/> | ||
1880 | <xsd:attribute name="restype" type="xlf:AttrType_restype" use="optional"/> | ||
1881 | <xsd:attribute name="resname" type="xsd:string" use="optional"/> | ||
1882 | <xsd:attribute name="extradata" type="xsd:string" use="optional"/> | ||
1883 | <xsd:attribute name="extype" type="xsd:string" use="optional"/> | ||
1884 | <xsd:attribute name="help-id" type="xsd:NMTOKEN" use="optional"/> | ||
1885 | <xsd:attribute name="menu" type="xsd:string" use="optional"/> | ||
1886 | <xsd:attribute name="menu-option" type="xsd:string" use="optional"/> | ||
1887 | <xsd:attribute name="menu-name" type="xsd:string" use="optional"/> | ||
1888 | <xsd:attribute name="coord" type="xlf:AttrType_Coordinates" use="optional"/> | ||
1889 | <xsd:attribute name="font" type="xsd:string" use="optional"/> | ||
1890 | <xsd:attribute name="css-style" type="xsd:string" use="optional"/> | ||
1891 | <xsd:attribute name="style" type="xsd:NMTOKEN" use="optional"/> | ||
1892 | <xsd:attribute name="exstyle" type="xsd:NMTOKEN" use="optional"/> | ||
1893 | <xsd:attribute default="yes" name="translate" type="xlf:AttrType_YesNo" use="optional"/> | ||
1894 | <xsd:attribute default="yes" name="reformat" type="xlf:AttrType_reformat" use="optional"/> | ||
1895 | <xsd:attribute default="pixel" name="size-unit" type="xlf:AttrType_size-unit" use="optional"/> | ||
1896 | <xsd:attribute name="maxwidth" type="xsd:NMTOKEN" use="optional"/> | ||
1897 | <xsd:attribute name="minwidth" type="xsd:NMTOKEN" use="optional"/> | ||
1898 | <xsd:attribute name="maxheight" type="xsd:NMTOKEN" use="optional"/> | ||
1899 | <xsd:attribute name="minheight" type="xsd:NMTOKEN" use="optional"/> | ||
1900 | <xsd:attribute name="maxbytes" type="xsd:NMTOKEN" use="optional"/> | ||
1901 | <xsd:attribute name="minbytes" type="xsd:NMTOKEN" use="optional"/> | ||
1902 | <xsd:attribute name="charclass" type="xsd:string" use="optional"/> | ||
1903 | <xsd:attribute default="no" name="merged-trans" type="xlf:AttrType_YesNo" use="optional"/> | ||
1904 | <xsd:anyAttribute namespace="##other" processContents="strict"/> | ||
1905 | </xsd:complexType> | ||
1906 | </xsd:element> | ||
1907 | <xsd:element name="trans-unit"> | ||
1908 | <xsd:complexType> | ||
1909 | <xsd:sequence> | ||
1910 | <xsd:element ref="xlf:source"/> | ||
1911 | <xsd:element minOccurs="0" ref="xlf:seg-source"/> | ||
1912 | <xsd:element minOccurs="0" ref="xlf:target"/> | ||
1913 | <xsd:choice maxOccurs="unbounded" minOccurs="0"> | ||
1914 | <xsd:element ref="xlf:context-group"/> | ||
1915 | <xsd:element ref="xlf:count-group"/> | ||
1916 | <xsd:element ref="xlf:note"/> | ||
1917 | <xsd:element ref="xlf:alt-trans"/> | ||
1918 | </xsd:choice> | ||
1919 | <xsd:any maxOccurs="unbounded" minOccurs="0" namespace="##other" processContents="strict"/> | ||
1920 | </xsd:sequence> | ||
1921 | <xsd:attribute name="id" type="xsd:string" use="required"/> | ||
1922 | <xsd:attribute name="approved" type="xlf:AttrType_YesNo" use="optional"/> | ||
1923 | <xsd:attribute default="yes" name="translate" type="xlf:AttrType_YesNo" use="optional"/> | ||
1924 | <xsd:attribute default="yes" name="reformat" type="xlf:AttrType_reformat" use="optional"/> | ||
1925 | <xsd:attribute default="default" ref="xml:space" use="optional"/> | ||
1926 | <xsd:attribute name="datatype" type="xlf:AttrType_datatype" use="optional"/> | ||
1927 | <xsd:attribute name="phase-name" type="xsd:string" use="optional"/> | ||
1928 | <xsd:attribute name="restype" type="xlf:AttrType_restype" use="optional"/> | ||
1929 | <xsd:attribute name="resname" type="xsd:string" use="optional"/> | ||
1930 | <xsd:attribute name="extradata" type="xsd:string" use="optional"/> | ||
1931 | <xsd:attribute name="extype" type="xsd:string" use="optional"/> | ||
1932 | <xsd:attribute name="help-id" type="xsd:NMTOKEN" use="optional"/> | ||
1933 | <xsd:attribute name="menu" type="xsd:string" use="optional"/> | ||
1934 | <xsd:attribute name="menu-option" type="xsd:string" use="optional"/> | ||
1935 | <xsd:attribute name="menu-name" type="xsd:string" use="optional"/> | ||
1936 | <xsd:attribute name="coord" type="xlf:AttrType_Coordinates" use="optional"/> | ||
1937 | <xsd:attribute name="font" type="xsd:string" use="optional"/> | ||
1938 | <xsd:attribute name="css-style" type="xsd:string" use="optional"/> | ||
1939 | <xsd:attribute name="style" type="xsd:NMTOKEN" use="optional"/> | ||
1940 | <xsd:attribute name="exstyle" type="xsd:NMTOKEN" use="optional"/> | ||
1941 | <xsd:attribute default="pixel" name="size-unit" type="xlf:AttrType_size-unit" use="optional"/> | ||
1942 | <xsd:attribute name="maxwidth" type="xsd:NMTOKEN" use="optional"/> | ||
1943 | <xsd:attribute name="minwidth" type="xsd:NMTOKEN" use="optional"/> | ||
1944 | <xsd:attribute name="maxheight" type="xsd:NMTOKEN" use="optional"/> | ||
1945 | <xsd:attribute name="minheight" type="xsd:NMTOKEN" use="optional"/> | ||
1946 | <xsd:attribute name="maxbytes" type="xsd:NMTOKEN" use="optional"/> | ||
1947 | <xsd:attribute name="minbytes" type="xsd:NMTOKEN" use="optional"/> | ||
1948 | <xsd:attribute name="charclass" type="xsd:string" use="optional"/> | ||
1949 | <xsd:attribute default="yes" name="merged-trans" type="xlf:AttrType_YesNo" use="optional"/> | ||
1950 | <xsd:anyAttribute namespace="##other" processContents="strict"/> | ||
1951 | </xsd:complexType> | ||
1952 | <xsd:unique name="U_tu_segsrc_mid"> | ||
1953 | <xsd:selector xpath="./xlf:seg-source/xlf:mrk"/> | ||
1954 | <xsd:field xpath="@mid"/> | ||
1955 | </xsd:unique> | ||
1956 | <xsd:keyref name="KR_tu_segsrc_mid" refer="xlf:U_tu_segsrc_mid"> | ||
1957 | <xsd:selector xpath="./xlf:target/xlf:mrk|./xlf:alt-trans"/> | ||
1958 | <xsd:field xpath="@mid"/> | ||
1959 | </xsd:keyref> | ||
1960 | </xsd:element> | ||
1961 | <xsd:element name="source"> | ||
1962 | <xsd:complexType mixed="true"> | ||
1963 | <xsd:group maxOccurs="unbounded" minOccurs="0" ref="xlf:ElemGroup_TextContent"/> | ||
1964 | <xsd:attribute ref="xml:lang" use="optional"/> | ||
1965 | <xsd:anyAttribute namespace="##other" processContents="strict"/> | ||
1966 | </xsd:complexType> | ||
1967 | <xsd:unique name="U_source_bpt_rid"> | ||
1968 | <xsd:selector xpath=".//xlf:bpt"/> | ||
1969 | <xsd:field xpath="@rid"/> | ||
1970 | </xsd:unique> | ||
1971 | <xsd:keyref name="KR_source_ept_rid" refer="xlf:U_source_bpt_rid"> | ||
1972 | <xsd:selector xpath=".//xlf:ept"/> | ||
1973 | <xsd:field xpath="@rid"/> | ||
1974 | </xsd:keyref> | ||
1975 | <xsd:unique name="U_source_bx_rid"> | ||
1976 | <xsd:selector xpath=".//xlf:bx"/> | ||
1977 | <xsd:field xpath="@rid"/> | ||
1978 | </xsd:unique> | ||
1979 | <xsd:keyref name="KR_source_ex_rid" refer="xlf:U_source_bx_rid"> | ||
1980 | <xsd:selector xpath=".//xlf:ex"/> | ||
1981 | <xsd:field xpath="@rid"/> | ||
1982 | </xsd:keyref> | ||
1983 | </xsd:element> | ||
1984 | <xsd:element name="seg-source"> | ||
1985 | <xsd:complexType mixed="true"> | ||
1986 | <xsd:group maxOccurs="unbounded" minOccurs="0" ref="xlf:ElemGroup_TextContent"/> | ||
1987 | <xsd:attribute ref="xml:lang" use="optional"/> | ||
1988 | <xsd:anyAttribute namespace="##other" processContents="strict"/> | ||
1989 | </xsd:complexType> | ||
1990 | <xsd:unique name="U_segsrc_bpt_rid"> | ||
1991 | <xsd:selector xpath=".//xlf:bpt"/> | ||
1992 | <xsd:field xpath="@rid"/> | ||
1993 | </xsd:unique> | ||
1994 | <xsd:keyref name="KR_segsrc_ept_rid" refer="xlf:U_segsrc_bpt_rid"> | ||
1995 | <xsd:selector xpath=".//xlf:ept"/> | ||
1996 | <xsd:field xpath="@rid"/> | ||
1997 | </xsd:keyref> | ||
1998 | <xsd:unique name="U_segsrc_bx_rid"> | ||
1999 | <xsd:selector xpath=".//xlf:bx"/> | ||
2000 | <xsd:field xpath="@rid"/> | ||
2001 | </xsd:unique> | ||
2002 | <xsd:keyref name="KR_segsrc_ex_rid" refer="xlf:U_segsrc_bx_rid"> | ||
2003 | <xsd:selector xpath=".//xlf:ex"/> | ||
2004 | <xsd:field xpath="@rid"/> | ||
2005 | </xsd:keyref> | ||
2006 | </xsd:element> | ||
2007 | <xsd:element name="target"> | ||
2008 | <xsd:complexType mixed="true"> | ||
2009 | <xsd:group maxOccurs="unbounded" minOccurs="0" ref="xlf:ElemGroup_TextContent"/> | ||
2010 | <xsd:attribute name="state" type="xlf:AttrType_state" use="optional"/> | ||
2011 | <xsd:attribute name="state-qualifier" type="xlf:AttrType_state-qualifier" use="optional"/> | ||
2012 | <xsd:attribute name="phase-name" type="xsd:NMTOKEN" use="optional"/> | ||
2013 | <xsd:attribute ref="xml:lang" use="optional"/> | ||
2014 | <xsd:attribute name="resname" type="xsd:string" use="optional"/> | ||
2015 | <xsd:attribute name="coord" type="xlf:AttrType_Coordinates" use="optional"/> | ||
2016 | <xsd:attribute name="font" type="xsd:string" use="optional"/> | ||
2017 | <xsd:attribute name="css-style" type="xsd:string" use="optional"/> | ||
2018 | <xsd:attribute name="style" type="xsd:NMTOKEN" use="optional"/> | ||
2019 | <xsd:attribute name="exstyle" type="xsd:NMTOKEN" use="optional"/> | ||
2020 | <xsd:attribute default="yes" name="equiv-trans" type="xlf:AttrType_YesNo" use="optional"/> | ||
2021 | <xsd:anyAttribute namespace="##other" processContents="strict"/> | ||
2022 | </xsd:complexType> | ||
2023 | <xsd:unique name="U_target_bpt_rid"> | ||
2024 | <xsd:selector xpath=".//xlf:bpt"/> | ||
2025 | <xsd:field xpath="@rid"/> | ||
2026 | </xsd:unique> | ||
2027 | <xsd:keyref name="KR_target_ept_rid" refer="xlf:U_target_bpt_rid"> | ||
2028 | <xsd:selector xpath=".//xlf:ept"/> | ||
2029 | <xsd:field xpath="@rid"/> | ||
2030 | </xsd:keyref> | ||
2031 | <xsd:unique name="U_target_bx_rid"> | ||
2032 | <xsd:selector xpath=".//xlf:bx"/> | ||
2033 | <xsd:field xpath="@rid"/> | ||
2034 | </xsd:unique> | ||
2035 | <xsd:keyref name="KR_target_ex_rid" refer="xlf:U_target_bx_rid"> | ||
2036 | <xsd:selector xpath=".//xlf:ex"/> | ||
2037 | <xsd:field xpath="@rid"/> | ||
2038 | </xsd:keyref> | ||
2039 | </xsd:element> | ||
2040 | <xsd:element name="alt-trans"> | ||
2041 | <xsd:complexType> | ||
2042 | <xsd:sequence> | ||
2043 | <xsd:element minOccurs="0" ref="xlf:source"/> | ||
2044 | <xsd:element minOccurs="0" ref="xlf:seg-source"/> | ||
2045 | <xsd:element maxOccurs="1" ref="xlf:target"/> | ||
2046 | <xsd:element maxOccurs="unbounded" minOccurs="0" ref="xlf:context-group"/> | ||
2047 | <xsd:element maxOccurs="unbounded" minOccurs="0" ref="xlf:note"/> | ||
2048 | <xsd:any maxOccurs="unbounded" minOccurs="0" namespace="##other" processContents="strict"/> | ||
2049 | </xsd:sequence> | ||
2050 | <xsd:attribute name="match-quality" type="xsd:string" use="optional"/> | ||
2051 | <xsd:attribute name="tool-id" type="xsd:string" use="optional"/> | ||
2052 | <xsd:attribute name="crc" type="xsd:NMTOKEN" use="optional"/> | ||
2053 | <xsd:attribute ref="xml:lang" use="optional"/> | ||
2054 | <xsd:attribute name="origin" type="xsd:string" use="optional"/> | ||
2055 | <xsd:attribute name="datatype" type="xlf:AttrType_datatype" use="optional"/> | ||
2056 | <xsd:attribute default="default" ref="xml:space" use="optional"/> | ||
2057 | <xsd:attribute name="restype" type="xlf:AttrType_restype" use="optional"/> | ||
2058 | <xsd:attribute name="resname" type="xsd:string" use="optional"/> | ||
2059 | <xsd:attribute name="extradata" type="xsd:string" use="optional"/> | ||
2060 | <xsd:attribute name="extype" type="xsd:string" use="optional"/> | ||
2061 | <xsd:attribute name="help-id" type="xsd:NMTOKEN" use="optional"/> | ||
2062 | <xsd:attribute name="menu" type="xsd:string" use="optional"/> | ||
2063 | <xsd:attribute name="menu-option" type="xsd:string" use="optional"/> | ||
2064 | <xsd:attribute name="menu-name" type="xsd:string" use="optional"/> | ||
2065 | <xsd:attribute name="mid" type="xsd:NMTOKEN" use="optional"/> | ||
2066 | <xsd:attribute name="coord" type="xlf:AttrType_Coordinates" use="optional"/> | ||
2067 | <xsd:attribute name="font" type="xsd:string" use="optional"/> | ||
2068 | <xsd:attribute name="css-style" type="xsd:string" use="optional"/> | ||
2069 | <xsd:attribute name="style" type="xsd:NMTOKEN" use="optional"/> | ||
2070 | <xsd:attribute name="exstyle" type="xsd:NMTOKEN" use="optional"/> | ||
2071 | <xsd:attribute name="phase-name" type="xsd:NMTOKEN" use="optional"/> | ||
2072 | <xsd:attribute default="proposal" name="alttranstype" type="xlf:AttrType_alttranstype" use="optional"/> | ||
2073 | <xsd:anyAttribute namespace="##other" processContents="strict"/> | ||
2074 | </xsd:complexType> | ||
2075 | <xsd:unique name="U_at_segsrc_mid"> | ||
2076 | <xsd:selector xpath="./xlf:seg-source/xlf:mrk"/> | ||
2077 | <xsd:field xpath="@mid"/> | ||
2078 | </xsd:unique> | ||
2079 | <xsd:keyref name="KR_at_segsrc_mid" refer="xlf:U_at_segsrc_mid"> | ||
2080 | <xsd:selector xpath="./xlf:target/xlf:mrk"/> | ||
2081 | <xsd:field xpath="@mid"/> | ||
2082 | </xsd:keyref> | ||
2083 | </xsd:element> | ||
2084 | <xsd:element name="bin-unit"> | ||
2085 | <xsd:complexType> | ||
2086 | <xsd:sequence> | ||
2087 | <xsd:element ref="xlf:bin-source"/> | ||
2088 | <xsd:element minOccurs="0" ref="xlf:bin-target"/> | ||
2089 | <xsd:choice maxOccurs="unbounded" minOccurs="0"> | ||
2090 | <xsd:element ref="xlf:context-group"/> | ||
2091 | <xsd:element ref="xlf:count-group"/> | ||
2092 | <xsd:element ref="xlf:note"/> | ||
2093 | <xsd:element ref="xlf:trans-unit"/> | ||
2094 | </xsd:choice> | ||
2095 | <xsd:any maxOccurs="unbounded" minOccurs="0" namespace="##other" processContents="strict"/> | ||
2096 | </xsd:sequence> | ||
2097 | <xsd:attribute name="id" type="xsd:string" use="required"/> | ||
2098 | <xsd:attribute name="mime-type" type="xlf:mime-typeValueList" use="required"/> | ||
2099 | <xsd:attribute name="approved" type="xlf:AttrType_YesNo" use="optional"/> | ||
2100 | <xsd:attribute default="yes" name="translate" type="xlf:AttrType_YesNo" use="optional"/> | ||
2101 | <xsd:attribute default="yes" name="reformat" type="xlf:AttrType_reformat" use="optional"/> | ||
2102 | <xsd:attribute name="restype" type="xlf:AttrType_restype" use="optional"/> | ||
2103 | <xsd:attribute name="resname" type="xsd:string" use="optional"/> | ||
2104 | <xsd:attribute name="phase-name" type="xsd:string" use="optional"/> | ||
2105 | <xsd:anyAttribute namespace="##other" processContents="strict"/> | ||
2106 | </xsd:complexType> | ||
2107 | </xsd:element> | ||
2108 | <xsd:element name="bin-source"> | ||
2109 | <xsd:complexType> | ||
2110 | <xsd:choice> | ||
2111 | <xsd:element ref="xlf:internal-file"/> | ||
2112 | <xsd:element ref="xlf:external-file"/> | ||
2113 | </xsd:choice> | ||
2114 | <xsd:anyAttribute namespace="##other" processContents="strict"/> | ||
2115 | </xsd:complexType> | ||
2116 | </xsd:element> | ||
2117 | <xsd:element name="bin-target"> | ||
2118 | <xsd:complexType> | ||
2119 | <xsd:choice> | ||
2120 | <xsd:element ref="xlf:internal-file"/> | ||
2121 | <xsd:element ref="xlf:external-file"/> | ||
2122 | </xsd:choice> | ||
2123 | <xsd:attribute name="mime-type" type="xlf:mime-typeValueList" use="optional"/> | ||
2124 | <xsd:attribute name="state" type="xlf:AttrType_state" use="optional"/> | ||
2125 | <xsd:attribute name="state-qualifier" type="xlf:AttrType_state-qualifier" use="optional"/> | ||
2126 | <xsd:attribute name="phase-name" type="xsd:NMTOKEN" use="optional"/> | ||
2127 | <xsd:attribute name="restype" type="xlf:AttrType_restype" use="optional"/> | ||
2128 | <xsd:attribute name="resname" type="xsd:string" use="optional"/> | ||
2129 | <xsd:anyAttribute namespace="##other" processContents="strict"/> | ||
2130 | </xsd:complexType> | ||
2131 | </xsd:element> | ||
2132 | <!-- Element for inline codes --> | ||
2133 | <xsd:element name="g"> | ||
2134 | <xsd:complexType mixed="true"> | ||
2135 | <xsd:group maxOccurs="unbounded" minOccurs="0" ref="xlf:ElemGroup_TextContent"/> | ||
2136 | <xsd:attribute name="ctype" type="xlf:AttrType_InlineDelimiters" use="optional"/> | ||
2137 | <xsd:attribute default="yes" name="clone" type="xlf:AttrType_YesNo" use="optional"/> | ||
2138 | <xsd:attributeGroup ref="xlf:AttrGroup_TextContent"/> | ||
2139 | </xsd:complexType> | ||
2140 | </xsd:element> | ||
2141 | <xsd:element name="x"> | ||
2142 | <xsd:complexType> | ||
2143 | <xsd:attribute name="ctype" type="xlf:AttrType_InlinePlaceholders" use="optional"/> | ||
2144 | <xsd:attribute default="yes" name="clone" type="xlf:AttrType_YesNo" use="optional"/> | ||
2145 | <xsd:attributeGroup ref="xlf:AttrGroup_TextContent"/> | ||
2146 | </xsd:complexType> | ||
2147 | </xsd:element> | ||
2148 | <xsd:element name="bx"> | ||
2149 | <xsd:complexType> | ||
2150 | <xsd:attribute name="rid" type="xsd:NMTOKEN" use="optional"/> | ||
2151 | <xsd:attribute name="ctype" type="xlf:AttrType_InlineDelimiters" use="optional"/> | ||
2152 | <xsd:attribute default="yes" name="clone" type="xlf:AttrType_YesNo" use="optional"/> | ||
2153 | <xsd:attributeGroup ref="xlf:AttrGroup_TextContent"/> | ||
2154 | </xsd:complexType> | ||
2155 | </xsd:element> | ||
2156 | <xsd:element name="ex"> | ||
2157 | <xsd:complexType> | ||
2158 | <xsd:attribute name="rid" type="xsd:NMTOKEN" use="optional"/> | ||
2159 | <xsd:attributeGroup ref="xlf:AttrGroup_TextContent"/> | ||
2160 | </xsd:complexType> | ||
2161 | </xsd:element> | ||
2162 | <xsd:element name="ph"> | ||
2163 | <xsd:complexType mixed="true"> | ||
2164 | <xsd:sequence maxOccurs="unbounded" minOccurs="0"> | ||
2165 | <xsd:element ref="xlf:sub"/> | ||
2166 | </xsd:sequence> | ||
2167 | <xsd:attribute name="ctype" type="xlf:AttrType_InlinePlaceholders" use="optional"/> | ||
2168 | <xsd:attribute name="crc" type="xsd:string" use="optional"/> | ||
2169 | <xsd:attribute name="assoc" type="xlf:AttrType_assoc" use="optional"/> | ||
2170 | <xsd:attributeGroup ref="xlf:AttrGroup_TextContent"/> | ||
2171 | </xsd:complexType> | ||
2172 | </xsd:element> | ||
2173 | <xsd:element name="bpt"> | ||
2174 | <xsd:complexType mixed="true"> | ||
2175 | <xsd:sequence maxOccurs="unbounded" minOccurs="0"> | ||
2176 | <xsd:element ref="xlf:sub"/> | ||
2177 | </xsd:sequence> | ||
2178 | <xsd:attribute name="rid" type="xsd:NMTOKEN" use="optional"/> | ||
2179 | <xsd:attribute name="ctype" type="xlf:AttrType_InlineDelimiters" use="optional"/> | ||
2180 | <xsd:attribute name="crc" type="xsd:string" use="optional"/> | ||
2181 | <xsd:attributeGroup ref="xlf:AttrGroup_TextContent"/> | ||
2182 | </xsd:complexType> | ||
2183 | </xsd:element> | ||
2184 | <xsd:element name="ept"> | ||
2185 | <xsd:complexType mixed="true"> | ||
2186 | <xsd:sequence maxOccurs="unbounded" minOccurs="0"> | ||
2187 | <xsd:element ref="xlf:sub"/> | ||
2188 | </xsd:sequence> | ||
2189 | <xsd:attribute name="rid" type="xsd:NMTOKEN" use="optional"/> | ||
2190 | <xsd:attribute name="crc" type="xsd:string" use="optional"/> | ||
2191 | <xsd:attributeGroup ref="xlf:AttrGroup_TextContent"/> | ||
2192 | </xsd:complexType> | ||
2193 | </xsd:element> | ||
2194 | <xsd:element name="it"> | ||
2195 | <xsd:complexType mixed="true"> | ||
2196 | <xsd:sequence maxOccurs="unbounded" minOccurs="0"> | ||
2197 | <xsd:element ref="xlf:sub"/> | ||
2198 | </xsd:sequence> | ||
2199 | <xsd:attribute name="pos" type="xlf:AttrType_Position" use="required"/> | ||
2200 | <xsd:attribute name="rid" type="xsd:NMTOKEN" use="optional"/> | ||
2201 | <xsd:attribute name="ctype" type="xlf:AttrType_InlineDelimiters" use="optional"/> | ||
2202 | <xsd:attribute name="crc" type="xsd:string" use="optional"/> | ||
2203 | <xsd:attributeGroup ref="xlf:AttrGroup_TextContent"/> | ||
2204 | </xsd:complexType> | ||
2205 | </xsd:element> | ||
2206 | <xsd:element name="sub"> | ||
2207 | <xsd:complexType mixed="true"> | ||
2208 | <xsd:group maxOccurs="unbounded" minOccurs="0" ref="xlf:ElemGroup_TextContent"/> | ||
2209 | <xsd:attribute name="datatype" type="xlf:AttrType_datatype" use="optional"/> | ||
2210 | <xsd:attribute name="ctype" type="xlf:AttrType_InlineDelimiters" use="optional"/> | ||
2211 | <xsd:attribute name="xid" type="xsd:string" use="optional"/> | ||
2212 | </xsd:complexType> | ||
2213 | </xsd:element> | ||
2214 | <xsd:element name="mrk"> | ||
2215 | <xsd:complexType mixed="true"> | ||
2216 | <xsd:group maxOccurs="unbounded" minOccurs="0" ref="xlf:ElemGroup_TextContent"/> | ||
2217 | <xsd:attribute name="mtype" type="xlf:AttrType_mtype" use="required"/> | ||
2218 | <xsd:attribute name="mid" type="xsd:NMTOKEN" use="optional"/> | ||
2219 | <xsd:attribute name="comment" type="xsd:string" use="optional"/> | ||
2220 | <xsd:anyAttribute namespace="##other" processContents="strict"/> | ||
2221 | </xsd:complexType> | ||
2222 | </xsd:element> | ||
2223 | </xsd:schema> | ||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Loader/schema/dic/xliff-core/xml.xsd b/vendor/symfony/translation/Symfony/Component/Translation/Loader/schema/dic/xliff-core/xml.xsd deleted file mode 100644 index 8fcb991a..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/Loader/schema/dic/xliff-core/xml.xsd +++ /dev/null | |||
@@ -1,309 +0,0 @@ | |||
1 | <?xml version='1.0'?> | ||
2 | <?xml-stylesheet href="../2008/09/xsd.xsl" type="text/xsl"?> | ||
3 | <xs:schema targetNamespace="http://www.w3.org/XML/1998/namespace" | ||
4 | xmlns:xs="http://www.w3.org/2001/XMLSchema" | ||
5 | xmlns ="http://www.w3.org/1999/xhtml" | ||
6 | xml:lang="en"> | ||
7 | |||
8 | <xs:annotation> | ||
9 | <xs:documentation> | ||
10 | <div> | ||
11 | <h1>About the XML namespace</h1> | ||
12 | |||
13 | <div class="bodytext"> | ||
14 | <p> | ||
15 | |||
16 | This schema document describes the XML namespace, in a form | ||
17 | suitable for import by other schema documents. | ||
18 | </p> | ||
19 | <p> | ||
20 | See <a href="http://www.w3.org/XML/1998/namespace.html"> | ||
21 | http://www.w3.org/XML/1998/namespace.html</a> and | ||
22 | <a href="http://www.w3.org/TR/REC-xml"> | ||
23 | http://www.w3.org/TR/REC-xml</a> for information | ||
24 | about this namespace. | ||
25 | </p> | ||
26 | |||
27 | <p> | ||
28 | Note that local names in this namespace are intended to be | ||
29 | defined only by the World Wide Web Consortium or its subgroups. | ||
30 | The names currently defined in this namespace are listed below. | ||
31 | They should not be used with conflicting semantics by any Working | ||
32 | Group, specification, or document instance. | ||
33 | </p> | ||
34 | <p> | ||
35 | See further below in this document for more information about <a | ||
36 | href="#usage">how to refer to this schema document from your own | ||
37 | XSD schema documents</a> and about <a href="#nsversioning">the | ||
38 | namespace-versioning policy governing this schema document</a>. | ||
39 | </p> | ||
40 | </div> | ||
41 | </div> | ||
42 | |||
43 | </xs:documentation> | ||
44 | </xs:annotation> | ||
45 | |||
46 | <xs:attribute name="lang"> | ||
47 | <xs:annotation> | ||
48 | <xs:documentation> | ||
49 | <div> | ||
50 | |||
51 | <h3>lang (as an attribute name)</h3> | ||
52 | <p> | ||
53 | |||
54 | denotes an attribute whose value | ||
55 | is a language code for the natural language of the content of | ||
56 | any element; its value is inherited. This name is reserved | ||
57 | by virtue of its definition in the XML specification.</p> | ||
58 | |||
59 | </div> | ||
60 | <div> | ||
61 | <h4>Notes</h4> | ||
62 | <p> | ||
63 | Attempting to install the relevant ISO 2- and 3-letter | ||
64 | codes as the enumerated possible values is probably never | ||
65 | going to be a realistic possibility. | ||
66 | </p> | ||
67 | <p> | ||
68 | |||
69 | See BCP 47 at <a href="http://www.rfc-editor.org/rfc/bcp/bcp47.txt"> | ||
70 | http://www.rfc-editor.org/rfc/bcp/bcp47.txt</a> | ||
71 | and the IANA language subtag registry at | ||
72 | <a href="http://www.iana.org/assignments/language-subtag-registry"> | ||
73 | http://www.iana.org/assignments/language-subtag-registry</a> | ||
74 | for further information. | ||
75 | </p> | ||
76 | <p> | ||
77 | |||
78 | The union allows for the 'un-declaration' of xml:lang with | ||
79 | the empty string. | ||
80 | </p> | ||
81 | </div> | ||
82 | </xs:documentation> | ||
83 | </xs:annotation> | ||
84 | <xs:simpleType> | ||
85 | <xs:union memberTypes="xs:language"> | ||
86 | <xs:simpleType> | ||
87 | <xs:restriction base="xs:string"> | ||
88 | <xs:enumeration value=""/> | ||
89 | |||
90 | </xs:restriction> | ||
91 | </xs:simpleType> | ||
92 | </xs:union> | ||
93 | </xs:simpleType> | ||
94 | </xs:attribute> | ||
95 | |||
96 | <xs:attribute name="space"> | ||
97 | <xs:annotation> | ||
98 | <xs:documentation> | ||
99 | |||
100 | <div> | ||
101 | |||
102 | <h3>space (as an attribute name)</h3> | ||
103 | <p> | ||
104 | denotes an attribute whose | ||
105 | value is a keyword indicating what whitespace processing | ||
106 | discipline is intended for the content of the element; its | ||
107 | value is inherited. This name is reserved by virtue of its | ||
108 | definition in the XML specification.</p> | ||
109 | |||
110 | </div> | ||
111 | </xs:documentation> | ||
112 | </xs:annotation> | ||
113 | <xs:simpleType> | ||
114 | |||
115 | <xs:restriction base="xs:NCName"> | ||
116 | <xs:enumeration value="default"/> | ||
117 | <xs:enumeration value="preserve"/> | ||
118 | </xs:restriction> | ||
119 | </xs:simpleType> | ||
120 | </xs:attribute> | ||
121 | |||
122 | <xs:attribute name="base" type="xs:anyURI"> <xs:annotation> | ||
123 | <xs:documentation> | ||
124 | |||
125 | <div> | ||
126 | |||
127 | <h3>base (as an attribute name)</h3> | ||
128 | <p> | ||
129 | denotes an attribute whose value | ||
130 | provides a URI to be used as the base for interpreting any | ||
131 | relative URIs in the scope of the element on which it | ||
132 | appears; its value is inherited. This name is reserved | ||
133 | by virtue of its definition in the XML Base specification.</p> | ||
134 | |||
135 | <p> | ||
136 | See <a | ||
137 | href="http://www.w3.org/TR/xmlbase/">http://www.w3.org/TR/xmlbase/</a> | ||
138 | for information about this attribute. | ||
139 | </p> | ||
140 | |||
141 | </div> | ||
142 | </xs:documentation> | ||
143 | </xs:annotation> | ||
144 | </xs:attribute> | ||
145 | |||
146 | <xs:attribute name="id" type="xs:ID"> | ||
147 | <xs:annotation> | ||
148 | <xs:documentation> | ||
149 | <div> | ||
150 | |||
151 | <h3>id (as an attribute name)</h3> | ||
152 | <p> | ||
153 | |||
154 | denotes an attribute whose value | ||
155 | should be interpreted as if declared to be of type ID. | ||
156 | This name is reserved by virtue of its definition in the | ||
157 | xml:id specification.</p> | ||
158 | |||
159 | <p> | ||
160 | See <a | ||
161 | href="http://www.w3.org/TR/xml-id/">http://www.w3.org/TR/xml-id/</a> | ||
162 | for information about this attribute. | ||
163 | </p> | ||
164 | </div> | ||
165 | </xs:documentation> | ||
166 | </xs:annotation> | ||
167 | |||
168 | </xs:attribute> | ||
169 | |||
170 | <xs:attributeGroup name="specialAttrs"> | ||
171 | <xs:attribute ref="xml:base"/> | ||
172 | <xs:attribute ref="xml:lang"/> | ||
173 | <xs:attribute ref="xml:space"/> | ||
174 | <xs:attribute ref="xml:id"/> | ||
175 | </xs:attributeGroup> | ||
176 | |||
177 | <xs:annotation> | ||
178 | |||
179 | <xs:documentation> | ||
180 | <div> | ||
181 | |||
182 | <h3>Father (in any context at all)</h3> | ||
183 | |||
184 | <div class="bodytext"> | ||
185 | <p> | ||
186 | denotes Jon Bosak, the chair of | ||
187 | the original XML Working Group. This name is reserved by | ||
188 | the following decision of the W3C XML Plenary and | ||
189 | XML Coordination groups: | ||
190 | </p> | ||
191 | <blockquote> | ||
192 | <p> | ||
193 | |||
194 | In appreciation for his vision, leadership and | ||
195 | dedication the W3C XML Plenary on this 10th day of | ||
196 | February, 2000, reserves for Jon Bosak in perpetuity | ||
197 | the XML name "xml:Father". | ||
198 | </p> | ||
199 | </blockquote> | ||
200 | </div> | ||
201 | </div> | ||
202 | </xs:documentation> | ||
203 | </xs:annotation> | ||
204 | |||
205 | <xs:annotation> | ||
206 | <xs:documentation> | ||
207 | |||
208 | <div xml:id="usage" id="usage"> | ||
209 | <h2><a name="usage">About this schema document</a></h2> | ||
210 | |||
211 | <div class="bodytext"> | ||
212 | <p> | ||
213 | This schema defines attributes and an attribute group suitable | ||
214 | for use by schemas wishing to allow <code>xml:base</code>, | ||
215 | <code>xml:lang</code>, <code>xml:space</code> or | ||
216 | <code>xml:id</code> attributes on elements they define. | ||
217 | </p> | ||
218 | |||
219 | <p> | ||
220 | To enable this, such a schema must import this schema for | ||
221 | the XML namespace, e.g. as follows: | ||
222 | </p> | ||
223 | <pre> | ||
224 | <schema.. .> | ||
225 | .. . | ||
226 | <import namespace="http://www.w3.org/XML/1998/namespace" | ||
227 | schemaLocation="http://www.w3.org/2001/xml.xsd"/> | ||
228 | </pre> | ||
229 | <p> | ||
230 | or | ||
231 | </p> | ||
232 | <pre> | ||
233 | |||
234 | <import namespace="http://www.w3.org/XML/1998/namespace" | ||
235 | schemaLocation="http://www.w3.org/2009/01/xml.xsd"/> | ||
236 | </pre> | ||
237 | <p> | ||
238 | Subsequently, qualified reference to any of the attributes or the | ||
239 | group defined below will have the desired effect, e.g. | ||
240 | </p> | ||
241 | <pre> | ||
242 | <type.. .> | ||
243 | .. . | ||
244 | <attributeGroup ref="xml:specialAttrs"/> | ||
245 | </pre> | ||
246 | <p> | ||
247 | will define a type which will schema-validate an instance element | ||
248 | with any of those attributes. | ||
249 | </p> | ||
250 | |||
251 | </div> | ||
252 | </div> | ||
253 | </xs:documentation> | ||
254 | </xs:annotation> | ||
255 | |||
256 | <xs:annotation> | ||
257 | <xs:documentation> | ||
258 | <div id="nsversioning" xml:id="nsversioning"> | ||
259 | <h2><a name="nsversioning">Versioning policy for this schema document</a></h2> | ||
260 | |||
261 | <div class="bodytext"> | ||
262 | <p> | ||
263 | In keeping with the XML Schema WG's standard versioning | ||
264 | policy, this schema document will persist at | ||
265 | <a href="http://www.w3.org/2009/01/xml.xsd"> | ||
266 | http://www.w3.org/2009/01/xml.xsd</a>. | ||
267 | </p> | ||
268 | <p> | ||
269 | At the date of issue it can also be found at | ||
270 | <a href="http://www.w3.org/2001/xml.xsd"> | ||
271 | http://www.w3.org/2001/xml.xsd</a>. | ||
272 | </p> | ||
273 | |||
274 | <p> | ||
275 | The schema document at that URI may however change in the future, | ||
276 | in order to remain compatible with the latest version of XML | ||
277 | Schema itself, or with the XML namespace itself. In other words, | ||
278 | if the XML Schema or XML namespaces change, the version of this | ||
279 | document at <a href="http://www.w3.org/2001/xml.xsd"> | ||
280 | http://www.w3.org/2001/xml.xsd | ||
281 | </a> | ||
282 | will change accordingly; the version at | ||
283 | <a href="http://www.w3.org/2009/01/xml.xsd"> | ||
284 | http://www.w3.org/2009/01/xml.xsd | ||
285 | </a> | ||
286 | will not change. | ||
287 | </p> | ||
288 | <p> | ||
289 | |||
290 | Previous dated (and unchanging) versions of this schema | ||
291 | document are at: | ||
292 | </p> | ||
293 | <ul> | ||
294 | <li><a href="http://www.w3.org/2009/01/xml.xsd"> | ||
295 | http://www.w3.org/2009/01/xml.xsd</a></li> | ||
296 | <li><a href="http://www.w3.org/2007/08/xml.xsd"> | ||
297 | http://www.w3.org/2007/08/xml.xsd</a></li> | ||
298 | <li><a href="http://www.w3.org/2004/10/xml.xsd"> | ||
299 | |||
300 | http://www.w3.org/2004/10/xml.xsd</a></li> | ||
301 | <li><a href="http://www.w3.org/2001/03/xml.xsd"> | ||
302 | http://www.w3.org/2001/03/xml.xsd</a></li> | ||
303 | </ul> | ||
304 | </div> | ||
305 | </div> | ||
306 | </xs:documentation> | ||
307 | </xs:annotation> | ||
308 | |||
309 | </xs:schema> | ||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/MessageCatalogue.php b/vendor/symfony/translation/Symfony/Component/Translation/MessageCatalogue.php deleted file mode 100644 index 1d8a08d8..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/MessageCatalogue.php +++ /dev/null | |||
@@ -1,295 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of the Symfony package. | ||
5 | * | ||
6 | * (c) Fabien Potencier <fabien@symfony.com> | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | namespace Symfony\Component\Translation; | ||
13 | |||
14 | use Symfony\Component\Config\Resource\ResourceInterface; | ||
15 | |||
16 | /** | ||
17 | * MessageCatalogue. | ||
18 | * | ||
19 | * @author Fabien Potencier <fabien@symfony.com> | ||
20 | * | ||
21 | * @api | ||
22 | */ | ||
23 | class MessageCatalogue implements MessageCatalogueInterface, MetadataAwareInterface | ||
24 | { | ||
25 | private $messages = array(); | ||
26 | private $metadata = array(); | ||
27 | private $resources = array(); | ||
28 | private $locale; | ||
29 | private $fallbackCatalogue; | ||
30 | private $parent; | ||
31 | |||
32 | /** | ||
33 | * Constructor. | ||
34 | * | ||
35 | * @param string $locale The locale | ||
36 | * @param array $messages An array of messages classified by domain | ||
37 | * | ||
38 | * @api | ||
39 | */ | ||
40 | public function __construct($locale, array $messages = array()) | ||
41 | { | ||
42 | $this->locale = $locale; | ||
43 | $this->messages = $messages; | ||
44 | } | ||
45 | |||
46 | /** | ||
47 | * {@inheritdoc} | ||
48 | * | ||
49 | * @api | ||
50 | */ | ||
51 | public function getLocale() | ||
52 | { | ||
53 | return $this->locale; | ||
54 | } | ||
55 | |||
56 | /** | ||
57 | * {@inheritdoc} | ||
58 | * | ||
59 | * @api | ||
60 | */ | ||
61 | public function getDomains() | ||
62 | { | ||
63 | return array_keys($this->messages); | ||
64 | } | ||
65 | |||
66 | /** | ||
67 | * {@inheritdoc} | ||
68 | * | ||
69 | * @api | ||
70 | */ | ||
71 | public function all($domain = null) | ||
72 | { | ||
73 | if (null === $domain) { | ||
74 | return $this->messages; | ||
75 | } | ||
76 | |||
77 | return isset($this->messages[$domain]) ? $this->messages[$domain] : array(); | ||
78 | } | ||
79 | |||
80 | /** | ||
81 | * {@inheritdoc} | ||
82 | * | ||
83 | * @api | ||
84 | */ | ||
85 | public function set($id, $translation, $domain = 'messages') | ||
86 | { | ||
87 | $this->add(array($id => $translation), $domain); | ||
88 | } | ||
89 | |||
90 | /** | ||
91 | * {@inheritdoc} | ||
92 | * | ||
93 | * @api | ||
94 | */ | ||
95 | public function has($id, $domain = 'messages') | ||
96 | { | ||
97 | if (isset($this->messages[$domain][$id])) { | ||
98 | return true; | ||
99 | } | ||
100 | |||
101 | if (null !== $this->fallbackCatalogue) { | ||
102 | return $this->fallbackCatalogue->has($id, $domain); | ||
103 | } | ||
104 | |||
105 | return false; | ||
106 | } | ||
107 | |||
108 | /** | ||
109 | * {@inheritdoc} | ||
110 | */ | ||
111 | public function defines($id, $domain = 'messages') | ||
112 | { | ||
113 | return isset($this->messages[$domain][$id]); | ||
114 | } | ||
115 | |||
116 | /** | ||
117 | * {@inheritdoc} | ||
118 | * | ||
119 | * @api | ||
120 | */ | ||
121 | public function get($id, $domain = 'messages') | ||
122 | { | ||
123 | if (isset($this->messages[$domain][$id])) { | ||
124 | return $this->messages[$domain][$id]; | ||
125 | } | ||
126 | |||
127 | if (null !== $this->fallbackCatalogue) { | ||
128 | return $this->fallbackCatalogue->get($id, $domain); | ||
129 | } | ||
130 | |||
131 | return $id; | ||
132 | } | ||
133 | |||
134 | /** | ||
135 | * {@inheritdoc} | ||
136 | * | ||
137 | * @api | ||
138 | */ | ||
139 | public function replace($messages, $domain = 'messages') | ||
140 | { | ||
141 | $this->messages[$domain] = array(); | ||
142 | |||
143 | $this->add($messages, $domain); | ||
144 | } | ||
145 | |||
146 | /** | ||
147 | * {@inheritdoc} | ||
148 | * | ||
149 | * @api | ||
150 | */ | ||
151 | public function add($messages, $domain = 'messages') | ||
152 | { | ||
153 | if (!isset($this->messages[$domain])) { | ||
154 | $this->messages[$domain] = $messages; | ||
155 | } else { | ||
156 | $this->messages[$domain] = array_replace($this->messages[$domain], $messages); | ||
157 | } | ||
158 | } | ||
159 | |||
160 | /** | ||
161 | * {@inheritdoc} | ||
162 | * | ||
163 | * @api | ||
164 | */ | ||
165 | public function addCatalogue(MessageCatalogueInterface $catalogue) | ||
166 | { | ||
167 | if ($catalogue->getLocale() !== $this->locale) { | ||
168 | throw new \LogicException(sprintf('Cannot add a catalogue for locale "%s" as the current locale for this catalogue is "%s"', $catalogue->getLocale(), $this->locale)); | ||
169 | } | ||
170 | |||
171 | foreach ($catalogue->all() as $domain => $messages) { | ||
172 | $this->add($messages, $domain); | ||
173 | } | ||
174 | |||
175 | foreach ($catalogue->getResources() as $resource) { | ||
176 | $this->addResource($resource); | ||
177 | } | ||
178 | |||
179 | if ($catalogue instanceof MetadataAwareInterface) { | ||
180 | $metadata = $catalogue->getMetadata('', ''); | ||
181 | $this->addMetadata($metadata); | ||
182 | } | ||
183 | } | ||
184 | |||
185 | /** | ||
186 | * {@inheritdoc} | ||
187 | * | ||
188 | * @api | ||
189 | */ | ||
190 | public function addFallbackCatalogue(MessageCatalogueInterface $catalogue) | ||
191 | { | ||
192 | // detect circular references | ||
193 | $c = $this; | ||
194 | do { | ||
195 | if ($c->getLocale() === $catalogue->getLocale()) { | ||
196 | throw new \LogicException(sprintf('Circular reference detected when adding a fallback catalogue for locale "%s".', $catalogue->getLocale())); | ||
197 | } | ||
198 | } while ($c = $c->parent); | ||
199 | |||
200 | $catalogue->parent = $this; | ||
201 | $this->fallbackCatalogue = $catalogue; | ||
202 | |||
203 | foreach ($catalogue->getResources() as $resource) { | ||
204 | $this->addResource($resource); | ||
205 | } | ||
206 | } | ||
207 | |||
208 | /** | ||
209 | * {@inheritdoc} | ||
210 | * | ||
211 | * @api | ||
212 | */ | ||
213 | public function getFallbackCatalogue() | ||
214 | { | ||
215 | return $this->fallbackCatalogue; | ||
216 | } | ||
217 | |||
218 | /** | ||
219 | * {@inheritdoc} | ||
220 | * | ||
221 | * @api | ||
222 | */ | ||
223 | public function getResources() | ||
224 | { | ||
225 | return array_values($this->resources); | ||
226 | } | ||
227 | |||
228 | /** | ||
229 | * {@inheritdoc} | ||
230 | * | ||
231 | * @api | ||
232 | */ | ||
233 | public function addResource(ResourceInterface $resource) | ||
234 | { | ||
235 | $this->resources[$resource->__toString()] = $resource; | ||
236 | } | ||
237 | |||
238 | /** | ||
239 | * {@inheritdoc} | ||
240 | */ | ||
241 | public function getMetadata($key = '', $domain = 'messages') | ||
242 | { | ||
243 | if ('' == $domain) { | ||
244 | return $this->metadata; | ||
245 | } | ||
246 | |||
247 | if (isset($this->metadata[$domain])) { | ||
248 | if ('' == $key) { | ||
249 | return $this->metadata[$domain]; | ||
250 | } | ||
251 | |||
252 | if (isset($this->metadata[$domain][$key])) { | ||
253 | return $this->metadata[$domain][$key]; | ||
254 | } | ||
255 | } | ||
256 | |||
257 | return null; | ||
258 | } | ||
259 | |||
260 | /** | ||
261 | * {@inheritdoc} | ||
262 | */ | ||
263 | public function setMetadata($key, $value, $domain = 'messages') | ||
264 | { | ||
265 | $this->metadata[$domain][$key] = $value; | ||
266 | } | ||
267 | |||
268 | /** | ||
269 | * {@inheritdoc} | ||
270 | */ | ||
271 | public function deleteMetadata($key = '', $domain = 'messages') | ||
272 | { | ||
273 | if ('' == $domain) { | ||
274 | $this->metadata = array(); | ||
275 | } elseif ('' == $key) { | ||
276 | unset($this->metadata[$domain]); | ||
277 | } else { | ||
278 | unset($this->metadata[$domain][$key]); | ||
279 | } | ||
280 | } | ||
281 | |||
282 | /** | ||
283 | * Adds current values with the new values. | ||
284 | * | ||
285 | * @param array $values Values to add | ||
286 | */ | ||
287 | private function addMetadata(array $values) | ||
288 | { | ||
289 | foreach ($values as $domain => $keys) { | ||
290 | foreach ($keys as $key => $value) { | ||
291 | $this->setMetadata($key, $value, $domain); | ||
292 | } | ||
293 | } | ||
294 | } | ||
295 | } | ||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/MessageCatalogueInterface.php b/vendor/symfony/translation/Symfony/Component/Translation/MessageCatalogueInterface.php deleted file mode 100644 index 5e9be20c..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/MessageCatalogueInterface.php +++ /dev/null | |||
@@ -1,172 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of the Symfony package. | ||
5 | * | ||
6 | * (c) Fabien Potencier <fabien@symfony.com> | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | namespace Symfony\Component\Translation; | ||
13 | |||
14 | use Symfony\Component\Config\Resource\ResourceInterface; | ||
15 | |||
16 | /** | ||
17 | * MessageCatalogueInterface. | ||
18 | * | ||
19 | * @author Fabien Potencier <fabien@symfony.com> | ||
20 | * | ||
21 | * @api | ||
22 | */ | ||
23 | interface MessageCatalogueInterface | ||
24 | { | ||
25 | /** | ||
26 | * Gets the catalogue locale. | ||
27 | * | ||
28 | * @return string The locale | ||
29 | * | ||
30 | * @api | ||
31 | */ | ||
32 | public function getLocale(); | ||
33 | |||
34 | /** | ||
35 | * Gets the domains. | ||
36 | * | ||
37 | * @return array An array of domains | ||
38 | * | ||
39 | * @api | ||
40 | */ | ||
41 | public function getDomains(); | ||
42 | |||
43 | /** | ||
44 | * Gets the messages within a given domain. | ||
45 | * | ||
46 | * If $domain is null, it returns all messages. | ||
47 | * | ||
48 | * @param string $domain The domain name | ||
49 | * | ||
50 | * @return array An array of messages | ||
51 | * | ||
52 | * @api | ||
53 | */ | ||
54 | public function all($domain = null); | ||
55 | |||
56 | /** | ||
57 | * Sets a message translation. | ||
58 | * | ||
59 | * @param string $id The message id | ||
60 | * @param string $translation The messages translation | ||
61 | * @param string $domain The domain name | ||
62 | * | ||
63 | * @api | ||
64 | */ | ||
65 | public function set($id, $translation, $domain = 'messages'); | ||
66 | |||
67 | /** | ||
68 | * Checks if a message has a translation. | ||
69 | * | ||
70 | * @param string $id The message id | ||
71 | * @param string $domain The domain name | ||
72 | * | ||
73 | * @return Boolean true if the message has a translation, false otherwise | ||
74 | * | ||
75 | * @api | ||
76 | */ | ||
77 | public function has($id, $domain = 'messages'); | ||
78 | |||
79 | /** | ||
80 | * Checks if a message has a translation (it does not take into account the fallback mechanism). | ||
81 | * | ||
82 | * @param string $id The message id | ||
83 | * @param string $domain The domain name | ||
84 | * | ||
85 | * @return Boolean true if the message has a translation, false otherwise | ||
86 | * | ||
87 | * @api | ||
88 | */ | ||
89 | public function defines($id, $domain = 'messages'); | ||
90 | |||
91 | /** | ||
92 | * Gets a message translation. | ||
93 | * | ||
94 | * @param string $id The message id | ||
95 | * @param string $domain The domain name | ||
96 | * | ||
97 | * @return string The message translation | ||
98 | * | ||
99 | * @api | ||
100 | */ | ||
101 | public function get($id, $domain = 'messages'); | ||
102 | |||
103 | /** | ||
104 | * Sets translations for a given domain. | ||
105 | * | ||
106 | * @param array $messages An array of translations | ||
107 | * @param string $domain The domain name | ||
108 | * | ||
109 | * @api | ||
110 | */ | ||
111 | public function replace($messages, $domain = 'messages'); | ||
112 | |||
113 | /** | ||
114 | * Adds translations for a given domain. | ||
115 | * | ||
116 | * @param array $messages An array of translations | ||
117 | * @param string $domain The domain name | ||
118 | * | ||
119 | * @api | ||
120 | */ | ||
121 | public function add($messages, $domain = 'messages'); | ||
122 | |||
123 | /** | ||
124 | * Merges translations from the given Catalogue into the current one. | ||
125 | * | ||
126 | * The two catalogues must have the same locale. | ||
127 | * | ||
128 | * @param MessageCatalogueInterface $catalogue A MessageCatalogueInterface instance | ||
129 | * | ||
130 | * @api | ||
131 | */ | ||
132 | public function addCatalogue(MessageCatalogueInterface $catalogue); | ||
133 | |||
134 | /** | ||
135 | * Merges translations from the given Catalogue into the current one | ||
136 | * only when the translation does not exist. | ||
137 | * | ||
138 | * This is used to provide default translations when they do not exist for the current locale. | ||
139 | * | ||
140 | * @param MessageCatalogueInterface $catalogue A MessageCatalogueInterface instance | ||
141 | * | ||
142 | * @api | ||
143 | */ | ||
144 | public function addFallbackCatalogue(MessageCatalogueInterface $catalogue); | ||
145 | |||
146 | /** | ||
147 | * Gets the fallback catalogue. | ||
148 | * | ||
149 | * @return MessageCatalogueInterface|null A MessageCatalogueInterface instance or null when no fallback has been set | ||
150 | * | ||
151 | * @api | ||
152 | */ | ||
153 | public function getFallbackCatalogue(); | ||
154 | |||
155 | /** | ||
156 | * Returns an array of resources loaded to build this collection. | ||
157 | * | ||
158 | * @return ResourceInterface[] An array of resources | ||
159 | * | ||
160 | * @api | ||
161 | */ | ||
162 | public function getResources(); | ||
163 | |||
164 | /** | ||
165 | * Adds a resource for this collection. | ||
166 | * | ||
167 | * @param ResourceInterface $resource A resource instance | ||
168 | * | ||
169 | * @api | ||
170 | */ | ||
171 | public function addResource(ResourceInterface $resource); | ||
172 | } | ||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/MessageSelector.php b/vendor/symfony/translation/Symfony/Component/Translation/MessageSelector.php deleted file mode 100644 index 387c964d..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/MessageSelector.php +++ /dev/null | |||
@@ -1,82 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of the Symfony package. | ||
5 | * | ||
6 | * (c) Fabien Potencier <fabien@symfony.com> | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | namespace Symfony\Component\Translation; | ||
13 | |||
14 | /** | ||
15 | * MessageSelector. | ||
16 | * | ||
17 | * @author Fabien Potencier <fabien@symfony.com> | ||
18 | * | ||
19 | * @api | ||
20 | */ | ||
21 | class MessageSelector | ||
22 | { | ||
23 | /** | ||
24 | * Given a message with different plural translations separated by a | ||
25 | * pipe (|), this method returns the correct portion of the message based | ||
26 | * on the given number, locale and the pluralization rules in the message | ||
27 | * itself. | ||
28 | * | ||
29 | * The message supports two different types of pluralization rules: | ||
30 | * | ||
31 | * interval: {0} There are no apples|{1} There is one apple|]1,Inf] There are %count% apples | ||
32 | * indexed: There is one apple|There are %count% apples | ||
33 | * | ||
34 | * The indexed solution can also contain labels (e.g. one: There is one apple). | ||
35 | * This is purely for making the translations more clear - it does not | ||
36 | * affect the functionality. | ||
37 | * | ||
38 | * The two methods can also be mixed: | ||
39 | * {0} There are no apples|one: There is one apple|more: There are %count% apples | ||
40 | * | ||
41 | * @param string $message The message being translated | ||
42 | * @param integer $number The number of items represented for the message | ||
43 | * @param string $locale The locale to use for choosing | ||
44 | * | ||
45 | * @return string | ||
46 | * | ||
47 | * @throws \InvalidArgumentException | ||
48 | * | ||
49 | * @api | ||
50 | */ | ||
51 | public function choose($message, $number, $locale) | ||
52 | { | ||
53 | $parts = explode('|', $message); | ||
54 | $explicitRules = array(); | ||
55 | $standardRules = array(); | ||
56 | foreach ($parts as $part) { | ||
57 | $part = trim($part); | ||
58 | |||
59 | if (preg_match('/^(?P<interval>'.Interval::getIntervalRegexp().')\s*(?P<message>.*?)$/x', $part, $matches)) { | ||
60 | $explicitRules[$matches['interval']] = $matches['message']; | ||
61 | } elseif (preg_match('/^\w+\:\s*(.*?)$/', $part, $matches)) { | ||
62 | $standardRules[] = $matches[1]; | ||
63 | } else { | ||
64 | $standardRules[] = $part; | ||
65 | } | ||
66 | } | ||
67 | |||
68 | // try to match an explicit rule, then fallback to the standard ones | ||
69 | foreach ($explicitRules as $interval => $m) { | ||
70 | if (Interval::test($number, $interval)) { | ||
71 | return $m; | ||
72 | } | ||
73 | } | ||
74 | |||
75 | $position = PluralizationRules::get($number, $locale); | ||
76 | if (!isset($standardRules[$position])) { | ||
77 | throw new \InvalidArgumentException(sprintf('Unable to choose a translation for "%s" with locale "%s". Double check that this translation has the correct plural options (e.g. "There is one apple|There are %%count%% apples").', $message, $locale)); | ||
78 | } | ||
79 | |||
80 | return $standardRules[$position]; | ||
81 | } | ||
82 | } | ||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/MetadataAwareInterface.php b/vendor/symfony/translation/Symfony/Component/Translation/MetadataAwareInterface.php deleted file mode 100644 index 1c439351..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/MetadataAwareInterface.php +++ /dev/null | |||
@@ -1,54 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of the Symfony package. | ||
5 | * | ||
6 | * (c) Fabien Potencier <fabien@symfony.com> | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | namespace Symfony\Component\Translation; | ||
13 | |||
14 | /** | ||
15 | * MetadataAwareInterface. | ||
16 | * | ||
17 | * @author Fabien Potencier <fabien@symfony.com> | ||
18 | */ | ||
19 | interface MetadataAwareInterface | ||
20 | { | ||
21 | /** | ||
22 | * Gets metadata for the given domain and key. | ||
23 | * | ||
24 | * Passing an empty domain will return an array with all metadata indexed by | ||
25 | * domain and then by key. Passing an empty key will return an array with all | ||
26 | * metadata for the given domain. | ||
27 | * | ||
28 | * @param string $domain The domain name | ||
29 | * @param string $key The key | ||
30 | * | ||
31 | * @return mixed The value that was set or an array with the domains/keys or null | ||
32 | */ | ||
33 | public function getMetadata($key = '', $domain = 'messages'); | ||
34 | |||
35 | /** | ||
36 | * Adds metadata to a message domain. | ||
37 | * | ||
38 | * @param string $key The key | ||
39 | * @param mixed $value The value | ||
40 | * @param string $domain The domain name | ||
41 | */ | ||
42 | public function setMetadata($key, $value, $domain = 'messages'); | ||
43 | |||
44 | /** | ||
45 | * Deletes metadata for the given key and domain. | ||
46 | * | ||
47 | * Passing an empty domain will delete all metadata. Passing an empty key will | ||
48 | * delete all metadata for the given domain. | ||
49 | * | ||
50 | * @param string $domain The domain name | ||
51 | * @param string $key The key | ||
52 | */ | ||
53 | public function deleteMetadata($key = '', $domain = 'messages'); | ||
54 | } | ||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/PluralizationRules.php b/vendor/symfony/translation/Symfony/Component/Translation/PluralizationRules.php deleted file mode 100644 index 5c63b8d0..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/PluralizationRules.php +++ /dev/null | |||
@@ -1,219 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of the Symfony package. | ||
5 | * | ||
6 | * (c) Fabien Potencier <fabien@symfony.com> | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | namespace Symfony\Component\Translation; | ||
13 | |||
14 | /** | ||
15 | * Returns the plural rules for a given locale. | ||
16 | * | ||
17 | * @author Fabien Potencier <fabien@symfony.com> | ||
18 | */ | ||
19 | class PluralizationRules | ||
20 | { | ||
21 | // @codeCoverageIgnoreStart | ||
22 | private static $rules = array(); | ||
23 | |||
24 | /** | ||
25 | * Returns the plural position to use for the given locale and number. | ||
26 | * | ||
27 | * @param integer $number The number | ||
28 | * @param string $locale The locale | ||
29 | * | ||
30 | * @return integer The plural position | ||
31 | */ | ||
32 | public static function get($number, $locale) | ||
33 | { | ||
34 | if ("pt_BR" == $locale) { | ||
35 | // temporary set a locale for brazilian | ||
36 | $locale = "xbr"; | ||
37 | } | ||
38 | |||
39 | if (strlen($locale) > 3) { | ||
40 | $locale = substr($locale, 0, -strlen(strrchr($locale, '_'))); | ||
41 | } | ||
42 | |||
43 | if (isset(self::$rules[$locale])) { | ||
44 | $return = call_user_func(self::$rules[$locale], $number); | ||
45 | |||
46 | if (!is_int($return) || $return < 0) { | ||
47 | return 0; | ||
48 | } | ||
49 | |||
50 | return $return; | ||
51 | } | ||
52 | |||
53 | /* | ||
54 | * The plural rules are derived from code of the Zend Framework (2010-09-25), | ||
55 | * which is subject to the new BSD license (http://framework.zend.com/license/new-bsd). | ||
56 | * Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) | ||
57 | */ | ||
58 | switch ($locale) { | ||
59 | case 'bo': | ||
60 | case 'dz': | ||
61 | case 'id': | ||
62 | case 'ja': | ||
63 | case 'jv': | ||
64 | case 'ka': | ||
65 | case 'km': | ||
66 | case 'kn': | ||
67 | case 'ko': | ||
68 | case 'ms': | ||
69 | case 'th': | ||
70 | case 'tr': | ||
71 | case 'vi': | ||
72 | case 'zh': | ||
73 | return 0; | ||
74 | break; | ||
75 | |||
76 | case 'af': | ||
77 | case 'az': | ||
78 | case 'bn': | ||
79 | case 'bg': | ||
80 | case 'ca': | ||
81 | case 'da': | ||
82 | case 'de': | ||
83 | case 'el': | ||
84 | case 'en': | ||
85 | case 'eo': | ||
86 | case 'es': | ||
87 | case 'et': | ||
88 | case 'eu': | ||
89 | case 'fa': | ||
90 | case 'fi': | ||
91 | case 'fo': | ||
92 | case 'fur': | ||
93 | case 'fy': | ||
94 | case 'gl': | ||
95 | case 'gu': | ||
96 | case 'ha': | ||
97 | case 'he': | ||
98 | case 'hu': | ||
99 | case 'is': | ||
100 | case 'it': | ||
101 | case 'ku': | ||
102 | case 'lb': | ||
103 | case 'ml': | ||
104 | case 'mn': | ||
105 | case 'mr': | ||
106 | case 'nah': | ||
107 | case 'nb': | ||
108 | case 'ne': | ||
109 | case 'nl': | ||
110 | case 'nn': | ||
111 | case 'no': | ||
112 | case 'om': | ||
113 | case 'or': | ||
114 | case 'pa': | ||
115 | case 'pap': | ||
116 | case 'ps': | ||
117 | case 'pt': | ||
118 | case 'so': | ||
119 | case 'sq': | ||
120 | case 'sv': | ||
121 | case 'sw': | ||
122 | case 'ta': | ||
123 | case 'te': | ||
124 | case 'tk': | ||
125 | case 'ur': | ||
126 | case 'zu': | ||
127 | return ($number == 1) ? 0 : 1; | ||
128 | |||
129 | case 'am': | ||
130 | case 'bh': | ||
131 | case 'fil': | ||
132 | case 'fr': | ||
133 | case 'gun': | ||
134 | case 'hi': | ||
135 | case 'ln': | ||
136 | case 'mg': | ||
137 | case 'nso': | ||
138 | case 'xbr': | ||
139 | case 'ti': | ||
140 | case 'wa': | ||
141 | return (($number == 0) || ($number == 1)) ? 0 : 1; | ||
142 | |||
143 | case 'be': | ||
144 | case 'bs': | ||
145 | case 'hr': | ||
146 | case 'ru': | ||
147 | case 'sr': | ||
148 | case 'uk': | ||
149 | return (($number % 10 == 1) && ($number % 100 != 11)) ? 0 : ((($number % 10 >= 2) && ($number % 10 <= 4) && (($number % 100 < 10) || ($number % 100 >= 20))) ? 1 : 2); | ||
150 | |||
151 | case 'cs': | ||
152 | case 'sk': | ||
153 | return ($number == 1) ? 0 : ((($number >= 2) && ($number <= 4)) ? 1 : 2); | ||
154 | |||
155 | case 'ga': | ||
156 | return ($number == 1) ? 0 : (($number == 2) ? 1 : 2); | ||
157 | |||
158 | case 'lt': | ||
159 | return (($number % 10 == 1) && ($number % 100 != 11)) ? 0 : ((($number % 10 >= 2) && (($number % 100 < 10) || ($number % 100 >= 20))) ? 1 : 2); | ||
160 | |||
161 | case 'sl': | ||
162 | return ($number % 100 == 1) ? 0 : (($number % 100 == 2) ? 1 : ((($number % 100 == 3) || ($number % 100 == 4)) ? 2 : 3)); | ||
163 | |||
164 | case 'mk': | ||
165 | return ($number % 10 == 1) ? 0 : 1; | ||
166 | |||
167 | case 'mt': | ||
168 | return ($number == 1) ? 0 : ((($number == 0) || (($number % 100 > 1) && ($number % 100 < 11))) ? 1 : ((($number % 100 > 10) && ($number % 100 < 20)) ? 2 : 3)); | ||
169 | |||
170 | case 'lv': | ||
171 | return ($number == 0) ? 0 : ((($number % 10 == 1) && ($number % 100 != 11)) ? 1 : 2); | ||
172 | |||
173 | case 'pl': | ||
174 | return ($number == 1) ? 0 : ((($number % 10 >= 2) && ($number % 10 <= 4) && (($number % 100 < 12) || ($number % 100 > 14))) ? 1 : 2); | ||
175 | |||
176 | case 'cy': | ||
177 | return ($number == 1) ? 0 : (($number == 2) ? 1 : ((($number == 8) || ($number == 11)) ? 2 : 3)); | ||
178 | |||
179 | case 'ro': | ||
180 | return ($number == 1) ? 0 : ((($number == 0) || (($number % 100 > 0) && ($number % 100 < 20))) ? 1 : 2); | ||
181 | |||
182 | case 'ar': | ||
183 | return ($number == 0) ? 0 : (($number == 1) ? 1 : (($number == 2) ? 2 : ((($number >= 3) && ($number <= 10)) ? 3 : ((($number >= 11) && ($number <= 99)) ? 4 : 5)))); | ||
184 | |||
185 | default: | ||
186 | return 0; | ||
187 | } | ||
188 | } | ||
189 | |||
190 | /** | ||
191 | * Overrides the default plural rule for a given locale. | ||
192 | * | ||
193 | * @param string $rule A PHP callable | ||
194 | * @param string $locale The locale | ||
195 | * | ||
196 | * @return null | ||
197 | * | ||
198 | * @throws \LogicException | ||
199 | */ | ||
200 | public static function set($rule, $locale) | ||
201 | { | ||
202 | if ("pt_BR" == $locale) { | ||
203 | // temporary set a locale for brazilian | ||
204 | $locale = "xbr"; | ||
205 | } | ||
206 | |||
207 | if (strlen($locale) > 3) { | ||
208 | $locale = substr($locale, 0, -strlen(strrchr($locale, '_'))); | ||
209 | } | ||
210 | |||
211 | if (!is_callable($rule)) { | ||
212 | throw new \LogicException('The given rule can not be called'); | ||
213 | } | ||
214 | |||
215 | self::$rules[$locale] = $rule; | ||
216 | } | ||
217 | |||
218 | // @codeCoverageIgnoreEnd | ||
219 | } | ||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/README.md b/vendor/symfony/translation/Symfony/Component/Translation/README.md deleted file mode 100644 index 24e6210c..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/README.md +++ /dev/null | |||
@@ -1,35 +0,0 @@ | |||
1 | Translation Component | ||
2 | ===================== | ||
3 | |||
4 | Translation provides tools for loading translation files and generating | ||
5 | translated strings from these including support for pluralization. | ||
6 | |||
7 | use Symfony\Component\Translation\Translator; | ||
8 | use Symfony\Component\Translation\MessageSelector; | ||
9 | use Symfony\Component\Translation\Loader\ArrayLoader; | ||
10 | |||
11 | $translator = new Translator('fr_FR', new MessageSelector()); | ||
12 | $translator->setFallbackLocales(array('fr')); | ||
13 | $translator->addLoader('array', new ArrayLoader()); | ||
14 | $translator->addResource('array', array( | ||
15 | 'Hello World!' => 'Bonjour', | ||
16 | ), 'fr'); | ||
17 | |||
18 | echo $translator->trans('Hello World!')."\n"; | ||
19 | |||
20 | Resources | ||
21 | --------- | ||
22 | |||
23 | Silex integration: | ||
24 | |||
25 | https://github.com/fabpot/Silex/blob/master/src/Silex/Provider/TranslationServiceProvider.php | ||
26 | |||
27 | Documentation: | ||
28 | |||
29 | http://symfony.com/doc/2.3/book/translation.html | ||
30 | |||
31 | You can run the unit tests with the following command: | ||
32 | |||
33 | $ cd path/to/Symfony/Component/Translation/ | ||
34 | $ composer.phar install --dev | ||
35 | $ phpunit | ||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Tests/Catalogue/AbstractOperationTest.php b/vendor/symfony/translation/Symfony/Component/Translation/Tests/Catalogue/AbstractOperationTest.php deleted file mode 100644 index 78023e1b..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/Tests/Catalogue/AbstractOperationTest.php +++ /dev/null | |||
@@ -1,74 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of the Symfony package. | ||
5 | * | ||
6 | * (c) Fabien Potencier <fabien@symfony.com> | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | namespace Symfony\Component\Translation\Test\Catalogue; | ||
13 | |||
14 | use Symfony\Bundle\FrameworkBundle\Tests\TestCase; | ||
15 | use Symfony\Component\Translation\MessageCatalogue; | ||
16 | use Symfony\Component\Translation\MessageCatalogueInterface; | ||
17 | |||
18 | abstract class AbstractOperationTest extends TestCase | ||
19 | { | ||
20 | public function testGetEmptyDomains() | ||
21 | { | ||
22 | $this->assertEquals( | ||
23 | array(), | ||
24 | $this->createOperation( | ||
25 | new MessageCatalogue('en'), | ||
26 | new MessageCatalogue('en') | ||
27 | )->getDomains() | ||
28 | ); | ||
29 | } | ||
30 | |||
31 | public function testGetMergedDomains() | ||
32 | { | ||
33 | $this->assertEquals( | ||
34 | array('a', 'b', 'c'), | ||
35 | $this->createOperation( | ||
36 | new MessageCatalogue('en', array('a' => array(), 'b' => array())), | ||
37 | new MessageCatalogue('en', array('b' => array(), 'c' => array())) | ||
38 | )->getDomains() | ||
39 | ); | ||
40 | } | ||
41 | |||
42 | public function testGetMessagesFromUnknownDomain() | ||
43 | { | ||
44 | $this->setExpectedException('InvalidArgumentException'); | ||
45 | $this->createOperation( | ||
46 | new MessageCatalogue('en'), | ||
47 | new MessageCatalogue('en') | ||
48 | )->getMessages('domain'); | ||
49 | } | ||
50 | |||
51 | public function testGetEmptyMessages() | ||
52 | { | ||
53 | $this->assertEquals( | ||
54 | array(), | ||
55 | $this->createOperation( | ||
56 | new MessageCatalogue('en', array('a' => array())), | ||
57 | new MessageCatalogue('en') | ||
58 | )->getMessages('a') | ||
59 | ); | ||
60 | } | ||
61 | |||
62 | public function testGetEmptyResult() | ||
63 | { | ||
64 | $this->assertEquals( | ||
65 | new MessageCatalogue('en'), | ||
66 | $this->createOperation( | ||
67 | new MessageCatalogue('en'), | ||
68 | new MessageCatalogue('en') | ||
69 | )->getResult() | ||
70 | ); | ||
71 | } | ||
72 | |||
73 | abstract protected function createOperation(MessageCatalogueInterface $source, MessageCatalogueInterface $target); | ||
74 | } | ||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Tests/Catalogue/DiffOperationTest.php b/vendor/symfony/translation/Symfony/Component/Translation/Tests/Catalogue/DiffOperationTest.php deleted file mode 100644 index b2e852d9..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/Tests/Catalogue/DiffOperationTest.php +++ /dev/null | |||
@@ -1,60 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of the Symfony package. | ||
5 | * | ||
6 | * (c) Fabien Potencier <fabien@symfony.com> | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | namespace Symfony\Component\Translation\Test\Catalogue; | ||
13 | |||
14 | use Symfony\Component\Translation\Catalogue\DiffOperation; | ||
15 | use Symfony\Component\Translation\MessageCatalogue; | ||
16 | use Symfony\Component\Translation\MessageCatalogueInterface; | ||
17 | |||
18 | class DiffOperationTest extends AbstractOperationTest | ||
19 | { | ||
20 | public function testGetMessagesFromSingleDomain() | ||
21 | { | ||
22 | $operation = $this->createOperation( | ||
23 | new MessageCatalogue('en', array('messages' => array('a' => 'old_a', 'b' => 'old_b'))), | ||
24 | new MessageCatalogue('en', array('messages' => array('a' => 'new_a', 'c' => 'new_c'))) | ||
25 | ); | ||
26 | |||
27 | $this->assertEquals( | ||
28 | array('a' => 'old_a', 'c' => 'new_c'), | ||
29 | $operation->getMessages('messages') | ||
30 | ); | ||
31 | |||
32 | $this->assertEquals( | ||
33 | array('c' => 'new_c'), | ||
34 | $operation->getNewMessages('messages') | ||
35 | ); | ||
36 | |||
37 | $this->assertEquals( | ||
38 | array('b' => 'old_b'), | ||
39 | $operation->getObsoleteMessages('messages') | ||
40 | ); | ||
41 | } | ||
42 | |||
43 | public function testGetResultFromSingleDomain() | ||
44 | { | ||
45 | $this->assertEquals( | ||
46 | new MessageCatalogue('en', array( | ||
47 | 'messages' => array('a' => 'old_a', 'c' => 'new_c') | ||
48 | )), | ||
49 | $this->createOperation( | ||
50 | new MessageCatalogue('en', array('messages' => array('a' => 'old_a', 'b' => 'old_b'))), | ||
51 | new MessageCatalogue('en', array('messages' => array('a' => 'new_a', 'c' => 'new_c'))) | ||
52 | )->getResult() | ||
53 | ); | ||
54 | } | ||
55 | |||
56 | protected function createOperation(MessageCatalogueInterface $source, MessageCatalogueInterface $target) | ||
57 | { | ||
58 | return new DiffOperation($source, $target); | ||
59 | } | ||
60 | } | ||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Tests/Catalogue/MergeOperationTest.php b/vendor/symfony/translation/Symfony/Component/Translation/Tests/Catalogue/MergeOperationTest.php deleted file mode 100644 index fa5118a7..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/Tests/Catalogue/MergeOperationTest.php +++ /dev/null | |||
@@ -1,60 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of the Symfony package. | ||
5 | * | ||
6 | * (c) Fabien Potencier <fabien@symfony.com> | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | namespace Symfony\Component\Translation\Test\Catalogue; | ||
13 | |||
14 | use Symfony\Component\Translation\Catalogue\MergeOperation; | ||
15 | use Symfony\Component\Translation\MessageCatalogue; | ||
16 | use Symfony\Component\Translation\MessageCatalogueInterface; | ||
17 | |||
18 | class MergeOperationTest extends AbstractOperationTest | ||
19 | { | ||
20 | public function testGetMessagesFromSingleDomain() | ||
21 | { | ||
22 | $operation = $this->createOperation( | ||
23 | new MessageCatalogue('en', array('messages' => array('a' => 'old_a', 'b' => 'old_b'))), | ||
24 | new MessageCatalogue('en', array('messages' => array('a' => 'new_a', 'c' => 'new_c'))) | ||
25 | ); | ||
26 | |||
27 | $this->assertEquals( | ||
28 | array('a' => 'old_a', 'b' => 'old_b', 'c' => 'new_c'), | ||
29 | $operation->getMessages('messages') | ||
30 | ); | ||
31 | |||
32 | $this->assertEquals( | ||
33 | array('c' => 'new_c'), | ||
34 | $operation->getNewMessages('messages') | ||
35 | ); | ||
36 | |||
37 | $this->assertEquals( | ||
38 | array(), | ||
39 | $operation->getObsoleteMessages('messages') | ||
40 | ); | ||
41 | } | ||
42 | |||
43 | public function testGetResultFromSingleDomain() | ||
44 | { | ||
45 | $this->assertEquals( | ||
46 | new MessageCatalogue('en', array( | ||
47 | 'messages' => array('a' => 'old_a', 'b' => 'old_b', 'c' => 'new_c') | ||
48 | )), | ||
49 | $this->createOperation( | ||
50 | new MessageCatalogue('en', array('messages' => array('a' => 'old_a', 'b' => 'old_b'))), | ||
51 | new MessageCatalogue('en', array('messages' => array('a' => 'new_a', 'c' => 'new_c'))) | ||
52 | )->getResult() | ||
53 | ); | ||
54 | } | ||
55 | |||
56 | protected function createOperation(MessageCatalogueInterface $source, MessageCatalogueInterface $target) | ||
57 | { | ||
58 | return new MergeOperation($source, $target); | ||
59 | } | ||
60 | } | ||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Tests/Dumper/CsvFileDumperTest.php b/vendor/symfony/translation/Symfony/Component/Translation/Tests/Dumper/CsvFileDumperTest.php deleted file mode 100644 index 29177ff5..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/Tests/Dumper/CsvFileDumperTest.php +++ /dev/null | |||
@@ -1,33 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of the Symfony package. | ||
5 | * | ||
6 | * (c) Fabien Potencier <fabien@symfony.com> | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | namespace Symfony\Component\Translation\Tests\Dumper; | ||
13 | |||
14 | use Symfony\Component\Translation\MessageCatalogue; | ||
15 | use Symfony\Component\Translation\Dumper\CsvFileDumper; | ||
16 | |||
17 | class CsvFileDumperTest extends \PHPUnit_Framework_TestCase | ||
18 | { | ||
19 | public function testDump() | ||
20 | { | ||
21 | $catalogue = new MessageCatalogue('en'); | ||
22 | $catalogue->add(array('foo' => 'bar', 'bar' => 'foo | ||
23 | foo', 'foo;foo' => 'bar')); | ||
24 | |||
25 | $tempDir = sys_get_temp_dir(); | ||
26 | $dumper = new CsvFileDumper(); | ||
27 | $dumper->dump($catalogue, array('path' => $tempDir)); | ||
28 | |||
29 | $this->assertEquals(file_get_contents(__DIR__.'/../fixtures/valid.csv'), file_get_contents($tempDir.'/messages.en.csv')); | ||
30 | |||
31 | unlink($tempDir.'/messages.en.csv'); | ||
32 | } | ||
33 | } | ||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Tests/Dumper/IcuResFileDumperTest.php b/vendor/symfony/translation/Symfony/Component/Translation/Tests/Dumper/IcuResFileDumperTest.php deleted file mode 100644 index d187ef1d..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/Tests/Dumper/IcuResFileDumperTest.php +++ /dev/null | |||
@@ -1,37 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of the Symfony package. | ||
5 | * | ||
6 | * (c) Fabien Potencier <fabien@symfony.com> | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | namespace Symfony\Component\Translation\Tests\Dumper; | ||
13 | |||
14 | use Symfony\Component\Translation\MessageCatalogue; | ||
15 | use Symfony\Component\Translation\Dumper\IcuResFileDumper; | ||
16 | |||
17 | class IcuResFileDumperTest extends \PHPUnit_Framework_TestCase | ||
18 | { | ||
19 | public function testDump() | ||
20 | { | ||
21 | if (!extension_loaded('mbstring')) { | ||
22 | $this->markTestSkipped('This test requires mbstring to work.'); | ||
23 | } | ||
24 | |||
25 | $catalogue = new MessageCatalogue('en'); | ||
26 | $catalogue->add(array('foo' => 'bar')); | ||
27 | |||
28 | $tempDir = sys_get_temp_dir(); | ||
29 | $dumper = new IcuResFileDumper(); | ||
30 | $dumper->dump($catalogue, array('path' => $tempDir)); | ||
31 | |||
32 | $this->assertEquals(file_get_contents(__DIR__.'/../fixtures/resourcebundle/res/en.res'), file_get_contents($tempDir.'/messages/en.res')); | ||
33 | |||
34 | unlink($tempDir.'/messages/en.res'); | ||
35 | rmdir($tempDir.'/messages'); | ||
36 | } | ||
37 | } | ||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Tests/Dumper/IniFileDumperTest.php b/vendor/symfony/translation/Symfony/Component/Translation/Tests/Dumper/IniFileDumperTest.php deleted file mode 100644 index 2a2cefde..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/Tests/Dumper/IniFileDumperTest.php +++ /dev/null | |||
@@ -1,32 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of the Symfony package. | ||
5 | * | ||
6 | * (c) Fabien Potencier <fabien@symfony.com> | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | namespace Symfony\Component\Translation\Tests\Dumper; | ||
13 | |||
14 | use Symfony\Component\Translation\MessageCatalogue; | ||
15 | use Symfony\Component\Translation\Dumper\IniFileDumper; | ||
16 | |||
17 | class IniFileDumperTest extends \PHPUnit_Framework_TestCase | ||
18 | { | ||
19 | public function testDump() | ||
20 | { | ||
21 | $catalogue = new MessageCatalogue('en'); | ||
22 | $catalogue->add(array('foo' => 'bar')); | ||
23 | |||
24 | $tempDir = sys_get_temp_dir(); | ||
25 | $dumper = new IniFileDumper(); | ||
26 | $dumper->dump($catalogue, array('path' => $tempDir)); | ||
27 | |||
28 | $this->assertEquals(file_get_contents(__DIR__.'/../fixtures/resources.ini'), file_get_contents($tempDir.'/messages.en.ini')); | ||
29 | |||
30 | unlink($tempDir.'/messages.en.ini'); | ||
31 | } | ||
32 | } | ||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Tests/Dumper/MoFileDumperTest.php b/vendor/symfony/translation/Symfony/Component/Translation/Tests/Dumper/MoFileDumperTest.php deleted file mode 100644 index 439a25cd..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/Tests/Dumper/MoFileDumperTest.php +++ /dev/null | |||
@@ -1,31 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of the Symfony package. | ||
5 | * | ||
6 | * (c) Fabien Potencier <fabien@symfony.com> | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | namespace Symfony\Component\Translation\Tests\Dumper; | ||
13 | |||
14 | use Symfony\Component\Translation\MessageCatalogue; | ||
15 | use Symfony\Component\Translation\Dumper\MoFileDumper; | ||
16 | |||
17 | class MoFileDumperTest extends \PHPUnit_Framework_TestCase | ||
18 | { | ||
19 | public function testDump() | ||
20 | { | ||
21 | $catalogue = new MessageCatalogue('en'); | ||
22 | $catalogue->add(array('foo' => 'bar')); | ||
23 | |||
24 | $tempDir = sys_get_temp_dir(); | ||
25 | $dumper = new MoFileDumper(); | ||
26 | $dumper->dump($catalogue, array('path' => $tempDir)); | ||
27 | $this->assertEquals(file_get_contents(__DIR__.'/../fixtures/resources.mo'), file_get_contents($tempDir.'/messages.en.mo')); | ||
28 | |||
29 | unlink($tempDir.'/messages.en.mo'); | ||
30 | } | ||
31 | } | ||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Tests/Dumper/PhpFileDumperTest.php b/vendor/symfony/translation/Symfony/Component/Translation/Tests/Dumper/PhpFileDumperTest.php deleted file mode 100644 index 18be5a0d..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/Tests/Dumper/PhpFileDumperTest.php +++ /dev/null | |||
@@ -1,32 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of the Symfony package. | ||
5 | * | ||
6 | * (c) Fabien Potencier <fabien@symfony.com> | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | namespace Symfony\Component\Translation\Tests\Dumper; | ||
13 | |||
14 | use Symfony\Component\Translation\MessageCatalogue; | ||
15 | use Symfony\Component\Translation\Dumper\PhpFileDumper; | ||
16 | |||
17 | class PhpFileDumperTest extends \PHPUnit_Framework_TestCase | ||
18 | { | ||
19 | public function testDump() | ||
20 | { | ||
21 | $catalogue = new MessageCatalogue('en'); | ||
22 | $catalogue->add(array('foo' => 'bar')); | ||
23 | |||
24 | $tempDir = sys_get_temp_dir(); | ||
25 | $dumper = new PhpFileDumper(); | ||
26 | $dumper->dump($catalogue, array('path' => $tempDir)); | ||
27 | |||
28 | $this->assertEquals(file_get_contents(__DIR__.'/../fixtures/resources.php'), file_get_contents($tempDir.'/messages.en.php')); | ||
29 | |||
30 | unlink($tempDir.'/messages.en.php'); | ||
31 | } | ||
32 | } | ||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Tests/Dumper/PoFileDumperTest.php b/vendor/symfony/translation/Symfony/Component/Translation/Tests/Dumper/PoFileDumperTest.php deleted file mode 100644 index 0296d6b2..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/Tests/Dumper/PoFileDumperTest.php +++ /dev/null | |||
@@ -1,31 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of the Symfony package. | ||
5 | * | ||
6 | * (c) Fabien Potencier <fabien@symfony.com> | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | namespace Symfony\Component\Translation\Tests\Dumper; | ||
13 | |||
14 | use Symfony\Component\Translation\MessageCatalogue; | ||
15 | use Symfony\Component\Translation\Dumper\PoFileDumper; | ||
16 | |||
17 | class PoFileDumperTest extends \PHPUnit_Framework_TestCase | ||
18 | { | ||
19 | public function testDump() | ||
20 | { | ||
21 | $catalogue = new MessageCatalogue('en'); | ||
22 | $catalogue->add(array('foo' => 'bar')); | ||
23 | |||
24 | $tempDir = sys_get_temp_dir(); | ||
25 | $dumper = new PoFileDumper(); | ||
26 | $dumper->dump($catalogue, array('path' => $tempDir)); | ||
27 | $this->assertEquals(file_get_contents(__DIR__.'/../fixtures/resources.po'), file_get_contents($tempDir.'/messages.en.po')); | ||
28 | |||
29 | unlink($tempDir.'/messages.en.po'); | ||
30 | } | ||
31 | } | ||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Tests/Dumper/QtFileDumperTest.php b/vendor/symfony/translation/Symfony/Component/Translation/Tests/Dumper/QtFileDumperTest.php deleted file mode 100644 index d7d8fb7e..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/Tests/Dumper/QtFileDumperTest.php +++ /dev/null | |||
@@ -1,32 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of the Symfony package. | ||
5 | * | ||
6 | * (c) Fabien Potencier <fabien@symfony.com> | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | namespace Symfony\Component\Translation\Tests\Dumper; | ||
13 | |||
14 | use Symfony\Component\Translation\MessageCatalogue; | ||
15 | use Symfony\Component\Translation\Dumper\QtFileDumper; | ||
16 | |||
17 | class QtFileDumperTest extends \PHPUnit_Framework_TestCase | ||
18 | { | ||
19 | public function testDump() | ||
20 | { | ||
21 | $catalogue = new MessageCatalogue('en'); | ||
22 | $catalogue->add(array('foo' => 'bar'), 'resources'); | ||
23 | |||
24 | $tempDir = sys_get_temp_dir(); | ||
25 | $dumper = new QtFileDumper(); | ||
26 | $dumper->dump($catalogue, array('path' => $tempDir)); | ||
27 | |||
28 | $this->assertEquals(file_get_contents(__DIR__.'/../fixtures/resources.ts'), file_get_contents($tempDir.'/resources.en.ts')); | ||
29 | |||
30 | unlink($tempDir.'/resources.en.ts'); | ||
31 | } | ||
32 | } | ||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Tests/Dumper/XliffFileDumperTest.php b/vendor/symfony/translation/Symfony/Component/Translation/Tests/Dumper/XliffFileDumperTest.php deleted file mode 100644 index bef31358..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/Tests/Dumper/XliffFileDumperTest.php +++ /dev/null | |||
@@ -1,32 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of the Symfony package. | ||
5 | * | ||
6 | * (c) Fabien Potencier <fabien@symfony.com> | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | namespace Symfony\Component\Translation\Tests\Dumper; | ||
13 | |||
14 | use Symfony\Component\Translation\MessageCatalogue; | ||
15 | use Symfony\Component\Translation\Dumper\XliffFileDumper; | ||
16 | |||
17 | class XliffFileDumperTest extends \PHPUnit_Framework_TestCase | ||
18 | { | ||
19 | public function testDump() | ||
20 | { | ||
21 | $catalogue = new MessageCatalogue('en'); | ||
22 | $catalogue->add(array('foo' => 'bar', 'key' => '')); | ||
23 | |||
24 | $tempDir = sys_get_temp_dir(); | ||
25 | $dumper = new XliffFileDumper(); | ||
26 | $dumper->dump($catalogue, array('path' => $tempDir)); | ||
27 | |||
28 | $this->assertEquals(file_get_contents(__DIR__.'/../fixtures/resources-clean.xlf'), file_get_contents($tempDir.'/messages.en.xlf')); | ||
29 | |||
30 | unlink($tempDir.'/messages.en.xlf'); | ||
31 | } | ||
32 | } | ||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Tests/Dumper/YamlFileDumperTest.php b/vendor/symfony/translation/Symfony/Component/Translation/Tests/Dumper/YamlFileDumperTest.php deleted file mode 100644 index e4e68e02..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/Tests/Dumper/YamlFileDumperTest.php +++ /dev/null | |||
@@ -1,39 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of the Symfony package. | ||
5 | * | ||
6 | * (c) Fabien Potencier <fabien@symfony.com> | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | namespace Symfony\Component\Translation\Tests\Dumper; | ||
13 | |||
14 | use Symfony\Component\Translation\MessageCatalogue; | ||
15 | use Symfony\Component\Translation\Dumper\YamlFileDumper; | ||
16 | |||
17 | class YamlFileDumperTest extends \PHPUnit_Framework_TestCase | ||
18 | { | ||
19 | protected function setUp() | ||
20 | { | ||
21 | if (!class_exists('Symfony\Component\Yaml\Yaml')) { | ||
22 | $this->markTestSkipped('The "Yaml" component is not available'); | ||
23 | } | ||
24 | } | ||
25 | |||
26 | public function testDump() | ||
27 | { | ||
28 | $catalogue = new MessageCatalogue('en'); | ||
29 | $catalogue->add(array('foo' => 'bar')); | ||
30 | |||
31 | $tempDir = sys_get_temp_dir(); | ||
32 | $dumper = new YamlFileDumper(); | ||
33 | $dumper->dump($catalogue, array('path' => $tempDir)); | ||
34 | |||
35 | $this->assertEquals(file_get_contents(__DIR__.'/../fixtures/resources.yml'), file_get_contents($tempDir.'/messages.en.yml')); | ||
36 | |||
37 | unlink($tempDir.'/messages.en.yml'); | ||
38 | } | ||
39 | } | ||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Tests/IdentityTranslatorTest.php b/vendor/symfony/translation/Symfony/Component/Translation/Tests/IdentityTranslatorTest.php deleted file mode 100644 index 435f0c28..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/Tests/IdentityTranslatorTest.php +++ /dev/null | |||
@@ -1,61 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of the Symfony package. | ||
5 | * | ||
6 | * (c) Fabien Potencier <fabien@symfony.com> | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | namespace Symfony\Component\Translation\Tests; | ||
13 | |||
14 | use Symfony\Component\Translation\IdentityTranslator; | ||
15 | use Symfony\Component\Translation\MessageSelector; | ||
16 | |||
17 | class IdentityTranslatorTest extends \PHPUnit_Framework_TestCase | ||
18 | { | ||
19 | /** | ||
20 | * @dataProvider getTransTests | ||
21 | */ | ||
22 | public function testTrans($expected, $id, $parameters) | ||
23 | { | ||
24 | $translator = new IdentityTranslator(new MessageSelector()); | ||
25 | |||
26 | $this->assertEquals($expected, $translator->trans($id, $parameters)); | ||
27 | } | ||
28 | |||
29 | /** | ||
30 | * @dataProvider getTransChoiceTests | ||
31 | */ | ||
32 | public function testTransChoice($expected, $id, $number, $parameters) | ||
33 | { | ||
34 | $translator = new IdentityTranslator(new MessageSelector()); | ||
35 | |||
36 | $this->assertEquals($expected, $translator->transChoice($id, $number, $parameters)); | ||
37 | } | ||
38 | |||
39 | // noop | ||
40 | public function testGetSetLocale() | ||
41 | { | ||
42 | $translator = new IdentityTranslator(new MessageSelector()); | ||
43 | $translator->setLocale('en'); | ||
44 | $translator->getLocale(); | ||
45 | } | ||
46 | |||
47 | public function getTransTests() | ||
48 | { | ||
49 | return array( | ||
50 | array('Symfony2 is great!', 'Symfony2 is great!', array()), | ||
51 | array('Symfony2 is awesome!', 'Symfony2 is %what%!', array('%what%' => 'awesome')), | ||
52 | ); | ||
53 | } | ||
54 | |||
55 | public function getTransChoiceTests() | ||
56 | { | ||
57 | return array( | ||
58 | array('There is 10 apples', '{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples', 10, array('%count%' => 10)), | ||
59 | ); | ||
60 | } | ||
61 | } | ||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Tests/IntervalTest.php b/vendor/symfony/translation/Symfony/Component/Translation/Tests/IntervalTest.php deleted file mode 100644 index 075c98b7..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/Tests/IntervalTest.php +++ /dev/null | |||
@@ -1,48 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of the Symfony package. | ||
5 | * | ||
6 | * (c) Fabien Potencier <fabien@symfony.com> | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | namespace Symfony\Component\Translation\Tests; | ||
13 | |||
14 | use Symfony\Component\Translation\Interval; | ||
15 | |||
16 | class IntervalTest extends \PHPUnit_Framework_TestCase | ||
17 | { | ||
18 | /** | ||
19 | * @dataProvider getTests | ||
20 | */ | ||
21 | public function testTest($expected, $number, $interval) | ||
22 | { | ||
23 | $this->assertEquals($expected, Interval::test($number, $interval)); | ||
24 | } | ||
25 | |||
26 | /** | ||
27 | * @expectedException \InvalidArgumentException | ||
28 | */ | ||
29 | public function testTestException() | ||
30 | { | ||
31 | Interval::test(1, 'foobar'); | ||
32 | } | ||
33 | |||
34 | public function getTests() | ||
35 | { | ||
36 | return array( | ||
37 | array(true, 3, '{1,2, 3 ,4}'), | ||
38 | array(false, 10, '{1,2, 3 ,4}'), | ||
39 | array(false, 3, '[1,2]'), | ||
40 | array(true, 1, '[1,2]'), | ||
41 | array(true, 2, '[1,2]'), | ||
42 | array(false, 1, ']1,2['), | ||
43 | array(false, 2, ']1,2['), | ||
44 | array(true, log(0), '[-Inf,2['), | ||
45 | array(true, -log(0), '[-2,+Inf]'), | ||
46 | ); | ||
47 | } | ||
48 | } | ||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Tests/Loader/CsvFileLoaderTest.php b/vendor/symfony/translation/Symfony/Component/Translation/Tests/Loader/CsvFileLoaderTest.php deleted file mode 100644 index 59569a3d..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/Tests/Loader/CsvFileLoaderTest.php +++ /dev/null | |||
@@ -1,67 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of the Symfony package. | ||
5 | * | ||
6 | * (c) Fabien Potencier <fabien@symfony.com> | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | namespace Symfony\Component\Translation\Tests\Loader; | ||
13 | |||
14 | use Symfony\Component\Translation\Loader\CsvFileLoader; | ||
15 | use Symfony\Component\Config\Resource\FileResource; | ||
16 | |||
17 | class CsvFileLoaderTest extends \PHPUnit_Framework_TestCase | ||
18 | { | ||
19 | protected function setUp() | ||
20 | { | ||
21 | if (!class_exists('Symfony\Component\Config\Loader\Loader')) { | ||
22 | $this->markTestSkipped('The "Config" component is not available'); | ||
23 | } | ||
24 | } | ||
25 | |||
26 | public function testLoad() | ||
27 | { | ||
28 | $loader = new CsvFileLoader(); | ||
29 | $resource = __DIR__.'/../fixtures/resources.csv'; | ||
30 | $catalogue = $loader->load($resource, 'en', 'domain1'); | ||
31 | |||
32 | $this->assertEquals(array('foo' => 'bar'), $catalogue->all('domain1')); | ||
33 | $this->assertEquals('en', $catalogue->getLocale()); | ||
34 | $this->assertEquals(array(new FileResource($resource)), $catalogue->getResources()); | ||
35 | } | ||
36 | |||
37 | public function testLoadDoesNothingIfEmpty() | ||
38 | { | ||
39 | $loader = new CsvFileLoader(); | ||
40 | $resource = __DIR__.'/../fixtures/empty.csv'; | ||
41 | $catalogue = $loader->load($resource, 'en', 'domain1'); | ||
42 | |||
43 | $this->assertEquals(array(), $catalogue->all('domain1')); | ||
44 | $this->assertEquals('en', $catalogue->getLocale()); | ||
45 | $this->assertEquals(array(new FileResource($resource)), $catalogue->getResources()); | ||
46 | } | ||
47 | |||
48 | /** | ||
49 | * @expectedException \Symfony\Component\Translation\Exception\NotFoundResourceException | ||
50 | */ | ||
51 | public function testLoadNonExistingResource() | ||
52 | { | ||
53 | $loader = new CsvFileLoader(); | ||
54 | $resource = __DIR__.'/../fixtures/not-exists.csv'; | ||
55 | $loader->load($resource, 'en', 'domain1'); | ||
56 | } | ||
57 | |||
58 | /** | ||
59 | * @expectedException \Symfony\Component\Translation\Exception\InvalidResourceException | ||
60 | */ | ||
61 | public function testLoadNonLocalResource() | ||
62 | { | ||
63 | $loader = new CsvFileLoader(); | ||
64 | $resource = 'http://example.com/resources.csv'; | ||
65 | $loader->load($resource, 'en', 'domain1'); | ||
66 | } | ||
67 | } | ||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Tests/Loader/IcuDatFileLoaderTest.php b/vendor/symfony/translation/Symfony/Component/Translation/Tests/Loader/IcuDatFileLoaderTest.php deleted file mode 100644 index a3bd67ab..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/Tests/Loader/IcuDatFileLoaderTest.php +++ /dev/null | |||
@@ -1,72 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of the Symfony package. | ||
5 | * | ||
6 | * (c) Fabien Potencier <fabien@symfony.com> | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | namespace Symfony\Component\Translation\Tests\Loader; | ||
13 | |||
14 | use Symfony\Component\Translation\Loader\IcuDatFileLoader; | ||
15 | use Symfony\Component\Config\Resource\FileResource; | ||
16 | |||
17 | class IcuDatFileLoaderTest extends LocalizedTestCase | ||
18 | { | ||
19 | protected function setUp() | ||
20 | { | ||
21 | if (!class_exists('Symfony\Component\Config\Loader\Loader')) { | ||
22 | $this->markTestSkipped('The "Config" component is not available'); | ||
23 | } | ||
24 | |||
25 | if (!extension_loaded('intl')) { | ||
26 | $this->markTestSkipped('This test requires intl extension to work.'); | ||
27 | } | ||
28 | } | ||
29 | |||
30 | /** | ||
31 | * @expectedException \Symfony\Component\Translation\Exception\InvalidResourceException | ||
32 | */ | ||
33 | public function testLoadInvalidResource() | ||
34 | { | ||
35 | $loader = new IcuDatFileLoader(); | ||
36 | $loader->load(__DIR__.'/../fixtures/resourcebundle/corrupted/resources', 'es', 'domain2'); | ||
37 | } | ||
38 | |||
39 | public function testDatEnglishLoad() | ||
40 | { | ||
41 | // bundled resource is build using pkgdata command which at least in ICU 4.2 comes in extremely! buggy form | ||
42 | // you must specify an temporary build directory which is not the same as current directory and | ||
43 | // MUST reside on the same partition. pkgdata -p resources -T /srv -d.packagelist.txt | ||
44 | $loader = new IcuDatFileLoader(); | ||
45 | $resource = __DIR__.'/../fixtures/resourcebundle/dat/resources'; | ||
46 | $catalogue = $loader->load($resource, 'en', 'domain1'); | ||
47 | |||
48 | $this->assertEquals(array('symfony' => 'Symfony 2 is great'), $catalogue->all('domain1')); | ||
49 | $this->assertEquals('en', $catalogue->getLocale()); | ||
50 | $this->assertEquals(array(new FileResource($resource.'.dat')), $catalogue->getResources()); | ||
51 | } | ||
52 | |||
53 | public function testDatFrenchLoad() | ||
54 | { | ||
55 | $loader = new IcuDatFileLoader(); | ||
56 | $resource = __DIR__.'/../fixtures/resourcebundle/dat/resources'; | ||
57 | $catalogue = $loader->load($resource, 'fr', 'domain1'); | ||
58 | |||
59 | $this->assertEquals(array('symfony' => 'Symfony 2 est génial'), $catalogue->all('domain1')); | ||
60 | $this->assertEquals('fr', $catalogue->getLocale()); | ||
61 | $this->assertEquals(array(new FileResource($resource.'.dat')), $catalogue->getResources()); | ||
62 | } | ||
63 | |||
64 | /** | ||
65 | * @expectedException \Symfony\Component\Translation\Exception\NotFoundResourceException | ||
66 | */ | ||
67 | public function testLoadNonExistingResource() | ||
68 | { | ||
69 | $loader = new IcuDatFileLoader(); | ||
70 | $loader->load(__DIR__.'/../fixtures/non-existing.txt', 'en', 'domain1'); | ||
71 | } | ||
72 | } | ||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Tests/Loader/IcuResFileLoaderTest.php b/vendor/symfony/translation/Symfony/Component/Translation/Tests/Loader/IcuResFileLoaderTest.php deleted file mode 100644 index 233e1897..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/Tests/Loader/IcuResFileLoaderTest.php +++ /dev/null | |||
@@ -1,59 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of the Symfony package. | ||
5 | * | ||
6 | * (c) Fabien Potencier <fabien@symfony.com> | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | namespace Symfony\Component\Translation\Tests\Loader; | ||
13 | |||
14 | use Symfony\Component\Translation\Loader\IcuResFileLoader; | ||
15 | use Symfony\Component\Config\Resource\DirectoryResource; | ||
16 | |||
17 | class IcuResFileLoaderTest extends LocalizedTestCase | ||
18 | { | ||
19 | protected function setUp() | ||
20 | { | ||
21 | if (!class_exists('Symfony\Component\Config\Loader\Loader')) { | ||
22 | $this->markTestSkipped('The "Config" component is not available'); | ||
23 | } | ||
24 | |||
25 | if (!extension_loaded('intl')) { | ||
26 | $this->markTestSkipped('This test requires intl extension to work.'); | ||
27 | } | ||
28 | } | ||
29 | |||
30 | public function testLoad() | ||
31 | { | ||
32 | // resource is build using genrb command | ||
33 | $loader = new IcuResFileLoader(); | ||
34 | $resource = __DIR__.'/../fixtures/resourcebundle/res'; | ||
35 | $catalogue = $loader->load($resource, 'en', 'domain1'); | ||
36 | |||
37 | $this->assertEquals(array('foo' => 'bar'), $catalogue->all('domain1')); | ||
38 | $this->assertEquals('en', $catalogue->getLocale()); | ||
39 | $this->assertEquals(array(new DirectoryResource($resource)), $catalogue->getResources()); | ||
40 | } | ||
41 | |||
42 | /** | ||
43 | * @expectedException \Symfony\Component\Translation\Exception\NotFoundResourceException | ||
44 | */ | ||
45 | public function testLoadNonExistingResource() | ||
46 | { | ||
47 | $loader = new IcuResFileLoader(); | ||
48 | $loader->load(__DIR__.'/../fixtures/non-existing.txt', 'en', 'domain1'); | ||
49 | } | ||
50 | |||
51 | /** | ||
52 | * @expectedException \Symfony\Component\Translation\Exception\InvalidResourceException | ||
53 | */ | ||
54 | public function testLoadInvalidResource() | ||
55 | { | ||
56 | $loader = new IcuResFileLoader(); | ||
57 | $loader->load(__DIR__.'/../fixtures/resourcebundle/corrupted', 'en', 'domain1'); | ||
58 | } | ||
59 | } | ||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Tests/Loader/IniFileLoaderTest.php b/vendor/symfony/translation/Symfony/Component/Translation/Tests/Loader/IniFileLoaderTest.php deleted file mode 100644 index ae1289d0..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/Tests/Loader/IniFileLoaderTest.php +++ /dev/null | |||
@@ -1,57 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of the Symfony package. | ||
5 | * | ||
6 | * (c) Fabien Potencier <fabien@symfony.com> | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | namespace Symfony\Component\Translation\Tests\Loader; | ||
13 | |||
14 | use Symfony\Component\Translation\Loader\IniFileLoader; | ||
15 | use Symfony\Component\Config\Resource\FileResource; | ||
16 | |||
17 | class IniFileLoaderTest extends \PHPUnit_Framework_TestCase | ||
18 | { | ||
19 | protected function setUp() | ||
20 | { | ||
21 | if (!class_exists('Symfony\Component\Config\Loader\Loader')) { | ||
22 | $this->markTestSkipped('The "Config" component is not available'); | ||
23 | } | ||
24 | } | ||
25 | |||
26 | public function testLoad() | ||
27 | { | ||
28 | $loader = new IniFileLoader(); | ||
29 | $resource = __DIR__.'/../fixtures/resources.ini'; | ||
30 | $catalogue = $loader->load($resource, 'en', 'domain1'); | ||
31 | |||
32 | $this->assertEquals(array('foo' => 'bar'), $catalogue->all('domain1')); | ||
33 | $this->assertEquals('en', $catalogue->getLocale()); | ||
34 | $this->assertEquals(array(new FileResource($resource)), $catalogue->getResources()); | ||
35 | } | ||
36 | |||
37 | public function testLoadDoesNothingIfEmpty() | ||
38 | { | ||
39 | $loader = new IniFileLoader(); | ||
40 | $resource = __DIR__.'/../fixtures/empty.ini'; | ||
41 | $catalogue = $loader->load($resource, 'en', 'domain1'); | ||
42 | |||
43 | $this->assertEquals(array(), $catalogue->all('domain1')); | ||
44 | $this->assertEquals('en', $catalogue->getLocale()); | ||
45 | $this->assertEquals(array(new FileResource($resource)), $catalogue->getResources()); | ||
46 | } | ||
47 | |||
48 | /** | ||
49 | * @expectedException \Symfony\Component\Translation\Exception\NotFoundResourceException | ||
50 | */ | ||
51 | public function testLoadNonExistingResource() | ||
52 | { | ||
53 | $loader = new IniFileLoader(); | ||
54 | $resource = __DIR__.'/../fixtures/non-existing.ini'; | ||
55 | $loader->load($resource, 'en', 'domain1'); | ||
56 | } | ||
57 | } | ||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Tests/Loader/LocalizedTestCase.php b/vendor/symfony/translation/Symfony/Component/Translation/Tests/Loader/LocalizedTestCase.php deleted file mode 100644 index 9d7c5d70..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/Tests/Loader/LocalizedTestCase.php +++ /dev/null | |||
@@ -1,22 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of the Symfony package. | ||
5 | * | ||
6 | * (c) Fabien Potencier <fabien@symfony.com> | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | namespace Symfony\Component\Translation\Tests\Loader; | ||
13 | |||
14 | abstract class LocalizedTestCase extends \PHPUnit_Framework_TestCase | ||
15 | { | ||
16 | protected function setUp() | ||
17 | { | ||
18 | if (!extension_loaded('intl')) { | ||
19 | $this->markTestSkipped('The "intl" extension is not available'); | ||
20 | } | ||
21 | } | ||
22 | } | ||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Tests/Loader/MoFileLoaderTest.php b/vendor/symfony/translation/Symfony/Component/Translation/Tests/Loader/MoFileLoaderTest.php deleted file mode 100644 index c2616bda..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/Tests/Loader/MoFileLoaderTest.php +++ /dev/null | |||
@@ -1,67 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of the Symfony package. | ||
5 | * | ||
6 | * (c) Fabien Potencier <fabien@symfony.com> | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | namespace Symfony\Component\Translation\Tests\Loader; | ||
13 | |||
14 | use Symfony\Component\Translation\Loader\MoFileLoader; | ||
15 | use Symfony\Component\Config\Resource\FileResource; | ||
16 | |||
17 | class MoFileLoaderTest extends \PHPUnit_Framework_TestCase | ||
18 | { | ||
19 | protected function setUp() | ||
20 | { | ||
21 | if (!class_exists('Symfony\Component\Config\Loader\Loader')) { | ||
22 | $this->markTestSkipped('The "Config" component is not available'); | ||
23 | } | ||
24 | } | ||
25 | |||
26 | public function testLoad() | ||
27 | { | ||
28 | $loader = new MoFileLoader(); | ||
29 | $resource = __DIR__.'/../fixtures/resources.mo'; | ||
30 | $catalogue = $loader->load($resource, 'en', 'domain1'); | ||
31 | |||
32 | $this->assertEquals(array('foo' => 'bar'), $catalogue->all('domain1')); | ||
33 | $this->assertEquals('en', $catalogue->getLocale()); | ||
34 | $this->assertEquals(array(new FileResource($resource)), $catalogue->getResources()); | ||
35 | } | ||
36 | |||
37 | public function testLoadPlurals() | ||
38 | { | ||
39 | $loader = new MoFileLoader(); | ||
40 | $resource = __DIR__.'/../fixtures/plurals.mo'; | ||
41 | $catalogue = $loader->load($resource, 'en', 'domain1'); | ||
42 | |||
43 | $this->assertEquals(array('foo' => 'bar', 'foos' => '{0} bar|{1} bars'), $catalogue->all('domain1')); | ||
44 | $this->assertEquals('en', $catalogue->getLocale()); | ||
45 | $this->assertEquals(array(new FileResource($resource)), $catalogue->getResources()); | ||
46 | } | ||
47 | |||
48 | /** | ||
49 | * @expectedException \Symfony\Component\Translation\Exception\NotFoundResourceException | ||
50 | */ | ||
51 | public function testLoadNonExistingResource() | ||
52 | { | ||
53 | $loader = new MoFileLoader(); | ||
54 | $resource = __DIR__.'/../fixtures/non-existing.mo'; | ||
55 | $loader->load($resource, 'en', 'domain1'); | ||
56 | } | ||
57 | |||
58 | /** | ||
59 | * @expectedException \Symfony\Component\Translation\Exception\InvalidResourceException | ||
60 | */ | ||
61 | public function testLoadInvalidResource() | ||
62 | { | ||
63 | $loader = new MoFileLoader(); | ||
64 | $resource = __DIR__.'/../fixtures/empty.mo'; | ||
65 | $loader->load($resource, 'en', 'domain1'); | ||
66 | } | ||
67 | } | ||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Tests/Loader/PhpFileLoaderTest.php b/vendor/symfony/translation/Symfony/Component/Translation/Tests/Loader/PhpFileLoaderTest.php deleted file mode 100644 index 5dfe837d..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/Tests/Loader/PhpFileLoaderTest.php +++ /dev/null | |||
@@ -1,56 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of the Symfony package. | ||
5 | * | ||
6 | * (c) Fabien Potencier <fabien@symfony.com> | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | namespace Symfony\Component\Translation\Tests\Loader; | ||
13 | |||
14 | use Symfony\Component\Translation\Loader\PhpFileLoader; | ||
15 | use Symfony\Component\Config\Resource\FileResource; | ||
16 | |||
17 | class PhpFileLoaderTest extends \PHPUnit_Framework_TestCase | ||
18 | { | ||
19 | protected function setUp() | ||
20 | { | ||
21 | if (!class_exists('Symfony\Component\Config\Loader\Loader')) { | ||
22 | $this->markTestSkipped('The "Config" component is not available'); | ||
23 | } | ||
24 | } | ||
25 | |||
26 | public function testLoad() | ||
27 | { | ||
28 | $loader = new PhpFileLoader(); | ||
29 | $resource = __DIR__.'/../fixtures/resources.php'; | ||
30 | $catalogue = $loader->load($resource, 'en', 'domain1'); | ||
31 | |||
32 | $this->assertEquals(array('foo' => 'bar'), $catalogue->all('domain1')); | ||
33 | $this->assertEquals('en', $catalogue->getLocale()); | ||
34 | $this->assertEquals(array(new FileResource($resource)), $catalogue->getResources()); | ||
35 | } | ||
36 | |||
37 | /** | ||
38 | * @expectedException \Symfony\Component\Translation\Exception\NotFoundResourceException | ||
39 | */ | ||
40 | public function testLoadNonExistingResource() | ||
41 | { | ||
42 | $loader = new PhpFileLoader(); | ||
43 | $resource = __DIR__.'/../fixtures/non-existing.php'; | ||
44 | $loader->load($resource, 'en', 'domain1'); | ||
45 | } | ||
46 | |||
47 | /** | ||
48 | * @expectedException \Symfony\Component\Translation\Exception\InvalidResourceException | ||
49 | */ | ||
50 | public function testLoadThrowsAnExceptionIfFileNotLocal() | ||
51 | { | ||
52 | $loader = new PhpFileLoader(); | ||
53 | $resource = 'http://example.com/resources.php'; | ||
54 | $loader->load($resource, 'en', 'domain1'); | ||
55 | } | ||
56 | } | ||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Tests/Loader/PoFileLoaderTest.php b/vendor/symfony/translation/Symfony/Component/Translation/Tests/Loader/PoFileLoaderTest.php deleted file mode 100644 index cd3d85a1..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/Tests/Loader/PoFileLoaderTest.php +++ /dev/null | |||
@@ -1,79 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of the Symfony package. | ||
5 | * | ||
6 | * (c) Fabien Potencier <fabien@symfony.com> | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | namespace Symfony\Component\Translation\Tests\Loader; | ||
13 | |||
14 | use Symfony\Component\Translation\Loader\PoFileLoader; | ||
15 | use Symfony\Component\Config\Resource\FileResource; | ||
16 | |||
17 | class PoFileLoaderTest extends \PHPUnit_Framework_TestCase | ||
18 | { | ||
19 | protected function setUp() | ||
20 | { | ||
21 | if (!class_exists('Symfony\Component\Config\Loader\Loader')) { | ||
22 | $this->markTestSkipped('The "Config" component is not available'); | ||
23 | } | ||
24 | } | ||
25 | |||
26 | public function testLoad() | ||
27 | { | ||
28 | $loader = new PoFileLoader(); | ||
29 | $resource = __DIR__.'/../fixtures/resources.po'; | ||
30 | $catalogue = $loader->load($resource, 'en', 'domain1'); | ||
31 | |||
32 | $this->assertEquals(array('foo' => 'bar'), $catalogue->all('domain1')); | ||
33 | $this->assertEquals('en', $catalogue->getLocale()); | ||
34 | $this->assertEquals(array(new FileResource($resource)), $catalogue->getResources()); | ||
35 | } | ||
36 | |||
37 | public function testLoadPlurals() | ||
38 | { | ||
39 | $loader = new PoFileLoader(); | ||
40 | $resource = __DIR__.'/../fixtures/plurals.po'; | ||
41 | $catalogue = $loader->load($resource, 'en', 'domain1'); | ||
42 | |||
43 | $this->assertEquals(array('foo' => 'bar', 'foos' => 'bar|bars'), $catalogue->all('domain1')); | ||
44 | $this->assertEquals('en', $catalogue->getLocale()); | ||
45 | $this->assertEquals(array(new FileResource($resource)), $catalogue->getResources()); | ||
46 | } | ||
47 | |||
48 | public function testLoadDoesNothingIfEmpty() | ||
49 | { | ||
50 | $loader = new PoFileLoader(); | ||
51 | $resource = __DIR__.'/../fixtures/empty.po'; | ||
52 | $catalogue = $loader->load($resource, 'en', 'domain1'); | ||
53 | |||
54 | $this->assertEquals(array(), $catalogue->all('domain1')); | ||
55 | $this->assertEquals('en', $catalogue->getLocale()); | ||
56 | $this->assertEquals(array(new FileResource($resource)), $catalogue->getResources()); | ||
57 | } | ||
58 | |||
59 | /** | ||
60 | * @expectedException \Symfony\Component\Translation\Exception\NotFoundResourceException | ||
61 | */ | ||
62 | public function testLoadNonExistingResource() | ||
63 | { | ||
64 | $loader = new PoFileLoader(); | ||
65 | $resource = __DIR__.'/../fixtures/non-existing.po'; | ||
66 | $loader->load($resource, 'en', 'domain1'); | ||
67 | } | ||
68 | |||
69 | public function testLoadEmptyTranslation() | ||
70 | { | ||
71 | $loader = new PoFileLoader(); | ||
72 | $resource = __DIR__.'/../fixtures/empty-translation.po'; | ||
73 | $catalogue = $loader->load($resource, 'en', 'domain1'); | ||
74 | |||
75 | $this->assertEquals(array('foo' => ''), $catalogue->all('domain1')); | ||
76 | $this->assertEquals('en', $catalogue->getLocale()); | ||
77 | $this->assertEquals(array(new FileResource($resource)), $catalogue->getResources()); | ||
78 | } | ||
79 | } | ||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Tests/Loader/QtFileLoaderTest.php b/vendor/symfony/translation/Symfony/Component/Translation/Tests/Loader/QtFileLoaderTest.php deleted file mode 100644 index c1dd7b10..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/Tests/Loader/QtFileLoaderTest.php +++ /dev/null | |||
@@ -1,66 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of the Symfony package. | ||
5 | * | ||
6 | * (c) Fabien Potencier <fabien@symfony.com> | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | namespace Symfony\Component\Translation\Tests\Loader; | ||
13 | |||
14 | use Symfony\Component\Translation\Loader\QtFileLoader; | ||
15 | use Symfony\Component\Config\Resource\FileResource; | ||
16 | |||
17 | class QtFileLoaderTest extends \PHPUnit_Framework_TestCase | ||
18 | { | ||
19 | protected function setUp() | ||
20 | { | ||
21 | if (!class_exists('Symfony\Component\Config\Loader\Loader')) { | ||
22 | $this->markTestSkipped('The "Config" component is not available'); | ||
23 | } | ||
24 | } | ||
25 | |||
26 | public function testLoad() | ||
27 | { | ||
28 | $loader = new QtFileLoader(); | ||
29 | $resource = __DIR__.'/../fixtures/resources.ts'; | ||
30 | $catalogue = $loader->load($resource, 'en', 'resources'); | ||
31 | |||
32 | $this->assertEquals(array('foo' => 'bar'), $catalogue->all('resources')); | ||
33 | $this->assertEquals('en', $catalogue->getLocale()); | ||
34 | $this->assertEquals(array(new FileResource($resource)), $catalogue->getResources()); | ||
35 | } | ||
36 | |||
37 | /** | ||
38 | * @expectedException \Symfony\Component\Translation\Exception\NotFoundResourceException | ||
39 | */ | ||
40 | public function testLoadNonExistingResource() | ||
41 | { | ||
42 | $loader = new QtFileLoader(); | ||
43 | $resource = __DIR__.'/../fixtures/non-existing.ts'; | ||
44 | $loader->load($resource, 'en', 'domain1'); | ||
45 | } | ||
46 | |||
47 | /** | ||
48 | * @expectedException \Symfony\Component\Translation\Exception\InvalidResourceException | ||
49 | */ | ||
50 | public function testLoadNonLocalResource() | ||
51 | { | ||
52 | $loader = new QtFileLoader(); | ||
53 | $resource = 'http://domain1.com/resources.ts'; | ||
54 | $loader->load($resource, 'en', 'domain1'); | ||
55 | } | ||
56 | |||
57 | /** | ||
58 | * @expectedException \Symfony\Component\Translation\Exception\InvalidResourceException | ||
59 | */ | ||
60 | public function testLoadInvalidResource() | ||
61 | { | ||
62 | $loader = new QtFileLoader(); | ||
63 | $resource = __DIR__.'/../fixtures/invalid-xml-resources.xlf'; | ||
64 | $loader->load($resource, 'en', 'domain1'); | ||
65 | } | ||
66 | } | ||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Tests/Loader/XliffFileLoaderTest.php b/vendor/symfony/translation/Symfony/Component/Translation/Tests/Loader/XliffFileLoaderTest.php deleted file mode 100644 index 1d58e0ee..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/Tests/Loader/XliffFileLoaderTest.php +++ /dev/null | |||
@@ -1,113 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of the Symfony package. | ||
5 | * | ||
6 | * (c) Fabien Potencier <fabien@symfony.com> | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | namespace Symfony\Component\Translation\Tests\Loader; | ||
13 | |||
14 | use Symfony\Component\Translation\Loader\XliffFileLoader; | ||
15 | use Symfony\Component\Config\Resource\FileResource; | ||
16 | |||
17 | class XliffFileLoaderTest extends \PHPUnit_Framework_TestCase | ||
18 | { | ||
19 | protected function setUp() | ||
20 | { | ||
21 | if (!class_exists('Symfony\Component\Config\Loader\Loader')) { | ||
22 | $this->markTestSkipped('The "Config" component is not available'); | ||
23 | } | ||
24 | } | ||
25 | |||
26 | public function testLoad() | ||
27 | { | ||
28 | $loader = new XliffFileLoader(); | ||
29 | $resource = __DIR__.'/../fixtures/resources.xlf'; | ||
30 | $catalogue = $loader->load($resource, 'en', 'domain1'); | ||
31 | |||
32 | $this->assertEquals('en', $catalogue->getLocale()); | ||
33 | $this->assertEquals(array(new FileResource($resource)), $catalogue->getResources()); | ||
34 | } | ||
35 | |||
36 | public function testLoadWithResname() | ||
37 | { | ||
38 | $loader = new XliffFileLoader(); | ||
39 | $catalogue = $loader->load(__DIR__.'/../fixtures/resname.xlf', 'en', 'domain1'); | ||
40 | |||
41 | $this->assertEquals(array('foo' => 'bar', 'bar' => 'baz', 'baz' => 'foo'), $catalogue->all('domain1')); | ||
42 | } | ||
43 | |||
44 | public function testIncompleteResource() | ||
45 | { | ||
46 | $loader = new XliffFileLoader(); | ||
47 | $catalogue = $loader->load(__DIR__.'/../fixtures/resources.xlf', 'en', 'domain1'); | ||
48 | |||
49 | $this->assertEquals(array('foo' => 'bar', 'key' => '', 'test' => 'with'), $catalogue->all('domain1')); | ||
50 | $this->assertFalse($catalogue->has('extra', 'domain1')); | ||
51 | } | ||
52 | |||
53 | public function testEncoding() | ||
54 | { | ||
55 | if (!function_exists('iconv') && !function_exists('mb_convert_encoding')) { | ||
56 | $this->markTestSkipped('The iconv and mbstring extensions are not available.'); | ||
57 | } | ||
58 | |||
59 | $loader = new XliffFileLoader(); | ||
60 | $catalogue = $loader->load(__DIR__.'/../fixtures/encoding.xlf', 'en', 'domain1'); | ||
61 | |||
62 | $this->assertEquals(utf8_decode('föö'), $catalogue->get('bar', 'domain1')); | ||
63 | $this->assertEquals(utf8_decode('bär'), $catalogue->get('foo', 'domain1')); | ||
64 | } | ||
65 | |||
66 | /** | ||
67 | * @expectedException \Symfony\Component\Translation\Exception\InvalidResourceException | ||
68 | */ | ||
69 | public function testLoadInvalidResource() | ||
70 | { | ||
71 | $loader = new XliffFileLoader(); | ||
72 | $loader->load(__DIR__.'/../fixtures/resources.php', 'en', 'domain1'); | ||
73 | } | ||
74 | |||
75 | /** | ||
76 | * @expectedException \Symfony\Component\Translation\Exception\InvalidResourceException | ||
77 | */ | ||
78 | public function testLoadResourceDoesNotValidate() | ||
79 | { | ||
80 | $loader = new XliffFileLoader(); | ||
81 | $loader->load(__DIR__.'/../fixtures/non-valid.xlf', 'en', 'domain1'); | ||
82 | } | ||
83 | |||
84 | /** | ||
85 | * @expectedException \Symfony\Component\Translation\Exception\NotFoundResourceException | ||
86 | */ | ||
87 | public function testLoadNonExistingResource() | ||
88 | { | ||
89 | $loader = new XliffFileLoader(); | ||
90 | $resource = __DIR__.'/../fixtures/non-existing.xlf'; | ||
91 | $loader->load($resource, 'en', 'domain1'); | ||
92 | } | ||
93 | |||
94 | /** | ||
95 | * @expectedException \Symfony\Component\Translation\Exception\InvalidResourceException | ||
96 | */ | ||
97 | public function testLoadThrowsAnExceptionIfFileNotLocal() | ||
98 | { | ||
99 | $loader = new XliffFileLoader(); | ||
100 | $resource = 'http://example.com/resources.xlf'; | ||
101 | $loader->load($resource, 'en', 'domain1'); | ||
102 | } | ||
103 | |||
104 | /** | ||
105 | * @expectedException \Symfony\Component\Translation\Exception\InvalidResourceException | ||
106 | * @expectedExceptionMessage Document types are not allowed. | ||
107 | */ | ||
108 | public function testDocTypeIsNotAllowed() | ||
109 | { | ||
110 | $loader = new XliffFileLoader(); | ||
111 | $loader->load(__DIR__.'/../fixtures/withdoctype.xlf', 'en', 'domain1'); | ||
112 | } | ||
113 | } | ||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Tests/Loader/YamlFileLoaderTest.php b/vendor/symfony/translation/Symfony/Component/Translation/Tests/Loader/YamlFileLoaderTest.php deleted file mode 100644 index 511b1279..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/Tests/Loader/YamlFileLoaderTest.php +++ /dev/null | |||
@@ -1,81 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of the Symfony package. | ||
5 | * | ||
6 | * (c) Fabien Potencier <fabien@symfony.com> | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | namespace Symfony\Component\Translation\Tests\Loader; | ||
13 | |||
14 | use Symfony\Component\Translation\Loader\YamlFileLoader; | ||
15 | use Symfony\Component\Config\Resource\FileResource; | ||
16 | |||
17 | class YamlFileLoaderTest extends \PHPUnit_Framework_TestCase | ||
18 | { | ||
19 | protected function setUp() | ||
20 | { | ||
21 | if (!class_exists('Symfony\Component\Config\Loader\Loader')) { | ||
22 | $this->markTestSkipped('The "Config" component is not available'); | ||
23 | } | ||
24 | |||
25 | if (!class_exists('Symfony\Component\Yaml\Yaml')) { | ||
26 | $this->markTestSkipped('The "Yaml" component is not available'); | ||
27 | } | ||
28 | } | ||
29 | |||
30 | public function testLoad() | ||
31 | { | ||
32 | $loader = new YamlFileLoader(); | ||
33 | $resource = __DIR__.'/../fixtures/resources.yml'; | ||
34 | $catalogue = $loader->load($resource, 'en', 'domain1'); | ||
35 | |||
36 | $this->assertEquals(array('foo' => 'bar'), $catalogue->all('domain1')); | ||
37 | $this->assertEquals('en', $catalogue->getLocale()); | ||
38 | $this->assertEquals(array(new FileResource($resource)), $catalogue->getResources()); | ||
39 | } | ||
40 | |||
41 | public function testLoadDoesNothingIfEmpty() | ||
42 | { | ||
43 | $loader = new YamlFileLoader(); | ||
44 | $resource = __DIR__.'/../fixtures/empty.yml'; | ||
45 | $catalogue = $loader->load($resource, 'en', 'domain1'); | ||
46 | |||
47 | $this->assertEquals(array(), $catalogue->all('domain1')); | ||
48 | $this->assertEquals('en', $catalogue->getLocale()); | ||
49 | $this->assertEquals(array(new FileResource($resource)), $catalogue->getResources()); | ||
50 | } | ||
51 | |||
52 | /** | ||
53 | * @expectedException \Symfony\Component\Translation\Exception\NotFoundResourceException | ||
54 | */ | ||
55 | public function testLoadNonExistingResource() | ||
56 | { | ||
57 | $loader = new YamlFileLoader(); | ||
58 | $resource = __DIR__.'/../fixtures/non-existing.yml'; | ||
59 | $loader->load($resource, 'en', 'domain1'); | ||
60 | } | ||
61 | |||
62 | /** | ||
63 | * @expectedException \Symfony\Component\Translation\Exception\InvalidResourceException | ||
64 | */ | ||
65 | public function testLoadThrowsAnExceptionIfFileNotLocal() | ||
66 | { | ||
67 | $loader = new YamlFileLoader(); | ||
68 | $resource = 'http://example.com/resources.yml'; | ||
69 | $loader->load($resource, 'en', 'domain1'); | ||
70 | } | ||
71 | |||
72 | /** | ||
73 | * @expectedException \Symfony\Component\Translation\Exception\InvalidResourceException | ||
74 | */ | ||
75 | public function testLoadThrowsAnExceptionIfNotAnArray() | ||
76 | { | ||
77 | $loader = new YamlFileLoader(); | ||
78 | $resource = __DIR__.'/../fixtures/non-valid.yml'; | ||
79 | $loader->load($resource, 'en', 'domain1'); | ||
80 | } | ||
81 | } | ||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Tests/MessageCatalogueTest.php b/vendor/symfony/translation/Symfony/Component/Translation/Tests/MessageCatalogueTest.php deleted file mode 100644 index aa6f8707..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/Tests/MessageCatalogueTest.php +++ /dev/null | |||
@@ -1,212 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of the Symfony package. | ||
5 | * | ||
6 | * (c) Fabien Potencier <fabien@symfony.com> | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | namespace Symfony\Component\Translation\Tests; | ||
13 | |||
14 | use Symfony\Component\Translation\MessageCatalogue; | ||
15 | |||
16 | class MessageCatalogueTest extends \PHPUnit_Framework_TestCase | ||
17 | { | ||
18 | public function testGetLocale() | ||
19 | { | ||
20 | $catalogue = new MessageCatalogue('en'); | ||
21 | |||
22 | $this->assertEquals('en', $catalogue->getLocale()); | ||
23 | } | ||
24 | |||
25 | public function testGetDomains() | ||
26 | { | ||
27 | $catalogue = new MessageCatalogue('en', array('domain1' => array(), 'domain2' => array())); | ||
28 | |||
29 | $this->assertEquals(array('domain1', 'domain2'), $catalogue->getDomains()); | ||
30 | } | ||
31 | |||
32 | public function testAll() | ||
33 | { | ||
34 | $catalogue = new MessageCatalogue('en', $messages = array('domain1' => array('foo' => 'foo'), 'domain2' => array('bar' => 'bar'))); | ||
35 | |||
36 | $this->assertEquals(array('foo' => 'foo'), $catalogue->all('domain1')); | ||
37 | $this->assertEquals(array(), $catalogue->all('domain88')); | ||
38 | $this->assertEquals($messages, $catalogue->all()); | ||
39 | } | ||
40 | |||
41 | public function testHas() | ||
42 | { | ||
43 | $catalogue = new MessageCatalogue('en', array('domain1' => array('foo' => 'foo'), 'domain2' => array('bar' => 'bar'))); | ||
44 | |||
45 | $this->assertTrue($catalogue->has('foo', 'domain1')); | ||
46 | $this->assertFalse($catalogue->has('bar', 'domain1')); | ||
47 | $this->assertFalse($catalogue->has('foo', 'domain88')); | ||
48 | } | ||
49 | |||
50 | public function testGetSet() | ||
51 | { | ||
52 | $catalogue = new MessageCatalogue('en', array('domain1' => array('foo' => 'foo'), 'domain2' => array('bar' => 'bar'))); | ||
53 | $catalogue->set('foo1', 'foo1', 'domain1'); | ||
54 | |||
55 | $this->assertEquals('foo', $catalogue->get('foo', 'domain1')); | ||
56 | $this->assertEquals('foo1', $catalogue->get('foo1', 'domain1')); | ||
57 | } | ||
58 | |||
59 | public function testAdd() | ||
60 | { | ||
61 | $catalogue = new MessageCatalogue('en', array('domain1' => array('foo' => 'foo'), 'domain2' => array('bar' => 'bar'))); | ||
62 | $catalogue->add(array('foo1' => 'foo1'), 'domain1'); | ||
63 | |||
64 | $this->assertEquals('foo', $catalogue->get('foo', 'domain1')); | ||
65 | $this->assertEquals('foo1', $catalogue->get('foo1', 'domain1')); | ||
66 | |||
67 | $catalogue->add(array('foo' => 'bar'), 'domain1'); | ||
68 | $this->assertEquals('bar', $catalogue->get('foo', 'domain1')); | ||
69 | $this->assertEquals('foo1', $catalogue->get('foo1', 'domain1')); | ||
70 | |||
71 | $catalogue->add(array('foo' => 'bar'), 'domain88'); | ||
72 | $this->assertEquals('bar', $catalogue->get('foo', 'domain88')); | ||
73 | } | ||
74 | |||
75 | public function testReplace() | ||
76 | { | ||
77 | $catalogue = new MessageCatalogue('en', array('domain1' => array('foo' => 'foo'), 'domain2' => array('bar' => 'bar'))); | ||
78 | $catalogue->replace($messages = array('foo1' => 'foo1'), 'domain1'); | ||
79 | |||
80 | $this->assertEquals($messages, $catalogue->all('domain1')); | ||
81 | } | ||
82 | |||
83 | public function testAddCatalogue() | ||
84 | { | ||
85 | if (!class_exists('Symfony\Component\Config\Loader\Loader')) { | ||
86 | $this->markTestSkipped('The "Config" component is not available'); | ||
87 | } | ||
88 | |||
89 | $r = $this->getMock('Symfony\Component\Config\Resource\ResourceInterface'); | ||
90 | $r->expects($this->any())->method('__toString')->will($this->returnValue('r')); | ||
91 | |||
92 | $r1 = $this->getMock('Symfony\Component\Config\Resource\ResourceInterface'); | ||
93 | $r1->expects($this->any())->method('__toString')->will($this->returnValue('r1')); | ||
94 | |||
95 | $catalogue = new MessageCatalogue('en', array('domain1' => array('foo' => 'foo'), 'domain2' => array('bar' => 'bar'))); | ||
96 | $catalogue->addResource($r); | ||
97 | |||
98 | $catalogue1 = new MessageCatalogue('en', array('domain1' => array('foo1' => 'foo1'))); | ||
99 | $catalogue1->addResource($r1); | ||
100 | |||
101 | $catalogue->addCatalogue($catalogue1); | ||
102 | |||
103 | $this->assertEquals('foo', $catalogue->get('foo', 'domain1')); | ||
104 | $this->assertEquals('foo1', $catalogue->get('foo1', 'domain1')); | ||
105 | |||
106 | $this->assertEquals(array($r, $r1), $catalogue->getResources()); | ||
107 | } | ||
108 | |||
109 | public function testAddFallbackCatalogue() | ||
110 | { | ||
111 | if (!class_exists('Symfony\Component\Config\Loader\Loader')) { | ||
112 | $this->markTestSkipped('The "Config" component is not available'); | ||
113 | } | ||
114 | |||
115 | $r = $this->getMock('Symfony\Component\Config\Resource\ResourceInterface'); | ||
116 | $r->expects($this->any())->method('__toString')->will($this->returnValue('r')); | ||
117 | |||
118 | $r1 = $this->getMock('Symfony\Component\Config\Resource\ResourceInterface'); | ||
119 | $r1->expects($this->any())->method('__toString')->will($this->returnValue('r1')); | ||
120 | |||
121 | $catalogue = new MessageCatalogue('en_US', array('domain1' => array('foo' => 'foo'), 'domain2' => array('bar' => 'bar'))); | ||
122 | $catalogue->addResource($r); | ||
123 | |||
124 | $catalogue1 = new MessageCatalogue('en', array('domain1' => array('foo' => 'bar', 'foo1' => 'foo1'))); | ||
125 | $catalogue1->addResource($r1); | ||
126 | |||
127 | $catalogue->addFallbackCatalogue($catalogue1); | ||
128 | |||
129 | $this->assertEquals('foo', $catalogue->get('foo', 'domain1')); | ||
130 | $this->assertEquals('foo1', $catalogue->get('foo1', 'domain1')); | ||
131 | |||
132 | $this->assertEquals(array($r, $r1), $catalogue->getResources()); | ||
133 | } | ||
134 | |||
135 | /** | ||
136 | * @expectedException LogicException | ||
137 | */ | ||
138 | public function testAddFallbackCatalogueWithCircularReference() | ||
139 | { | ||
140 | $main = new MessageCatalogue('en_US'); | ||
141 | $fallback = new MessageCatalogue('fr_FR'); | ||
142 | |||
143 | $fallback->addFallbackCatalogue($main); | ||
144 | $main->addFallbackCatalogue($fallback); | ||
145 | } | ||
146 | |||
147 | /** | ||
148 | * @expectedException LogicException | ||
149 | */ | ||
150 | public function testAddCatalogueWhenLocaleIsNotTheSameAsTheCurrentOne() | ||
151 | { | ||
152 | $catalogue = new MessageCatalogue('en'); | ||
153 | $catalogue->addCatalogue(new MessageCatalogue('fr', array())); | ||
154 | } | ||
155 | |||
156 | public function testGetAddResource() | ||
157 | { | ||
158 | if (!class_exists('Symfony\Component\Config\Loader\Loader')) { | ||
159 | $this->markTestSkipped('The "Config" component is not available'); | ||
160 | } | ||
161 | |||
162 | $catalogue = new MessageCatalogue('en'); | ||
163 | $r = $this->getMock('Symfony\Component\Config\Resource\ResourceInterface'); | ||
164 | $r->expects($this->any())->method('__toString')->will($this->returnValue('r')); | ||
165 | $catalogue->addResource($r); | ||
166 | $catalogue->addResource($r); | ||
167 | $r1 = $this->getMock('Symfony\Component\Config\Resource\ResourceInterface'); | ||
168 | $r1->expects($this->any())->method('__toString')->will($this->returnValue('r1')); | ||
169 | $catalogue->addResource($r1); | ||
170 | |||
171 | $this->assertEquals(array($r, $r1), $catalogue->getResources()); | ||
172 | } | ||
173 | |||
174 | public function testMetadataDelete() | ||
175 | { | ||
176 | $catalogue = new MessageCatalogue('en'); | ||
177 | $this->assertEquals(array(), $catalogue->getMetadata('', ''), 'Metadata is empty'); | ||
178 | $catalogue->deleteMetadata('key', 'messages'); | ||
179 | $catalogue->deleteMetadata('', 'messages'); | ||
180 | $catalogue->deleteMetadata(); | ||
181 | } | ||
182 | |||
183 | public function testMetadataSetGetDelete() | ||
184 | { | ||
185 | $catalogue = new MessageCatalogue('en'); | ||
186 | $catalogue->setMetadata('key', 'value'); | ||
187 | $this->assertEquals('value', $catalogue->getMetadata('key', 'messages'), "Metadata 'key' = 'value'"); | ||
188 | |||
189 | $catalogue->setMetadata('key2', array()); | ||
190 | $this->assertEquals(array(), $catalogue->getMetadata('key2', 'messages'), 'Metadata key2 is array'); | ||
191 | |||
192 | $catalogue->deleteMetadata('key2', 'messages'); | ||
193 | $this->assertEquals(null, $catalogue->getMetadata('key2', 'messages'), 'Metadata key2 should is deleted.'); | ||
194 | |||
195 | $catalogue->deleteMetadata('key2', 'domain'); | ||
196 | $this->assertEquals(null, $catalogue->getMetadata('key2', 'domain'), 'Metadata key2 should is deleted.'); | ||
197 | } | ||
198 | |||
199 | public function testMetadataMerge() | ||
200 | { | ||
201 | $cat1 = new MessageCatalogue('en'); | ||
202 | $cat1->setMetadata('a', 'b'); | ||
203 | $this->assertEquals(array('messages' => array('a' => 'b')), $cat1->getMetadata('', ''), 'Cat1 contains messages metadata.'); | ||
204 | |||
205 | $cat2 = new MessageCatalogue('en'); | ||
206 | $cat2->setMetadata('b', 'c', 'domain'); | ||
207 | $this->assertEquals(array('domain' => array('b' => 'c')), $cat2->getMetadata('', ''), 'Cat2 contains domain metadata.'); | ||
208 | |||
209 | $cat1->addCatalogue($cat2); | ||
210 | $this->assertEquals(array('messages' => array('a' => 'b'), 'domain' => array('b' => 'c')), $cat1->getMetadata('', ''), 'Cat1 contains merged metadata.'); | ||
211 | } | ||
212 | } | ||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Tests/MessageSelectorTest.php b/vendor/symfony/translation/Symfony/Component/Translation/Tests/MessageSelectorTest.php deleted file mode 100644 index 74956294..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/Tests/MessageSelectorTest.php +++ /dev/null | |||
@@ -1,80 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of the Symfony package. | ||
5 | * | ||
6 | * (c) Fabien Potencier <fabien@symfony.com> | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | namespace Symfony\Component\Translation\Tests; | ||
13 | |||
14 | use Symfony\Component\Translation\MessageSelector; | ||
15 | |||
16 | class MessageSelectorTest extends \PHPUnit_Framework_TestCase | ||
17 | { | ||
18 | /** | ||
19 | * @dataProvider getChooseTests | ||
20 | */ | ||
21 | public function testChoose($expected, $id, $number) | ||
22 | { | ||
23 | $selector = new MessageSelector(); | ||
24 | |||
25 | $this->assertEquals($expected, $selector->choose($id, $number, 'en')); | ||
26 | } | ||
27 | |||
28 | /** | ||
29 | * @expectedException InvalidArgumentException | ||
30 | */ | ||
31 | public function testChooseWhenNoEnoughChoices() | ||
32 | { | ||
33 | $selector = new MessageSelector(); | ||
34 | |||
35 | $selector->choose('foo', 10, 'en'); | ||
36 | } | ||
37 | |||
38 | public function getChooseTests() | ||
39 | { | ||
40 | return array( | ||
41 | array('There is no apples', '{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples', 0), | ||
42 | array('There is no apples', '{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples', 0), | ||
43 | array('There is no apples', '{0}There is no apples|{1} There is one apple|]1,Inf] There is %count% apples', 0), | ||
44 | |||
45 | array('There is one apple', '{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples', 1), | ||
46 | |||
47 | array('There is %count% apples', '{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples', 10), | ||
48 | array('There is %count% apples', '{0} There is no apples|{1} There is one apple|]1,Inf]There is %count% apples', 10), | ||
49 | array('There is %count% apples', '{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples', 10), | ||
50 | |||
51 | array('There is %count% apples', 'There is one apple|There is %count% apples', 0), | ||
52 | array('There is one apple', 'There is one apple|There is %count% apples', 1), | ||
53 | array('There is %count% apples', 'There is one apple|There is %count% apples', 10), | ||
54 | |||
55 | array('There is %count% apples', 'one: There is one apple|more: There is %count% apples', 0), | ||
56 | array('There is one apple', 'one: There is one apple|more: There is %count% apples', 1), | ||
57 | array('There is %count% apples', 'one: There is one apple|more: There is %count% apples', 10), | ||
58 | |||
59 | array('There is no apples', '{0} There is no apples|one: There is one apple|more: There is %count% apples', 0), | ||
60 | array('There is one apple', '{0} There is no apples|one: There is one apple|more: There is %count% apples', 1), | ||
61 | array('There is %count% apples', '{0} There is no apples|one: There is one apple|more: There is %count% apples', 10), | ||
62 | |||
63 | array('', '{0}|{1} There is one apple|]1,Inf] There is %count% apples', 0), | ||
64 | array('', '{0} There is no apples|{1}|]1,Inf] There is %count% apples', 1), | ||
65 | |||
66 | // Indexed only tests which are Gettext PoFile* compatible strings. | ||
67 | array('There are %count% apples', 'There is one apple|There are %count% apples', 0), | ||
68 | array('There is one apple', 'There is one apple|There are %count% apples', 1), | ||
69 | array('There are %count% apples', 'There is one apple|There are %count% apples', 2), | ||
70 | |||
71 | // Tests for float numbers | ||
72 | array('There is almost one apple', '{0} There is no apples|]0,1[ There is almost one apple|{1} There is one apple|[1,Inf] There is more than one apple', 0.7), | ||
73 | array('There is one apple', '{0} There is no apples|]0,1[There are %count% apples|{1} There is one apple|[1,Inf] There is more than one apple', 1), | ||
74 | array('There is more than one apple', '{0} There is no apples|]0,1[There are %count% apples|{1} There is one apple|[1,Inf] There is more than one apple', 1.7), | ||
75 | array('There is no apples', '{0} There is no apples|]0,1[There are %count% apples|{1} There is one apple|[1,Inf] There is more than one apple', 0), | ||
76 | array('There is no apples', '{0} There is no apples|]0,1[There are %count% apples|{1} There is one apple|[1,Inf] There is more than one apple', 0.0), | ||
77 | array('There is no apples', '{0.0} There is no apples|]0,1[There are %count% apples|{1} There is one apple|[1,Inf] There is more than one apple', 0), | ||
78 | ); | ||
79 | } | ||
80 | } | ||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Tests/PluralizationRulesTest.php b/vendor/symfony/translation/Symfony/Component/Translation/Tests/PluralizationRulesTest.php deleted file mode 100644 index 26f9e2f9..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/Tests/PluralizationRulesTest.php +++ /dev/null | |||
@@ -1,124 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of the Symfony package. | ||
5 | * | ||
6 | * (c) Fabien Potencier <fabien@symfony.com> | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | namespace Symfony\Component\Translation\Tests; | ||
13 | |||
14 | use Symfony\Component\Translation\PluralizationRules; | ||
15 | |||
16 | /** | ||
17 | * Test should cover all languages mentioned on http://translate.sourceforge.net/wiki/l10n/pluralforms | ||
18 | * and Plural forms mentioned on http://www.gnu.org/software/gettext/manual/gettext.html#Plural-forms | ||
19 | * | ||
20 | * See also https://developer.mozilla.org/en/Localization_and_Plurals which mentions 15 rules having a maximum of 6 forms. | ||
21 | * The mozilla code is also interesting to check for. | ||
22 | * | ||
23 | * As mentioned by chx http://drupal.org/node/1273968 we can cover all by testing number from 0 to 199 | ||
24 | * | ||
25 | * The goal to cover all languages is to far fetched so this test case is smaller. | ||
26 | * | ||
27 | * @author Clemens Tolboom clemens@build2be.nl | ||
28 | */ | ||
29 | class PluralizationRulesTest extends \PHPUnit_Framework_TestCase | ||
30 | { | ||
31 | |||
32 | /** | ||
33 | * We test failed langcode here. | ||
34 | * | ||
35 | * TODO: The languages mentioned in the data provide need to get fixed somehow within PluralizationRules. | ||
36 | * | ||
37 | * @dataProvider failingLangcodes | ||
38 | */ | ||
39 | public function testFailedLangcodes($nplural, $langCodes) | ||
40 | { | ||
41 | $matrix = $this->generateTestData($nplural, $langCodes); | ||
42 | $this->validateMatrix($nplural, $matrix, false); | ||
43 | } | ||
44 | |||
45 | /** | ||
46 | * @dataProvider successLangcodes | ||
47 | */ | ||
48 | public function testLangcodes($nplural, $langCodes) | ||
49 | { | ||
50 | $matrix = $this->generateTestData($nplural, $langCodes); | ||
51 | $this->validateMatrix($nplural, $matrix); | ||
52 | } | ||
53 | |||
54 | /** | ||
55 | * This array should contain all currently known langcodes. | ||
56 | * | ||
57 | * As it is impossible to have this ever complete we should try as hard as possible to have it almost complete. | ||
58 | * | ||
59 | * @return type | ||
60 | */ | ||
61 | public function successLangcodes() | ||
62 | { | ||
63 | return array( | ||
64 | array('1' , array('ay','bo', 'cgg','dz','id', 'ja', 'jbo', 'ka','kk','km','ko','ky')), | ||
65 | array('2' , array('nl', 'fr', 'en', 'de', 'de_GE')), | ||
66 | array('3' , array('be','bs','cs','hr')), | ||
67 | array('4' , array('cy','mt', 'sl')), | ||
68 | array('5' , array()), | ||
69 | array('6' , array('ar')), | ||
70 | ); | ||
71 | } | ||
72 | |||
73 | /** | ||
74 | * This array should be at least empty within the near future. | ||
75 | * | ||
76 | * This both depends on a complete list trying to add above as understanding | ||
77 | * the plural rules of the current failing languages. | ||
78 | * | ||
79 | * @return array with nplural together with langcodes | ||
80 | */ | ||
81 | public function failingLangcodes() | ||
82 | { | ||
83 | return array( | ||
84 | array('1' , array('fa')), | ||
85 | array('2' , array('jbo')), | ||
86 | array('3' , array('cbs')), | ||
87 | array('4' , array('gd','kw')), | ||
88 | array('5' , array('ga')), | ||
89 | array('6' , array()), | ||
90 | ); | ||
91 | } | ||
92 | |||
93 | /** | ||
94 | * We validate only on the plural coverage. Thus the real rules is not tested. | ||
95 | * | ||
96 | * @param string $nplural plural expected | ||
97 | * @param array $matrix containing langcodes and their plural index values. | ||
98 | * @param boolean $expectSuccess | ||
99 | */ | ||
100 | protected function validateMatrix($nplural, $matrix, $expectSuccess = true) | ||
101 | { | ||
102 | foreach ($matrix as $langCode => $data) { | ||
103 | $indexes = array_flip($data); | ||
104 | if ($expectSuccess) { | ||
105 | $this->assertEquals($nplural, count($indexes), "Langcode '$langCode' has '$nplural' plural forms."); | ||
106 | } else { | ||
107 | $this->assertNotEquals((int) $nplural, count($indexes), "Langcode '$langCode' has '$nplural' plural forms."); | ||
108 | } | ||
109 | } | ||
110 | } | ||
111 | |||
112 | protected function generateTestData($plural, $langCodes) | ||
113 | { | ||
114 | $matrix = array(); | ||
115 | foreach ($langCodes as $langCode) { | ||
116 | for ($count=0; $count<200; $count++) { | ||
117 | $plural = PluralizationRules::get($count, $langCode); | ||
118 | $matrix[$langCode][$count] = $plural; | ||
119 | } | ||
120 | } | ||
121 | |||
122 | return $matrix; | ||
123 | } | ||
124 | } | ||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Tests/TranslatorTest.php b/vendor/symfony/translation/Symfony/Component/Translation/Tests/TranslatorTest.php deleted file mode 100644 index fb843d72..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/Tests/TranslatorTest.php +++ /dev/null | |||
@@ -1,306 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of the Symfony package. | ||
5 | * | ||
6 | * (c) Fabien Potencier <fabien@symfony.com> | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | namespace Symfony\Component\Translation\Tests; | ||
13 | |||
14 | use Symfony\Component\Translation\Translator; | ||
15 | use Symfony\Component\Translation\MessageSelector; | ||
16 | use Symfony\Component\Translation\Loader\ArrayLoader; | ||
17 | |||
18 | class TranslatorTest extends \PHPUnit_Framework_TestCase | ||
19 | { | ||
20 | public function testSetGetLocale() | ||
21 | { | ||
22 | $translator = new Translator('en', new MessageSelector()); | ||
23 | |||
24 | $this->assertEquals('en', $translator->getLocale()); | ||
25 | |||
26 | $translator->setLocale('fr'); | ||
27 | $this->assertEquals('fr', $translator->getLocale()); | ||
28 | } | ||
29 | |||
30 | public function testSetFallbackLocales() | ||
31 | { | ||
32 | $translator = new Translator('en', new MessageSelector()); | ||
33 | $translator->addLoader('array', new ArrayLoader()); | ||
34 | $translator->addResource('array', array('foo' => 'foofoo'), 'en'); | ||
35 | $translator->addResource('array', array('bar' => 'foobar'), 'fr'); | ||
36 | |||
37 | // force catalogue loading | ||
38 | $translator->trans('bar'); | ||
39 | |||
40 | $translator->setFallbackLocales(array('fr')); | ||
41 | $this->assertEquals('foobar', $translator->trans('bar')); | ||
42 | } | ||
43 | |||
44 | public function testSetFallbackLocalesMultiple() | ||
45 | { | ||
46 | $translator = new Translator('en', new MessageSelector()); | ||
47 | $translator->addLoader('array', new ArrayLoader()); | ||
48 | $translator->addResource('array', array('foo' => 'foo (en)'), 'en'); | ||
49 | $translator->addResource('array', array('bar' => 'bar (fr)'), 'fr'); | ||
50 | |||
51 | // force catalogue loading | ||
52 | $translator->trans('bar'); | ||
53 | |||
54 | $translator->setFallbackLocales(array('fr_FR', 'fr')); | ||
55 | $this->assertEquals('bar (fr)', $translator->trans('bar')); | ||
56 | } | ||
57 | |||
58 | public function testTransWithFallbackLocale() | ||
59 | { | ||
60 | $translator = new Translator('fr_FR', new MessageSelector()); | ||
61 | $translator->addLoader('array', new ArrayLoader()); | ||
62 | $translator->addResource('array', array('foo' => 'foofoo'), 'en_US'); | ||
63 | $translator->addResource('array', array('bar' => 'foobar'), 'en'); | ||
64 | |||
65 | $translator->setFallbackLocales(array('en')); | ||
66 | |||
67 | $this->assertEquals('foobar', $translator->trans('bar')); | ||
68 | } | ||
69 | |||
70 | public function testAddResourceAfterTrans() | ||
71 | { | ||
72 | $translator = new Translator('fr', new MessageSelector()); | ||
73 | $translator->addLoader('array', new ArrayLoader()); | ||
74 | |||
75 | $translator->setFallbackLocale(array('en')); | ||
76 | |||
77 | $translator->addResource('array', array('foo' => 'foofoo'), 'en'); | ||
78 | $this->assertEquals('foofoo', $translator->trans('foo')); | ||
79 | |||
80 | $translator->addResource('array', array('bar' => 'foobar'), 'en'); | ||
81 | $this->assertEquals('foobar', $translator->trans('bar')); | ||
82 | } | ||
83 | |||
84 | /** | ||
85 | * @dataProvider getTransFileTests | ||
86 | * @expectedException \Symfony\Component\Translation\Exception\NotFoundResourceException | ||
87 | */ | ||
88 | public function testTransWithoutFallbackLocaleFile($format, $loader) | ||
89 | { | ||
90 | $loaderClass = 'Symfony\\Component\\Translation\\Loader\\'.$loader; | ||
91 | $translator = new Translator('en', new MessageSelector()); | ||
92 | $translator->addLoader($format, new $loaderClass()); | ||
93 | $translator->addResource($format, __DIR__.'/fixtures/non-existing', 'en'); | ||
94 | $translator->addResource($format, __DIR__.'/fixtures/resources.'.$format, 'en'); | ||
95 | |||
96 | // force catalogue loading | ||
97 | $translator->trans('foo'); | ||
98 | } | ||
99 | |||
100 | /** | ||
101 | * @dataProvider getTransFileTests | ||
102 | */ | ||
103 | public function testTransWithFallbackLocaleFile($format, $loader) | ||
104 | { | ||
105 | $loaderClass = 'Symfony\\Component\\Translation\\Loader\\'.$loader; | ||
106 | $translator = new Translator('en_GB', new MessageSelector()); | ||
107 | $translator->addLoader($format, new $loaderClass()); | ||
108 | $translator->addResource($format, __DIR__.'/fixtures/non-existing', 'en_GB'); | ||
109 | $translator->addResource($format, __DIR__.'/fixtures/resources.'.$format, 'en', 'resources'); | ||
110 | |||
111 | $this->assertEquals('bar', $translator->trans('foo', array(), 'resources')); | ||
112 | } | ||
113 | |||
114 | public function testTransWithFallbackLocaleBis() | ||
115 | { | ||
116 | $translator = new Translator('en_US', new MessageSelector()); | ||
117 | $translator->addLoader('array', new ArrayLoader()); | ||
118 | $translator->addResource('array', array('foo' => 'foofoo'), 'en_US'); | ||
119 | $translator->addResource('array', array('bar' => 'foobar'), 'en'); | ||
120 | $this->assertEquals('foobar', $translator->trans('bar')); | ||
121 | } | ||
122 | |||
123 | public function testTransWithFallbackLocaleTer() | ||
124 | { | ||
125 | $translator = new Translator('fr_FR', new MessageSelector()); | ||
126 | $translator->addLoader('array', new ArrayLoader()); | ||
127 | $translator->addResource('array', array('foo' => 'foo (en_US)'), 'en_US'); | ||
128 | $translator->addResource('array', array('bar' => 'bar (en)'), 'en'); | ||
129 | |||
130 | $translator->setFallbackLocales(array('en_US', 'en')); | ||
131 | |||
132 | $this->assertEquals('foo (en_US)', $translator->trans('foo')); | ||
133 | $this->assertEquals('bar (en)', $translator->trans('bar')); | ||
134 | } | ||
135 | |||
136 | public function testTransNonExistentWithFallback() | ||
137 | { | ||
138 | $translator = new Translator('fr', new MessageSelector()); | ||
139 | $translator->setFallbackLocales(array('en')); | ||
140 | $translator->addLoader('array', new ArrayLoader()); | ||
141 | $this->assertEquals('non-existent', $translator->trans('non-existent')); | ||
142 | } | ||
143 | |||
144 | /** | ||
145 | * @expectedException RuntimeException | ||
146 | */ | ||
147 | public function testWhenAResourceHasNoRegisteredLoader() | ||
148 | { | ||
149 | $translator = new Translator('en', new MessageSelector()); | ||
150 | $translator->addResource('array', array('foo' => 'foofoo'), 'en'); | ||
151 | |||
152 | $translator->trans('foo'); | ||
153 | } | ||
154 | |||
155 | /** | ||
156 | * @dataProvider getTransTests | ||
157 | */ | ||
158 | public function testTrans($expected, $id, $translation, $parameters, $locale, $domain) | ||
159 | { | ||
160 | $translator = new Translator('en', new MessageSelector()); | ||
161 | $translator->addLoader('array', new ArrayLoader()); | ||
162 | $translator->addResource('array', array((string) $id => $translation), $locale, $domain); | ||
163 | |||
164 | $this->assertEquals($expected, $translator->trans($id, $parameters, $domain, $locale)); | ||
165 | } | ||
166 | |||
167 | /** | ||
168 | * @dataProvider getFlattenedTransTests | ||
169 | */ | ||
170 | public function testFlattenedTrans($expected, $messages, $id) | ||
171 | { | ||
172 | $translator = new Translator('en', new MessageSelector()); | ||
173 | $translator->addLoader('array', new ArrayLoader()); | ||
174 | $translator->addResource('array', $messages, 'fr', ''); | ||
175 | |||
176 | $this->assertEquals($expected, $translator->trans($id, array(), '', 'fr')); | ||
177 | } | ||
178 | |||
179 | /** | ||
180 | * @dataProvider getTransChoiceTests | ||
181 | */ | ||
182 | public function testTransChoice($expected, $id, $translation, $number, $parameters, $locale, $domain) | ||
183 | { | ||
184 | $translator = new Translator('en', new MessageSelector()); | ||
185 | $translator->addLoader('array', new ArrayLoader()); | ||
186 | $translator->addResource('array', array((string) $id => $translation), $locale, $domain); | ||
187 | |||
188 | $this->assertEquals($expected, $translator->transChoice($id, $number, $parameters, $domain, $locale)); | ||
189 | } | ||
190 | |||
191 | public function getTransFileTests() | ||
192 | { | ||
193 | return array( | ||
194 | array('csv', 'CsvFileLoader'), | ||
195 | array('ini', 'IniFileLoader'), | ||
196 | array('mo', 'MoFileLoader'), | ||
197 | array('po', 'PoFileLoader'), | ||
198 | array('php', 'PhpFileLoader'), | ||
199 | array('ts', 'QtFileLoader'), | ||
200 | array('xlf', 'XliffFileLoader'), | ||
201 | array('yml', 'YamlFileLoader'), | ||
202 | ); | ||
203 | } | ||
204 | |||
205 | public function getTransTests() | ||
206 | { | ||
207 | return array( | ||
208 | array('Symfony2 est super !', 'Symfony2 is great!', 'Symfony2 est super !', array(), 'fr', ''), | ||
209 | array('Symfony2 est awesome !', 'Symfony2 is %what%!', 'Symfony2 est %what% !', array('%what%' => 'awesome'), 'fr', ''), | ||
210 | array('Symfony2 est super !', new String('Symfony2 is great!'), 'Symfony2 est super !', array(), 'fr', ''), | ||
211 | ); | ||
212 | } | ||
213 | |||
214 | public function getFlattenedTransTests() | ||
215 | { | ||
216 | $messages = array( | ||
217 | 'symfony2' => array( | ||
218 | 'is' => array( | ||
219 | 'great' => 'Symfony2 est super!' | ||
220 | ) | ||
221 | ), | ||
222 | 'foo' => array( | ||
223 | 'bar' => array( | ||
224 | 'baz' => 'Foo Bar Baz' | ||
225 | ), | ||
226 | 'baz' => 'Foo Baz', | ||
227 | ), | ||
228 | ); | ||
229 | |||
230 | return array( | ||
231 | array('Symfony2 est super!', $messages, 'symfony2.is.great'), | ||
232 | array('Foo Bar Baz', $messages, 'foo.bar.baz'), | ||
233 | array('Foo Baz', $messages, 'foo.baz'), | ||
234 | ); | ||
235 | } | ||
236 | |||
237 | public function getTransChoiceTests() | ||
238 | { | ||
239 | return array( | ||
240 | array('Il y a 0 pomme', '{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples', '[0,1] Il y a %count% pomme|]1,Inf] Il y a %count% pommes', 0, array('%count%' => 0), 'fr', ''), | ||
241 | array('Il y a 1 pomme', '{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples', '[0,1] Il y a %count% pomme|]1,Inf] Il y a %count% pommes', 1, array('%count%' => 1), 'fr', ''), | ||
242 | array('Il y a 10 pommes', '{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples', '[0,1] Il y a %count% pomme|]1,Inf] Il y a %count% pommes', 10, array('%count%' => 10), 'fr', ''), | ||
243 | |||
244 | array('Il y a 0 pomme', 'There is one apple|There is %count% apples', 'Il y a %count% pomme|Il y a %count% pommes', 0, array('%count%' => 0), 'fr', ''), | ||
245 | array('Il y a 1 pomme', 'There is one apple|There is %count% apples', 'Il y a %count% pomme|Il y a %count% pommes', 1, array('%count%' => 1), 'fr', ''), | ||
246 | array('Il y a 10 pommes', 'There is one apple|There is %count% apples', 'Il y a %count% pomme|Il y a %count% pommes', 10, array('%count%' => 10), 'fr', ''), | ||
247 | |||
248 | array('Il y a 0 pomme', 'one: There is one apple|more: There is %count% apples', 'one: Il y a %count% pomme|more: Il y a %count% pommes', 0, array('%count%' => 0), 'fr', ''), | ||
249 | array('Il y a 1 pomme', 'one: There is one apple|more: There is %count% apples', 'one: Il y a %count% pomme|more: Il y a %count% pommes', 1, array('%count%' => 1), 'fr', ''), | ||
250 | array('Il y a 10 pommes', 'one: There is one apple|more: There is %count% apples', 'one: Il y a %count% pomme|more: Il y a %count% pommes', 10, array('%count%' => 10), 'fr', ''), | ||
251 | |||
252 | array('Il n\'y a aucune pomme', '{0} There is no apple|one: There is one apple|more: There is %count% apples', '{0} Il n\'y a aucune pomme|one: Il y a %count% pomme|more: Il y a %count% pommes', 0, array('%count%' => 0), 'fr', ''), | ||
253 | array('Il y a 1 pomme', '{0} There is no apple|one: There is one apple|more: There is %count% apples', '{0} Il n\'y a aucune pomme|one: Il y a %count% pomme|more: Il y a %count% pommes', 1, array('%count%' => 1), 'fr', ''), | ||
254 | array('Il y a 10 pommes', '{0} There is no apple|one: There is one apple|more: There is %count% apples', '{0} Il n\'y a aucune pomme|one: Il y a %count% pomme|more: Il y a %count% pommes', 10, array('%count%' => 10), 'fr', ''), | ||
255 | |||
256 | array('Il y a 0 pomme', new String('{0} There is no apples|{1} There is one apple|]1,Inf] There is %count% apples'), '[0,1] Il y a %count% pomme|]1,Inf] Il y a %count% pommes', 0, array('%count%' => 0), 'fr', ''), | ||
257 | ); | ||
258 | } | ||
259 | |||
260 | public function testTransChoiceFallback() | ||
261 | { | ||
262 | $translator = new Translator('ru', new MessageSelector()); | ||
263 | $translator->setFallbackLocales(array('en')); | ||
264 | $translator->addLoader('array', new ArrayLoader()); | ||
265 | $translator->addResource('array', array('some_message2' => 'one thing|%count% things'), 'en'); | ||
266 | |||
267 | $this->assertEquals('10 things', $translator->transChoice('some_message2', 10, array('%count%' => 10))); | ||
268 | } | ||
269 | |||
270 | public function testTransChoiceFallbackBis() | ||
271 | { | ||
272 | $translator = new Translator('ru', new MessageSelector()); | ||
273 | $translator->setFallbackLocales(array('en_US', 'en')); | ||
274 | $translator->addLoader('array', new ArrayLoader()); | ||
275 | $translator->addResource('array', array('some_message2' => 'one thing|%count% things'), 'en_US'); | ||
276 | |||
277 | $this->assertEquals('10 things', $translator->transChoice('some_message2', 10, array('%count%' => 10))); | ||
278 | } | ||
279 | |||
280 | /** | ||
281 | * @expectedException \InvalidArgumentException | ||
282 | */ | ||
283 | public function testTransChoiceFallbackWithNoTranslation() | ||
284 | { | ||
285 | $translator = new Translator('ru', new MessageSelector()); | ||
286 | $translator->setFallbackLocales(array('en')); | ||
287 | $translator->addLoader('array', new ArrayLoader()); | ||
288 | |||
289 | $this->assertEquals('10 things', $translator->transChoice('some_message2', 10, array('%count%' => 10))); | ||
290 | } | ||
291 | } | ||
292 | |||
293 | class String | ||
294 | { | ||
295 | protected $str; | ||
296 | |||
297 | public function __construct($str) | ||
298 | { | ||
299 | $this->str = $str; | ||
300 | } | ||
301 | |||
302 | public function __toString() | ||
303 | { | ||
304 | return $this->str; | ||
305 | } | ||
306 | } | ||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Tests/fixtures/empty-translation.po b/vendor/symfony/translation/Symfony/Component/Translation/Tests/fixtures/empty-translation.po deleted file mode 100644 index ff6f22af..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/Tests/fixtures/empty-translation.po +++ /dev/null | |||
@@ -1,3 +0,0 @@ | |||
1 | msgid "foo" | ||
2 | msgstr "" | ||
3 | |||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Tests/fixtures/empty.csv b/vendor/symfony/translation/Symfony/Component/Translation/Tests/fixtures/empty.csv deleted file mode 100644 index e69de29b..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/Tests/fixtures/empty.csv +++ /dev/null | |||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Tests/fixtures/empty.ini b/vendor/symfony/translation/Symfony/Component/Translation/Tests/fixtures/empty.ini deleted file mode 100644 index e69de29b..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/Tests/fixtures/empty.ini +++ /dev/null | |||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Tests/fixtures/empty.mo b/vendor/symfony/translation/Symfony/Component/Translation/Tests/fixtures/empty.mo deleted file mode 100644 index e69de29b..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/Tests/fixtures/empty.mo +++ /dev/null | |||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Tests/fixtures/empty.po b/vendor/symfony/translation/Symfony/Component/Translation/Tests/fixtures/empty.po deleted file mode 100644 index e69de29b..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/Tests/fixtures/empty.po +++ /dev/null | |||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Tests/fixtures/empty.yml b/vendor/symfony/translation/Symfony/Component/Translation/Tests/fixtures/empty.yml deleted file mode 100644 index e69de29b..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/Tests/fixtures/empty.yml +++ /dev/null | |||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Tests/fixtures/encoding.xlf b/vendor/symfony/translation/Symfony/Component/Translation/Tests/fixtures/encoding.xlf deleted file mode 100644 index 6be901bd..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/Tests/fixtures/encoding.xlf +++ /dev/null | |||
@@ -1,15 +0,0 @@ | |||
1 | <?xml version="1.0" encoding="ISO-8859-1"?> | ||
2 | <xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" version="1.2"> | ||
3 | <file source-language="en" datatype="plaintext" original="file.ext"> | ||
4 | <body> | ||
5 | <trans-unit id="1" resname="foo"> | ||
6 | <source>foo</source> | ||
7 | <target>bär</target> | ||
8 | </trans-unit> | ||
9 | <trans-unit id="2" resname="bar"> | ||
10 | <source>bar</source> | ||
11 | <target>föö</target> | ||
12 | </trans-unit> | ||
13 | </body> | ||
14 | </file> | ||
15 | </xliff> | ||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Tests/fixtures/invalid-xml-resources.xlf b/vendor/symfony/translation/Symfony/Component/Translation/Tests/fixtures/invalid-xml-resources.xlf deleted file mode 100644 index 7bf6c98b..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/Tests/fixtures/invalid-xml-resources.xlf +++ /dev/null | |||
@@ -1,23 +0,0 @@ | |||
1 | <?xml version="1.0" encoding="utf-8"?> | ||
2 | <xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" version="1.2"> | ||
3 | <file source-language="en" datatype="plaintext" original="file.ext"> | ||
4 | <body> | ||
5 | <trans-unit id="1"> | ||
6 | <source>foo</source> | ||
7 | <target>bar | ||
8 | </trans-unit> | ||
9 | <trans-unit id="2"> | ||
10 | <source>extra</source> | ||
11 | </trans-unit> | ||
12 | <trans-unit id="3"> | ||
13 | <source>key</source> | ||
14 | <target></target> | ||
15 | </trans-unit> | ||
16 | <trans-unit id="4"> | ||
17 | <source>test</source> | ||
18 | <target>with</target> | ||
19 | <note>note</note> | ||
20 | </trans-unit> | ||
21 | </body> | ||
22 | </file> | ||
23 | </xliff> | ||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Tests/fixtures/non-valid.xlf b/vendor/symfony/translation/Symfony/Component/Translation/Tests/fixtures/non-valid.xlf deleted file mode 100644 index 734fc97e..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/Tests/fixtures/non-valid.xlf +++ /dev/null | |||
@@ -1,11 +0,0 @@ | |||
1 | <?xml version="1.0"?> | ||
2 | <xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2"> | ||
3 | <file source-language="en" datatype="plaintext" original="file.ext"> | ||
4 | <body> | ||
5 | <trans-unit> | ||
6 | <source>foo</source> | ||
7 | <target>bar</target> | ||
8 | </trans-unit> | ||
9 | </body> | ||
10 | </file> | ||
11 | </xliff> | ||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Tests/fixtures/non-valid.yml b/vendor/symfony/translation/Symfony/Component/Translation/Tests/fixtures/non-valid.yml deleted file mode 100644 index 257cc564..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/Tests/fixtures/non-valid.yml +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | foo | ||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Tests/fixtures/plurals.mo b/vendor/symfony/translation/Symfony/Component/Translation/Tests/fixtures/plurals.mo deleted file mode 100644 index 6445e77b..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/Tests/fixtures/plurals.mo +++ /dev/null | |||
Binary files differ | |||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Tests/fixtures/plurals.po b/vendor/symfony/translation/Symfony/Component/Translation/Tests/fixtures/plurals.po deleted file mode 100644 index 439c41ad..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/Tests/fixtures/plurals.po +++ /dev/null | |||
@@ -1,5 +0,0 @@ | |||
1 | msgid "foo" | ||
2 | msgid_plural "foos" | ||
3 | msgstr[0] "bar" | ||
4 | msgstr[1] "bars" | ||
5 | |||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Tests/fixtures/resname.xlf b/vendor/symfony/translation/Symfony/Component/Translation/Tests/fixtures/resname.xlf deleted file mode 100644 index 2df16af9..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/Tests/fixtures/resname.xlf +++ /dev/null | |||
@@ -1,19 +0,0 @@ | |||
1 | <?xml version="1.0" encoding="utf-8"?> | ||
2 | <xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" version="1.2"> | ||
3 | <file source-language="en" datatype="plaintext" original="file.ext"> | ||
4 | <body> | ||
5 | <trans-unit id="1" resname="foo"> | ||
6 | <source></source> | ||
7 | <target>bar</target> | ||
8 | </trans-unit> | ||
9 | <trans-unit id="2" resname="bar"> | ||
10 | <source>bar source</source> | ||
11 | <target>baz</target> | ||
12 | </trans-unit> | ||
13 | <trans-unit id="3"> | ||
14 | <source>baz</source> | ||
15 | <target>foo</target> | ||
16 | </trans-unit> | ||
17 | </body> | ||
18 | </file> | ||
19 | </xliff> | ||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Tests/fixtures/resourcebundle/corrupted/resources.dat b/vendor/symfony/translation/Symfony/Component/Translation/Tests/fixtures/resourcebundle/corrupted/resources.dat deleted file mode 100644 index 391250ca..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/Tests/fixtures/resourcebundle/corrupted/resources.dat +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | XXX \ No newline at end of file | ||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Tests/fixtures/resourcebundle/dat/en.res b/vendor/symfony/translation/Symfony/Component/Translation/Tests/fixtures/resourcebundle/dat/en.res deleted file mode 100644 index 1fc1436d..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/Tests/fixtures/resourcebundle/dat/en.res +++ /dev/null | |||
Binary files differ | |||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Tests/fixtures/resourcebundle/dat/en.txt b/vendor/symfony/translation/Symfony/Component/Translation/Tests/fixtures/resourcebundle/dat/en.txt deleted file mode 100644 index c04a4e85..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/Tests/fixtures/resourcebundle/dat/en.txt +++ /dev/null | |||
@@ -1,3 +0,0 @@ | |||
1 | en{ | ||
2 | symfony{"Symfony 2 is great"} | ||
3 | } \ No newline at end of file | ||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Tests/fixtures/resourcebundle/dat/fr.res b/vendor/symfony/translation/Symfony/Component/Translation/Tests/fixtures/resourcebundle/dat/fr.res deleted file mode 100644 index f5841609..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/Tests/fixtures/resourcebundle/dat/fr.res +++ /dev/null | |||
Binary files differ | |||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Tests/fixtures/resourcebundle/dat/fr.txt b/vendor/symfony/translation/Symfony/Component/Translation/Tests/fixtures/resourcebundle/dat/fr.txt deleted file mode 100644 index 7e84f67a..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/Tests/fixtures/resourcebundle/dat/fr.txt +++ /dev/null | |||
@@ -1,3 +0,0 @@ | |||
1 | fr{ | ||
2 | symfony{"Symfony 2 est génial"} | ||
3 | } \ No newline at end of file | ||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Tests/fixtures/resourcebundle/dat/packagelist.txt b/vendor/symfony/translation/Symfony/Component/Translation/Tests/fixtures/resourcebundle/dat/packagelist.txt deleted file mode 100644 index c5783ed4..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/Tests/fixtures/resourcebundle/dat/packagelist.txt +++ /dev/null | |||
@@ -1,2 +0,0 @@ | |||
1 | en.res | ||
2 | fr.res | ||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Tests/fixtures/resourcebundle/dat/resources.dat b/vendor/symfony/translation/Symfony/Component/Translation/Tests/fixtures/resourcebundle/dat/resources.dat deleted file mode 100644 index 563b0eae..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/Tests/fixtures/resourcebundle/dat/resources.dat +++ /dev/null | |||
Binary files differ | |||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Tests/fixtures/resourcebundle/res/en.res b/vendor/symfony/translation/Symfony/Component/Translation/Tests/fixtures/resourcebundle/res/en.res deleted file mode 100644 index ad894a92..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/Tests/fixtures/resourcebundle/res/en.res +++ /dev/null | |||
Binary files differ | |||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Tests/fixtures/resources-clean.xlf b/vendor/symfony/translation/Symfony/Component/Translation/Tests/fixtures/resources-clean.xlf deleted file mode 100644 index 464b0792..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/Tests/fixtures/resources-clean.xlf +++ /dev/null | |||
@@ -1,15 +0,0 @@ | |||
1 | <?xml version="1.0" encoding="utf-8"?> | ||
2 | <xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" version="1.2"> | ||
3 | <file source-language="en" datatype="plaintext" original="file.ext"> | ||
4 | <body> | ||
5 | <trans-unit id="acbd18db4cc2f85cedef654fccc4a4d8" resname="foo"> | ||
6 | <source>foo</source> | ||
7 | <target>bar</target> | ||
8 | </trans-unit> | ||
9 | <trans-unit id="3c6e0b8a9c15224a8228b9a98ca1531d" resname="key"> | ||
10 | <source>key</source> | ||
11 | <target></target> | ||
12 | </trans-unit> | ||
13 | </body> | ||
14 | </file> | ||
15 | </xliff> | ||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Tests/fixtures/resources.csv b/vendor/symfony/translation/Symfony/Component/Translation/Tests/fixtures/resources.csv deleted file mode 100644 index 374b9eb5..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/Tests/fixtures/resources.csv +++ /dev/null | |||
@@ -1,4 +0,0 @@ | |||
1 | "foo"; "bar" | ||
2 | #"bar"; "foo" | ||
3 | "incorrect"; "number"; "columns"; "will"; "be"; "ignored" | ||
4 | "incorrect" \ No newline at end of file | ||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Tests/fixtures/resources.ini b/vendor/symfony/translation/Symfony/Component/Translation/Tests/fixtures/resources.ini deleted file mode 100644 index 4953062e..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/Tests/fixtures/resources.ini +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | foo="bar" | ||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Tests/fixtures/resources.mo b/vendor/symfony/translation/Symfony/Component/Translation/Tests/fixtures/resources.mo deleted file mode 100644 index 0a966025..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/Tests/fixtures/resources.mo +++ /dev/null | |||
Binary files differ | |||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Tests/fixtures/resources.php b/vendor/symfony/translation/Symfony/Component/Translation/Tests/fixtures/resources.php deleted file mode 100644 index c2913985..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/Tests/fixtures/resources.php +++ /dev/null | |||
@@ -1,5 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | return array ( | ||
4 | 'foo' => 'bar', | ||
5 | ); | ||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Tests/fixtures/resources.po b/vendor/symfony/translation/Symfony/Component/Translation/Tests/fixtures/resources.po deleted file mode 100644 index da0d5f46..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/Tests/fixtures/resources.po +++ /dev/null | |||
@@ -1,2 +0,0 @@ | |||
1 | msgid "foo" | ||
2 | msgstr "bar" \ No newline at end of file | ||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Tests/fixtures/resources.ts b/vendor/symfony/translation/Symfony/Component/Translation/Tests/fixtures/resources.ts deleted file mode 100644 index 40e18522..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/Tests/fixtures/resources.ts +++ /dev/null | |||
@@ -1,10 +0,0 @@ | |||
1 | <?xml version="1.0" encoding="utf-8"?> | ||
2 | <TS> | ||
3 | <context> | ||
4 | <name>resources</name> | ||
5 | <message> | ||
6 | <source>foo</source> | ||
7 | <translation>bar</translation> | ||
8 | </message> | ||
9 | </context> | ||
10 | </TS> | ||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Tests/fixtures/resources.xlf b/vendor/symfony/translation/Symfony/Component/Translation/Tests/fixtures/resources.xlf deleted file mode 100644 index b0e59880..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/Tests/fixtures/resources.xlf +++ /dev/null | |||
@@ -1,23 +0,0 @@ | |||
1 | <?xml version="1.0" encoding="utf-8"?> | ||
2 | <xliff xmlns="urn:oasis:names:tc:xliff:document:1.2" version="1.2"> | ||
3 | <file source-language="en" datatype="plaintext" original="file.ext"> | ||
4 | <body> | ||
5 | <trans-unit id="1"> | ||
6 | <source>foo</source> | ||
7 | <target>bar</target> | ||
8 | </trans-unit> | ||
9 | <trans-unit id="2"> | ||
10 | <source>extra</source> | ||
11 | </trans-unit> | ||
12 | <trans-unit id="3"> | ||
13 | <source>key</source> | ||
14 | <target></target> | ||
15 | </trans-unit> | ||
16 | <trans-unit id="4"> | ||
17 | <source>test</source> | ||
18 | <target>with</target> | ||
19 | <note>note</note> | ||
20 | </trans-unit> | ||
21 | </body> | ||
22 | </file> | ||
23 | </xliff> | ||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Tests/fixtures/resources.yml b/vendor/symfony/translation/Symfony/Component/Translation/Tests/fixtures/resources.yml deleted file mode 100644 index 20e9ff3f..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/Tests/fixtures/resources.yml +++ /dev/null | |||
@@ -1 +0,0 @@ | |||
1 | foo: bar | ||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Tests/fixtures/valid.csv b/vendor/symfony/translation/Symfony/Component/Translation/Tests/fixtures/valid.csv deleted file mode 100644 index 59882e5d..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/Tests/fixtures/valid.csv +++ /dev/null | |||
@@ -1,4 +0,0 @@ | |||
1 | foo;bar | ||
2 | bar;"foo | ||
3 | foo" | ||
4 | "foo;foo";bar | ||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Tests/fixtures/withdoctype.xlf b/vendor/symfony/translation/Symfony/Component/Translation/Tests/fixtures/withdoctype.xlf deleted file mode 100644 index f83e834d..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/Tests/fixtures/withdoctype.xlf +++ /dev/null | |||
@@ -1,12 +0,0 @@ | |||
1 | <?xml version="1.0"?> | ||
2 | <!DOCTYPE foo> | ||
3 | <xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2"> | ||
4 | <file source-language="en" datatype="plaintext" original="file.ext"> | ||
5 | <body> | ||
6 | <trans-unit id="1"> | ||
7 | <source>foo</source> | ||
8 | <target>bar</target> | ||
9 | </trans-unit> | ||
10 | </body> | ||
11 | </file> | ||
12 | </xliff> | ||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Translator.php b/vendor/symfony/translation/Symfony/Component/Translation/Translator.php deleted file mode 100644 index 8e74b79f..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/Translator.php +++ /dev/null | |||
@@ -1,282 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of the Symfony package. | ||
5 | * | ||
6 | * (c) Fabien Potencier <fabien@symfony.com> | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | namespace Symfony\Component\Translation; | ||
13 | |||
14 | use Symfony\Component\Translation\Loader\LoaderInterface; | ||
15 | use Symfony\Component\Translation\Exception\NotFoundResourceException; | ||
16 | |||
17 | /** | ||
18 | * Translator. | ||
19 | * | ||
20 | * @author Fabien Potencier <fabien@symfony.com> | ||
21 | * | ||
22 | * @api | ||
23 | */ | ||
24 | class Translator implements TranslatorInterface | ||
25 | { | ||
26 | /** | ||
27 | * @var MessageCatalogueInterface[] | ||
28 | */ | ||
29 | protected $catalogues = array(); | ||
30 | |||
31 | /** | ||
32 | * @var string | ||
33 | */ | ||
34 | protected $locale; | ||
35 | |||
36 | /** | ||
37 | * @var array | ||
38 | */ | ||
39 | private $fallbackLocales = array(); | ||
40 | |||
41 | /** | ||
42 | * @var LoaderInterface[] | ||
43 | */ | ||
44 | private $loaders = array(); | ||
45 | |||
46 | /** | ||
47 | * @var array | ||
48 | */ | ||
49 | private $resources = array(); | ||
50 | |||
51 | /** | ||
52 | * @var MessageSelector | ||
53 | */ | ||
54 | private $selector; | ||
55 | |||
56 | /** | ||
57 | * Constructor. | ||
58 | * | ||
59 | * @param string $locale The locale | ||
60 | * @param MessageSelector|null $selector The message selector for pluralization | ||
61 | * | ||
62 | * @api | ||
63 | */ | ||
64 | public function __construct($locale, MessageSelector $selector = null) | ||
65 | { | ||
66 | $this->locale = $locale; | ||
67 | $this->selector = $selector ?: new MessageSelector(); | ||
68 | } | ||
69 | |||
70 | /** | ||
71 | * Adds a Loader. | ||
72 | * | ||
73 | * @param string $format The name of the loader (@see addResource()) | ||
74 | * @param LoaderInterface $loader A LoaderInterface instance | ||
75 | * | ||
76 | * @api | ||
77 | */ | ||
78 | public function addLoader($format, LoaderInterface $loader) | ||
79 | { | ||
80 | $this->loaders[$format] = $loader; | ||
81 | } | ||
82 | |||
83 | /** | ||
84 | * Adds a Resource. | ||
85 | * | ||
86 | * @param string $format The name of the loader (@see addLoader()) | ||
87 | * @param mixed $resource The resource name | ||
88 | * @param string $locale The locale | ||
89 | * @param string $domain The domain | ||
90 | * | ||
91 | * @api | ||
92 | */ | ||
93 | public function addResource($format, $resource, $locale, $domain = null) | ||
94 | { | ||
95 | if (null === $domain) { | ||
96 | $domain = 'messages'; | ||
97 | } | ||
98 | |||
99 | $this->resources[$locale][] = array($format, $resource, $domain); | ||
100 | |||
101 | if (in_array($locale, $this->fallbackLocales)) { | ||
102 | $this->catalogues = array(); | ||
103 | } else { | ||
104 | unset($this->catalogues[$locale]); | ||
105 | } | ||
106 | } | ||
107 | |||
108 | /** | ||
109 | * {@inheritdoc} | ||
110 | * | ||
111 | * @api | ||
112 | */ | ||
113 | public function setLocale($locale) | ||
114 | { | ||
115 | $this->locale = $locale; | ||
116 | } | ||
117 | |||
118 | /** | ||
119 | * {@inheritdoc} | ||
120 | * | ||
121 | * @api | ||
122 | */ | ||
123 | public function getLocale() | ||
124 | { | ||
125 | return $this->locale; | ||
126 | } | ||
127 | |||
128 | /** | ||
129 | * Sets the fallback locale(s). | ||
130 | * | ||
131 | * @param string|array $locales The fallback locale(s) | ||
132 | * | ||
133 | * @deprecated since 2.3, to be removed in 3.0. Use setFallbackLocales() instead. | ||
134 | * | ||
135 | * @api | ||
136 | */ | ||
137 | public function setFallbackLocale($locales) | ||
138 | { | ||
139 | $this->setFallbackLocales(is_array($locales) ? $locales : array($locales)); | ||
140 | } | ||
141 | |||
142 | /** | ||
143 | * Sets the fallback locales. | ||
144 | * | ||
145 | * @param array $locales The fallback locales | ||
146 | * | ||
147 | * @api | ||
148 | */ | ||
149 | public function setFallbackLocales(array $locales) | ||
150 | { | ||
151 | // needed as the fallback locales are linked to the already loaded catalogues | ||
152 | $this->catalogues = array(); | ||
153 | |||
154 | $this->fallbackLocales = $locales; | ||
155 | } | ||
156 | |||
157 | /** | ||
158 | * Gets the fallback locales. | ||
159 | * | ||
160 | * @return array $locales The fallback locales | ||
161 | * | ||
162 | * @api | ||
163 | */ | ||
164 | public function getFallbackLocales() | ||
165 | { | ||
166 | return $this->fallbackLocales; | ||
167 | } | ||
168 | |||
169 | /** | ||
170 | * {@inheritdoc} | ||
171 | * | ||
172 | * @api | ||
173 | */ | ||
174 | public function trans($id, array $parameters = array(), $domain = null, $locale = null) | ||
175 | { | ||
176 | if (null === $locale) { | ||
177 | $locale = $this->getLocale(); | ||
178 | } | ||
179 | |||
180 | if (null === $domain) { | ||
181 | $domain = 'messages'; | ||
182 | } | ||
183 | |||
184 | if (!isset($this->catalogues[$locale])) { | ||
185 | $this->loadCatalogue($locale); | ||
186 | } | ||
187 | |||
188 | return strtr($this->catalogues[$locale]->get((string) $id, $domain), $parameters); | ||
189 | } | ||
190 | |||
191 | /** | ||
192 | * {@inheritdoc} | ||
193 | * | ||
194 | * @api | ||
195 | */ | ||
196 | public function transChoice($id, $number, array $parameters = array(), $domain = null, $locale = null) | ||
197 | { | ||
198 | if (null === $locale) { | ||
199 | $locale = $this->getLocale(); | ||
200 | } | ||
201 | |||
202 | if (null === $domain) { | ||
203 | $domain = 'messages'; | ||
204 | } | ||
205 | |||
206 | if (!isset($this->catalogues[$locale])) { | ||
207 | $this->loadCatalogue($locale); | ||
208 | } | ||
209 | |||
210 | $id = (string) $id; | ||
211 | |||
212 | $catalogue = $this->catalogues[$locale]; | ||
213 | while (!$catalogue->defines($id, $domain)) { | ||
214 | if ($cat = $catalogue->getFallbackCatalogue()) { | ||
215 | $catalogue = $cat; | ||
216 | $locale = $catalogue->getLocale(); | ||
217 | } else { | ||
218 | break; | ||
219 | } | ||
220 | } | ||
221 | |||
222 | return strtr($this->selector->choose($catalogue->get($id, $domain), (int) $number, $locale), $parameters); | ||
223 | } | ||
224 | |||
225 | protected function loadCatalogue($locale) | ||
226 | { | ||
227 | try { | ||
228 | $this->doLoadCatalogue($locale); | ||
229 | } catch (NotFoundResourceException $e) { | ||
230 | if (!$this->computeFallbackLocales($locale)) { | ||
231 | throw $e; | ||
232 | } | ||
233 | } | ||
234 | $this->loadFallbackCatalogues($locale); | ||
235 | } | ||
236 | |||
237 | private function doLoadCatalogue($locale) | ||
238 | { | ||
239 | $this->catalogues[$locale] = new MessageCatalogue($locale); | ||
240 | |||
241 | if (isset($this->resources[$locale])) { | ||
242 | foreach ($this->resources[$locale] as $resource) { | ||
243 | if (!isset($this->loaders[$resource[0]])) { | ||
244 | throw new \RuntimeException(sprintf('The "%s" translation loader is not registered.', $resource[0])); | ||
245 | } | ||
246 | $this->catalogues[$locale]->addCatalogue($this->loaders[$resource[0]]->load($resource[1], $locale, $resource[2])); | ||
247 | } | ||
248 | } | ||
249 | } | ||
250 | |||
251 | private function loadFallbackCatalogues($locale) | ||
252 | { | ||
253 | $current = $this->catalogues[$locale]; | ||
254 | |||
255 | foreach ($this->computeFallbackLocales($locale) as $fallback) { | ||
256 | if (!isset($this->catalogues[$fallback])) { | ||
257 | $this->doLoadCatalogue($fallback); | ||
258 | } | ||
259 | |||
260 | $current->addFallbackCatalogue($this->catalogues[$fallback]); | ||
261 | $current = $this->catalogues[$fallback]; | ||
262 | } | ||
263 | } | ||
264 | |||
265 | protected function computeFallbackLocales($locale) | ||
266 | { | ||
267 | $locales = array(); | ||
268 | foreach ($this->fallbackLocales as $fallback) { | ||
269 | if ($fallback === $locale) { | ||
270 | continue; | ||
271 | } | ||
272 | |||
273 | $locales[] = $fallback; | ||
274 | } | ||
275 | |||
276 | if (strrchr($locale, '_') !== false) { | ||
277 | array_unshift($locales, substr($locale, 0, -strlen(strrchr($locale, '_')))); | ||
278 | } | ||
279 | |||
280 | return array_unique($locales); | ||
281 | } | ||
282 | } | ||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/TranslatorInterface.php b/vendor/symfony/translation/Symfony/Component/Translation/TranslatorInterface.php deleted file mode 100644 index 3dcdd4fc..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/TranslatorInterface.php +++ /dev/null | |||
@@ -1,69 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of the Symfony package. | ||
5 | * | ||
6 | * (c) Fabien Potencier <fabien@symfony.com> | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | namespace Symfony\Component\Translation; | ||
13 | |||
14 | /** | ||
15 | * TranslatorInterface. | ||
16 | * | ||
17 | * @author Fabien Potencier <fabien@symfony.com> | ||
18 | * | ||
19 | * @api | ||
20 | */ | ||
21 | interface TranslatorInterface | ||
22 | { | ||
23 | /** | ||
24 | * Translates the given message. | ||
25 | * | ||
26 | * @param string $id The message id (may also be an object that can be cast to string) | ||
27 | * @param array $parameters An array of parameters for the message | ||
28 | * @param string $domain The domain for the message | ||
29 | * @param string $locale The locale | ||
30 | * | ||
31 | * @return string The translated string | ||
32 | * | ||
33 | * @api | ||
34 | */ | ||
35 | public function trans($id, array $parameters = array(), $domain = null, $locale = null); | ||
36 | |||
37 | /** | ||
38 | * Translates the given choice message by choosing a translation according to a number. | ||
39 | * | ||
40 | * @param string $id The message id (may also be an object that can be cast to string) | ||
41 | * @param integer $number The number to use to find the indice of the message | ||
42 | * @param array $parameters An array of parameters for the message | ||
43 | * @param string $domain The domain for the message | ||
44 | * @param string $locale The locale | ||
45 | * | ||
46 | * @return string The translated string | ||
47 | * | ||
48 | * @api | ||
49 | */ | ||
50 | public function transChoice($id, $number, array $parameters = array(), $domain = null, $locale = null); | ||
51 | |||
52 | /** | ||
53 | * Sets the current locale. | ||
54 | * | ||
55 | * @param string $locale The locale | ||
56 | * | ||
57 | * @api | ||
58 | */ | ||
59 | public function setLocale($locale); | ||
60 | |||
61 | /** | ||
62 | * Returns the current locale. | ||
63 | * | ||
64 | * @return string The locale | ||
65 | * | ||
66 | * @api | ||
67 | */ | ||
68 | public function getLocale(); | ||
69 | } | ||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/Writer/TranslationWriter.php b/vendor/symfony/translation/Symfony/Component/Translation/Writer/TranslationWriter.php deleted file mode 100644 index 9d70c12f..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/Writer/TranslationWriter.php +++ /dev/null | |||
@@ -1,73 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | /* | ||
4 | * This file is part of the Symfony package. | ||
5 | * | ||
6 | * (c) Fabien Potencier <fabien@symfony.com> | ||
7 | * | ||
8 | * For the full copyright and license information, please view the LICENSE | ||
9 | * file that was distributed with this source code. | ||
10 | */ | ||
11 | |||
12 | namespace Symfony\Component\Translation\Writer; | ||
13 | |||
14 | use Symfony\Component\Translation\MessageCatalogue; | ||
15 | use Symfony\Component\Translation\Dumper\DumperInterface; | ||
16 | |||
17 | /** | ||
18 | * TranslationWriter writes translation messages. | ||
19 | * | ||
20 | * @author Michel Salib <michelsalib@hotmail.com> | ||
21 | */ | ||
22 | class TranslationWriter | ||
23 | { | ||
24 | /** | ||
25 | * Dumpers used for export. | ||
26 | * | ||
27 | * @var array | ||
28 | */ | ||
29 | private $dumpers = array(); | ||
30 | |||
31 | /** | ||
32 | * Adds a dumper to the writer. | ||
33 | * | ||
34 | * @param string $format The format of the dumper | ||
35 | * @param DumperInterface $dumper The dumper | ||
36 | */ | ||
37 | public function addDumper($format, DumperInterface $dumper) | ||
38 | { | ||
39 | $this->dumpers[$format] = $dumper; | ||
40 | } | ||
41 | |||
42 | /** | ||
43 | * Obtains the list of supported formats. | ||
44 | * | ||
45 | * @return array | ||
46 | */ | ||
47 | public function getFormats() | ||
48 | { | ||
49 | return array_keys($this->dumpers); | ||
50 | } | ||
51 | |||
52 | /** | ||
53 | * Writes translation from the catalogue according to the selected format. | ||
54 | * | ||
55 | * @param MessageCatalogue $catalogue The message catalogue to dump | ||
56 | * @param string $format The format to use to dump the messages | ||
57 | * @param array $options Options that are passed to the dumper | ||
58 | * | ||
59 | * @throws \InvalidArgumentException | ||
60 | */ | ||
61 | public function writeTranslations(MessageCatalogue $catalogue, $format, $options = array()) | ||
62 | { | ||
63 | if (!isset($this->dumpers[$format])) { | ||
64 | throw new \InvalidArgumentException(sprintf('There is no dumper associated with format "%s".', $format)); | ||
65 | } | ||
66 | |||
67 | // get the right dumper | ||
68 | $dumper = $this->dumpers[$format]; | ||
69 | |||
70 | // save | ||
71 | $dumper->dump($catalogue, $options); | ||
72 | } | ||
73 | } | ||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/composer.json b/vendor/symfony/translation/Symfony/Component/Translation/composer.json deleted file mode 100644 index 96a8e662..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/composer.json +++ /dev/null | |||
@@ -1,39 +0,0 @@ | |||
1 | { | ||
2 | "name": "symfony/translation", | ||
3 | "type": "library", | ||
4 | "description": "Symfony Translation Component", | ||
5 | "keywords": [], | ||
6 | "homepage": "http://symfony.com", | ||
7 | "license": "MIT", | ||
8 | "authors": [ | ||
9 | { | ||
10 | "name": "Fabien Potencier", | ||
11 | "email": "fabien@symfony.com" | ||
12 | }, | ||
13 | { | ||
14 | "name": "Symfony Community", | ||
15 | "homepage": "http://symfony.com/contributors" | ||
16 | } | ||
17 | ], | ||
18 | "require": { | ||
19 | "php": ">=5.3.3" | ||
20 | }, | ||
21 | "require-dev": { | ||
22 | "symfony/config": "~2.0", | ||
23 | "symfony/yaml": "~2.2" | ||
24 | }, | ||
25 | "suggest": { | ||
26 | "symfony/config": "", | ||
27 | "symfony/yaml": "" | ||
28 | }, | ||
29 | "autoload": { | ||
30 | "psr-0": { "Symfony\\Component\\Translation\\": "" } | ||
31 | }, | ||
32 | "target-dir": "Symfony/Component/Translation", | ||
33 | "minimum-stability": "dev", | ||
34 | "extra": { | ||
35 | "branch-alias": { | ||
36 | "dev-master": "2.3-dev" | ||
37 | } | ||
38 | } | ||
39 | } | ||
diff --git a/vendor/symfony/translation/Symfony/Component/Translation/phpunit.xml.dist b/vendor/symfony/translation/Symfony/Component/Translation/phpunit.xml.dist deleted file mode 100644 index 1b37f214..00000000 --- a/vendor/symfony/translation/Symfony/Component/Translation/phpunit.xml.dist +++ /dev/null | |||
@@ -1,29 +0,0 @@ | |||
1 | <?xml version="1.0" encoding="UTF-8"?> | ||
2 | |||
3 | <phpunit backupGlobals="false" | ||
4 | backupStaticAttributes="false" | ||
5 | colors="true" | ||
6 | convertErrorsToExceptions="true" | ||
7 | convertNoticesToExceptions="true" | ||
8 | convertWarningsToExceptions="true" | ||
9 | processIsolation="false" | ||
10 | stopOnFailure="false" | ||
11 | syntaxCheck="false" | ||
12 | bootstrap="vendor/autoload.php" | ||
13 | > | ||
14 | <testsuites> | ||
15 | <testsuite name="Symfony Translation Component Test Suite"> | ||
16 | <directory>./Tests/</directory> | ||
17 | </testsuite> | ||
18 | </testsuites> | ||
19 | |||
20 | <filter> | ||
21 | <whitelist> | ||
22 | <directory>./</directory> | ||
23 | <exclude> | ||
24 | <directory>./vendor</directory> | ||
25 | <directory>./Tests</directory> | ||
26 | </exclude> | ||
27 | </whitelist> | ||
28 | </filter> | ||
29 | </phpunit> | ||