Skip to content

Commit 60987f7

Browse files
committed
minor #16943 [Translation] Improve the grammar in the example messages (CJDennis)
This PR was submitted for the 6.1 branch but it was merged into the 5.4 branch instead. Discussion ---------- [Translation] Improve the grammar in the example messages Separate the case of multiple people from an organisation or a non-binary person treated as singular <!-- If your pull request fixes a BUG, use the oldest maintained branch that contains the bug (see https://symfony.com/releases for the list of maintained branches). If your pull request documents a NEW FEATURE, use the same Symfony branch where the feature was introduced (and `6.x` for features of unreleased versions). --> Commits ------- c734f28 Improve the grammar in the example messages
2 parents 976422a + c734f28 commit 60987f7

File tree

1 file changed

+18
-8
lines changed

1 file changed

+18
-8
lines changed

translation/message_format.rst

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,8 @@ typical usage of this is gender:
102102
{organizer_gender, select,
103103
female {{organizer_name} has invited you to her party!}
104104
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!}
106107
}
107108
108109
.. code-block:: xml
@@ -118,7 +119,8 @@ typical usage of this is gender:
118119
<target>{organizer_gender, select,
119120
female {{organizer_name} has invited you to her party!}
120121
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!}
122124
}</target>
123125
</trans-unit>
124126
</body>
@@ -133,7 +135,8 @@ typical usage of this is gender:
133135
'invitation_title' => '{organizer_gender, select,
134136
female {{organizer_name} has invited you to her party!}
135137
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!}
137140
}',
138141
];
139142
@@ -152,6 +155,12 @@ select. This function is applied over the ``organizer_gender`` variable::
152155
// prints "John & Jane have invited you to their party!"
153156
echo $translator->trans('invitation_title', [
154157
'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',
155164
'organizer_gender' => 'not_applicable',
156165
]);
157166

@@ -170,7 +179,7 @@ you to use literal text in the select statements:
170179
While it might seem more logical to only put ``her``, ``his`` or ``their``
171180
in the switch statement, it is better to use "complex arguments" at the
172181
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
174183
parts of the sentence might be influenced by the variables.
175184

176185
.. tip::
@@ -179,12 +188,13 @@ you to use literal text in the select statements:
179188
without having to define them in any file::
180189

181190
$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!}
185195
}';
186196

187-
// prints "Ryan has invited you for his party!"
197+
// prints "Ryan has invited you to his party!"
188198
echo $translator->trans($invitation, [
189199
'organizer_name' => 'Ryan',
190200
'organizer_gender' => 'male',

0 commit comments

Comments
 (0)