File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -168,6 +168,22 @@ use for translation::
168
168
169
169
.. _retrieving-the-message-catalogue :
170
170
171
+ Pluralized Translations
172
+ -----------------------
173
+
174
+ Translations can be pluralized using `interval notations `_, the count can be
175
+ provided using the `%count% ` option::
176
+
177
+ $translator->trans(
178
+ '{0} There are no apples|{1} There is one apple|]1,Inf[ There are %count% apples',
179
+ ['%count%' => 10],
180
+ 'messages',
181
+ 'fr_FR'
182
+ );
183
+
184
+ The Translator also supports pluralization using the ICU MessageFormat, read
185
+ :doc: `/translation/message_format ` for more information about using it.
186
+
171
187
Retrieving the Message Catalog
172
188
------------------------------
173
189
@@ -248,3 +264,5 @@ code needed to generate the previous XLIFF file::
248
264
]);
249
265
250
266
.. _`L10n` : https://en.wikipedia.org/wiki/Internationalization_and_localization
267
+
268
+ .. _`interval notations` : https://en.wikipedia.org/wiki/Interval_(mathematics)
You can’t perform that action at this time.
0 commit comments