File tree 1 file changed +15
-0
lines changed
1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -165,6 +165,21 @@ you to use literal text in the select statements:
165
165
#. Inside this block, ``{organizer_name} `` starts "code" mode again, allowing
166
166
``organizer_name `` to be processed as variable.
167
167
168
+ Additionally, it's possible to write the message directly in code::
169
+
170
+ $invitation = '{organizer_gender, select,
171
+ female {{organizer_name} has invited you for her party!}
172
+ male {{organizer_name} has invited you for his party!}
173
+ other {{organizer_name} have invited you for their party!}
174
+ }';
175
+ // prints "Ryan has invited you for his party!"
176
+ echo $translator->trans($invitation, [
177
+ 'organizer_name' => 'Ryan',
178
+ 'organizer_gender' => 'male',
179
+ ]);
180
+
181
+ This can be used to create a wrapper.
182
+
168
183
.. tip ::
169
184
170
185
While it might seem more logical to only put ``her ``, ``his `` or ``their ``
You can’t perform that action at this time.
0 commit comments