Skip to content

[Translator] Recommending real message id for shared bundles #12236

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 6, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions components/translation/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,10 @@ recommended format. These files are parsed by one of the loader classes.
read "Symfony is really great" in the default locale.

The choice of which method to use is entirely up to you, but the "keyword"
format is often recommended.
format is often recommended for multi-language applications, whereas for
shared bundles that contain translation resources we recommend the real
message, so you application can choose to disable the translator layer
and you will see a readable message.

Additionally, the ``php`` and ``yaml`` file formats support nested ids to
avoid repeating yourself if you use keywords instead of real text for your
Expand Down Expand Up @@ -351,7 +354,7 @@ effect after removing the explicit rules:
'{0} There are no apples|[20,Inf[ There are many apples|There is one apple|a_few: There are %count% apples'

For example, for ``1`` apple, the standard rule ``There is one apple`` will
be used. For ``2-19`` apples, the second standard rule
be used. For ``2-19`` apples, the second standard rule
``There are %count% apples`` will be selected.

An :class:`Symfony\\Component\\Translation\\Interval` can represent a finite set
Expand Down