File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -187,6 +187,8 @@ you to use literal text in the select statements:
187
187
It's possible to translate ICU MessageFormat messages directly in code,
188
188
without having to define them in any file::
189
189
190
+ use Symfony\Component\Translation\MessageCatalogueInterface;
191
+
190
192
$invitation = '{organizer_gender, select,
191
193
female {{organizer_name} has invited you to her party!}
192
194
male {{organizer_name} has invited you to his party!}
@@ -195,10 +197,15 @@ you to use literal text in the select statements:
195
197
}';
196
198
197
199
// prints "Ryan has invited you to his party!"
198
- echo $translator->trans($invitation, [
199
- 'organizer_name' => 'Ryan',
200
- 'organizer_gender' => 'male',
201
- ]);
200
+ echo $translator->trans(
201
+ $invitation,
202
+ [
203
+ 'organizer_name' => 'Ryan',
204
+ 'organizer_gender' => 'male',
205
+ ],
206
+ // Appends the required suffix "+intl-icu" to the domain
207
+ 'messages'.MessageCatalogueInterface::INTL_DOMAIN_SUFFIX
208
+ );
202
209
203
210
.. _component-translation-pluralization :
204
211
You can’t perform that action at this time.
0 commit comments