File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 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:
165165#. Inside this block, ``{organizer_name} `` starts "code" mode again, allowing
166166 ``organizer_name `` to be processed as variable.
167167
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+
168183.. tip ::
169184
170185 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