@@ -10,7 +10,7 @@ loader (to load translations) and, optionally, a dumper (to dump translations).
10
10
11
11
Let's imagine you have a custom format where translation messages are defined
12
12
using one line for each translation and parenthesis to wrap the key and the
13
- message. A translation file would look like this:
13
+ message. A translation file would look like this::
14
14
15
15
(welcome)(Bienvenido)
16
16
(goodbye)(Adios)
@@ -22,14 +22,13 @@ new class that implements the
22
22
which defines a
23
23
:method: `Symfony\\ Component\\ Translation\\ Loader\\ LoaderInterface::load `
24
24
method. In the loader, this method will get a filename and parse it to create an
25
- array. Then, it will create the catalog that will be returned.
25
+ array. Then, it will create the catalog that will be returned::
26
26
27
27
use Symfony\Component\Translation\MessageCatalogue;
28
28
use Symfony\Component\Translation\Loader\LoaderInterface;
29
29
30
30
class MyFormatLoader implements LoaderInterface
31
31
{
32
-
33
32
public function load($resource, $locale, $domain = 'messages')
34
33
{
35
34
$messages = array();
@@ -62,12 +61,11 @@ It will print *"Bienvenido"*.
62
61
63
62
It is also possible to create a custom dumper for your format. To do so,
64
63
a new class implementing the
65
- DumperInterface
66
64
:class: `Symfony\\ Component\\ Translation\\ Dumper\\ DumperInterface `
67
65
interface must be created.
68
66
To write the dump contents into a file, extending the
69
67
:class: `Symfony\\ Component\\ Translation\\ Dumper\\ FileDumper ` class
70
- will save a few lines.
68
+ will save a few lines::
71
69
72
70
use Symfony\Component\Translation\MessageCatalogue;
73
71
use Symfony\Component\Translation\Dumper\FileDumper;
0 commit comments