@@ -102,7 +102,8 @@ typical usage of this is gender:
102
102
{organizer_gender, select,
103
103
female {{organizer_name} has invited you to her party!}
104
104
male {{organizer_name} has invited you to his party!}
105
- other {{organizer_name} have invited you to their party!}
105
+ multi {{organizer_name} have invited you to their party!}
106
+ other {{organizer_name} has invited you to their party!}
106
107
}
107
108
108
109
.. code-block :: xml
@@ -118,7 +119,8 @@ typical usage of this is gender:
118
119
<target >{organizer_gender, select,
119
120
female {{organizer_name} has invited you to her party!}
120
121
male {{organizer_name} has invited you to his party!}
121
- other {{organizer_name} have invited you to their party!}
122
+ multi {{organizer_name} have invited you to their party!}
123
+ other {{organizer_name} has invited you to their party!}
122
124
}</target >
123
125
</trans-unit >
124
126
</body >
@@ -133,7 +135,8 @@ typical usage of this is gender:
133
135
'invitation_title' => '{organizer_gender, select,
134
136
female {{organizer_name} has invited you to her party!}
135
137
male {{organizer_name} has invited you to his party!}
136
- other {{organizer_name} have invited you to their party!}
138
+ multi {{organizer_name} have invited you to their party!}
139
+ other {{organizer_name} has invited you to their party!}
137
140
}',
138
141
];
139
142
@@ -152,6 +155,12 @@ select. This function is applied over the ``organizer_gender`` variable::
152
155
// prints "John & Jane have invited you to their party!"
153
156
echo $translator->trans('invitation_title', [
154
157
'organizer_name' => 'John & Jane',
158
+ 'organizer_gender' => 'multi',
159
+ ]);
160
+
161
+ // prints "McDonalds has invited you to their party!"
162
+ echo $translator->trans('invitation_title', [
163
+ 'organizer_name' => 'McDonalds',
155
164
'organizer_gender' => 'not_applicable',
156
165
]);
157
166
@@ -170,7 +179,7 @@ you to use literal text in the select statements:
170
179
While it might seem more logical to only put ``her ``, ``his `` or ``their ``
171
180
in the switch statement, it is better to use "complex arguments" at the
172
181
outermost structure of the message. The strings are in this way better
173
- readable for translators and, as you can see in the ``other `` case, other
182
+ readable for translators and, as you can see in the ``multi `` case, other
174
183
parts of the sentence might be influenced by the variables.
175
184
176
185
.. tip ::
@@ -179,12 +188,13 @@ you to use literal text in the select statements:
179
188
without having to define them in any file::
180
189
181
190
$invitation = '{organizer_gender, select,
182
- female {{organizer_name} has invited you for her party!}
183
- male {{organizer_name} has invited you for his party!}
184
- other {{organizer_name} have invited you for their party!}
191
+ female {{organizer_name} has invited you to her party!}
192
+ male {{organizer_name} has invited you to his party!}
193
+ multi {{organizer_name} have invited you to their party!}
194
+ other {{organizer_name} has invited you to their party!}
185
195
}';
186
196
187
- // prints "Ryan has invited you for his party!"
197
+ // prints "Ryan has invited you to his party!"
188
198
echo $translator->trans($invitation, [
189
199
'organizer_name' => 'Ryan',
190
200
'organizer_gender' => 'male',
0 commit comments