1
1
Usage
2
- -----
2
+ =====
3
3
4
4
Imagine you want to translate the string *"Symfony2 is great" * into french::
5
5
@@ -20,7 +20,7 @@ the locale set in the constructor (``fr_FR``) if the message exists in one of
20
20
the message catalogues.
21
21
22
22
Message Placeholders
23
- ~~~~~~~~~~~~~~~~~~~~
23
+ --------------------
24
24
25
25
Sometimes, a message containing a variable needs to be translated::
26
26
@@ -90,7 +90,7 @@ The second step is done by creating message catalogues that define the translati
90
90
for any number of different locales.
91
91
92
92
Creating Translations
93
- ---------------------
93
+ =====================
94
94
95
95
The act of creating translation files is an important part of "localization"
96
96
(often abbreviated `L10n `_). Translation files consist of a series of
@@ -216,7 +216,7 @@ recommended format. These files are parsed by one of the loader classes.
216
216
);
217
217
218
218
Pluralization
219
- ~~~~~~~~~~~~~
219
+ -------------
220
220
221
221
Message pluralization is a tough topic as the rules can be quite complex. For
222
222
instance, here is the mathematic representation of the Russian pluralization
@@ -294,7 +294,7 @@ same in the original message as in the translated one.
294
294
only get a string based on its position in the string).
295
295
296
296
Explicit Interval Pluralization
297
- ...............................
297
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
298
298
299
299
The easiest way to pluralize a message is to let the Translator use internal
300
300
logic to choose which string to use based on a given number. Sometimes, you'll
@@ -342,7 +342,7 @@ delimiter can be ``[`` (exclusive) or ``]`` (inclusive). Beside numbers, you
342
342
.. _using-message-domains :
343
343
344
344
Using Message Domains
345
- ---------------------
345
+ =====================
346
346
347
347
As you've seen, message files are organized into the different locales that
348
348
they translate. The message files can also be organized further into "domains".
@@ -369,7 +369,7 @@ specified locale.
369
369
can use ``-Inf `` and ``+Inf `` for the infinite.
370
370
371
371
Forcing the Translator Locale
372
- -----------------------------
372
+ =============================
373
373
374
374
When translating a message, the Translator uses the specified locale or the
375
375
``fallback `` locale if necessary. You can also manually specify the locale to
0 commit comments