CsvFileDumper.php
2 months ago
DumperInterface.php
2 months ago
FileDumper.php
2 months ago
IcuResFileDumper.php
2 months ago
IniFileDumper.php
2 months ago
JsonFileDumper.php
2 months ago
MoFileDumper.php
2 months ago
PhpFileDumper.php
2 months ago
PoFileDumper.php
2 months ago
QtFileDumper.php
2 months ago
XliffFileDumper.php
2 months ago
YamlFileDumper.php
2 months ago
IniFileDumper.php
41 lines
| 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 | namespace ProfilePressVendor\Symfony\Component\Translation\Dumper; |
| 12 | |
| 13 | use ProfilePressVendor\Symfony\Component\Translation\MessageCatalogue; |
| 14 | /** |
| 15 | * IniFileDumper generates an ini formatted string representation of a message catalogue. |
| 16 | * |
| 17 | * @author Stealth35 |
| 18 | */ |
| 19 | class IniFileDumper extends FileDumper |
| 20 | { |
| 21 | /** |
| 22 | * {@inheritdoc} |
| 23 | */ |
| 24 | public function formatCatalogue(MessageCatalogue $messages, string $domain, array $options = []) |
| 25 | { |
| 26 | $output = ''; |
| 27 | foreach ($messages->all($domain) as $source => $target) { |
| 28 | $escapeTarget = str_replace('"', '\"', $target); |
| 29 | $output .= $source . '="' . $escapeTarget . "\"\n"; |
| 30 | } |
| 31 | return $output; |
| 32 | } |
| 33 | /** |
| 34 | * {@inheritdoc} |
| 35 | */ |
| 36 | protected function getExtension() |
| 37 | { |
| 38 | return 'ini'; |
| 39 | } |
| 40 | } |
| 41 |