@@ -85,7 +85,7 @@ will save a few lines::
85
85
86
86
class MyFormatDumper extends FileDumper
87
87
{
88
- protected function format (MessageCatalogue $messages, $domain = 'messages' )
88
+ public function formatCatalogue (MessageCatalogue $messages, $domain, array $options = array() )
89
89
{
90
90
$output = '';
91
91
@@ -102,7 +102,20 @@ will save a few lines::
102
102
}
103
103
}
104
104
105
- The :method: `Symfony\\ Component\\ Translation\\ Dumper\\ FileDumper::format `
105
+ .. sidebar :: Format a message catalogue
106
+
107
+ .. versionadded :: 2.8
108
+ The ability to format a message catalogue without dumping it was introduced in Symfony 2.8.
109
+
110
+ In some cases, you want to send the the dump contents as a response instead of writing in files.
111
+ To do this, you can use the ``formatCatalogue `` method. In this case, you must pass the domain argument,
112
+ which determines the list of messages that should be dumped.
113
+
114
+ .. tip ::
115
+
116
+ To format a message catalogue without dumping it into files use the ``formatCatalogue `` method.
117
+
118
+ The :method: `Symfony\\ Component\\ Translation\\ Dumper\\ FileDumper::formatCatalogue `
106
119
method creates the output string, that will be used by the
107
120
:method: `Symfony\\ Component\\ Translation\\ Dumper\\ FileDumper::dump ` method
108
121
of the FileDumper class to create the file. The dumper can be used like any other
@@ -116,4 +129,3 @@ YAML file are dumped into a text file with the custom format::
116
129
117
130
$dumper = new MyFormatDumper();
118
131
$dumper->dump($catalogue, array('path' => __DIR__.'/dumps'));
119
-
0 commit comments