You are here

public function IniFileDumper::format in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/translation/Dumper/IniFileDumper.php \Symfony\Component\Translation\Dumper\IniFileDumper::format()

Transforms a domain of a message catalogue to its string representation.

Parameters

MessageCatalogue $messages:

string $domain:

Return value

string representation

Overrides FileDumper::format

File

vendor/symfony/translation/Dumper/IniFileDumper.php, line 26

Class

IniFileDumper
IniFileDumper generates an ini formatted string representation of a message catalogue.

Namespace

Symfony\Component\Translation\Dumper

Code

public function format(MessageCatalogue $messages, $domain = 'messages') {
  $output = '';
  foreach ($messages
    ->all($domain) as $source => $target) {
    $escapeTarget = str_replace('"', '\\"', $target);
    $output .= $source . '="' . $escapeTarget . "\"\n";
  }
  return $output;
}