Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitfcb1ab3

Browse files
committed
[Translation] Ability to format a message catalogue without actually writing it.
1 parent25fe737 commitfcb1ab3

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

‎components/translation/custom_formats.rst

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ will save a few lines::
8585

8686
class MyFormatDumper extends FileDumper
8787
{
88-
protected functionformat(MessageCatalogue $messages, $domain = 'messages')
88+
public functionformatCatalogue(MessageCatalogue $messages, $domain, array $options = array())
8989
{
9090
$output = '';
9191

@@ -102,7 +102,7 @@ will save a few lines::
102102
}
103103
}
104104

105-
The :method:`Symfony\\Component\\Translation\\Dumper\\FileDumper::format`
105+
The :method:`Symfony\\Component\\Translation\\Dumper\\FileDumper::formatCatalogue`
106106
method creates the output string, that will be used by the
107107
:method:`Symfony\\Component\\Translation\\Dumper\\FileDumper::dump` method
108108
of the FileDumper class to create the file. The dumper can be used like any other
@@ -117,3 +117,7 @@ YAML file are dumped into a text file with the custom format::
117117
$dumper = new MyFormatDumper();
118118
$dumper->dump($catalogue, array('path' => __DIR__.'/dumps'));
119119

120+
.. note::
121+
122+
You can format a message catalogue without dumping it into files by using
123+
the `formatCatalogue` method.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp