You are here

public function IniFileDumper::format in Plug 7

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

Parameters

MessageCatalogue $messages:

string $domain:

Return value

string representation

Overrides FileDumper::format

File

lib/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;
}