Skip to content

Commit a490d10

Browse files
someonewithpcjaviereguiluz
authored andcommitted
Add documentation for pull #37371
1 parent 61b3221 commit a490d10

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

translation/message_format.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff 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``

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy