/translations/`` directory to store
- translations was deprecated in Symfony 4.2. Use instead the directory
- defined in the ``default_path`` option (which is ``translations/`` by default).
+* the ``translations/`` directory (at the root of the project);
+* the ``Resources/translations/`` directory inside of any bundle.
The locations are listed here with the highest priority first. That is, you can
-override the translation messages of a bundle in any of the top two directories.
+override the translation messages of a bundle in the first directory.
The override mechanism works at a key level: only the overridden keys need
to be listed in a higher priority message file. When a key is not found
@@ -477,13 +459,6 @@ if you're generating translations with specialized programs or teams.
:class:`Symfony\\Component\\Translation\\Loader\\LoaderInterface` interface.
See the :ref:`dic-tags-translation-loader` tag for more information.
-.. versionadded:: 4.3
-
- Starting from Symfony 4.3, when you create a new translation file (or
- install a bundle that includes translation files), you don't have to clear
- the cache with the command ``php bin/console cache:clear`` as you had to do
- in previous Symfony versions.
-
Handling the User's Locale
--------------------------
@@ -550,12 +525,6 @@ checks translation resources for several locales:
// ...
]);
-.. deprecated:: 4.4
-
- In Symfony versions before 4.4, the ``fallbacks`` option was initialized to
- ``en`` (English) when not configured explicitly. Starting from Symfony 4.4,
- this option is initialized to the same value as the ``default_locale`` option.
-
.. note::
When Symfony can't find a translation in the given locale, it will
diff --git a/translation/lint.rst b/translation/lint.rst
index 29cec3c5008..bcdd42eae9b 100644
--- a/translation/lint.rst
+++ b/translation/lint.rst
@@ -32,3 +32,16 @@ The linter results can be exported to JSON using the ``--format`` option:
$ php bin/console lint:yaml translations/ --format=json
$ php bin/console lint:xliff translations/ --format=json
+
+.. tip::
+
+ The Yaml component provides a stand-alone ``yaml-lint`` binary to lint YAML
+ files without using the entire Symfony console application:
+
+ .. code-block:: terminal
+
+ $ php vendor/bin/yaml-lint translations/
+
+ .. versionadded:: 5.1
+
+ The ``yaml-lint`` binary was introduced in Symfony 5.1.
diff --git a/translation/message_format.rst b/translation/message_format.rst
index 4c660c7023a..187b3513df5 100644
--- a/translation/message_format.rst
+++ b/translation/message_format.rst
@@ -4,10 +4,6 @@
How to Translate Messages using the ICU MessageFormat
=====================================================
-.. versionadded:: 4.2
-
- Support for ICU MessageFormat was introduced in Symfony 4.2.
-
Messages (i.e. strings) in applications are almost never completely static.
They contain variables or other complex logic like pluralization. In order to
handle this, the Translator component supports the `ICU MessageFormat`_ syntax.
diff --git a/translation/templates.rst b/translation/templates.rst
index 903f1934d92..b820bfb0fba 100644
--- a/translation/templates.rst
+++ b/translation/templates.rst
@@ -9,27 +9,13 @@ Twig Templates
Using Twig Tags
~~~~~~~~~~~~~~~
-Symfony provides specialized Twig tags (``trans`` and ``transchoice``) to
-help with message translation of *static blocks of text*:
+Symfony provides a specialized Twig tag ``trans`` to help with message
+translation of *static blocks of text*:
.. code-block:: twig
{% trans %}Hello %name%{% endtrans %}
- {% transchoice count %}
- {0} There are no apples|{1} There is one apple|]1,Inf[ There are %count% apples
- {% endtranschoice %}
-
-The ``transchoice`` tag automatically gets the ``%count%`` variable from
-the current context and passes it to the translator. This mechanism only
-works when you use a placeholder following the ``%var%`` pattern.
-
-.. deprecated:: 4.2
-
- The ``transchoice`` tag is deprecated since Symfony 4.2 and will be
- removed in 5.0. Use the :doc:`ICU MessageFormat ` with
- the ``trans`` tag instead.
-
.. caution::
The ``%var%`` notation of placeholders is required when translating in
@@ -48,34 +34,19 @@ You can also specify the message domain and pass some additional variables:
{% trans with {'%name%': 'Fabien'} from 'app' into 'fr' %}Hello %name%{% endtrans %}
- {% transchoice count with {'%name%': 'Fabien'} from 'app' %}
- {0} %name%, there are no apples|{1} %name%, there is one apple|]1,Inf[ %name%, there are %count% apples
- {% endtranschoice %}
-
.. _translation-filters:
Using Twig Filters
~~~~~~~~~~~~~~~~~~
-The ``trans`` and ``transchoice`` filters can be used to translate *variable
-texts* and complex expressions:
+The ``trans`` filter can be used to translate *variable texts* and complex expressions:
.. code-block:: twig
{{ message|trans }}
- {{ message|transchoice(5) }}
-
{{ message|trans({'%name%': 'Fabien'}, 'app') }}
- {{ message|transchoice(5, {'%name%': 'Fabien'}, 'app') }}
-
-.. deprecated:: 4.2
-
- The ``transchoice`` filter is deprecated since Symfony 4.2 and will be
- removed in 5.0. Use the :doc:`ICU MessageFormat ` with
- the ``trans`` filter instead.
-
.. tip::
Using the translation tags or filters have the same effect, but with
@@ -116,8 +87,3 @@ The translator service is accessible in PHP templates through the
= $view['translator']->trans('Symfony is great') ?>
- = $view['translator']->transChoice(
- '{0} There are no apples|{1} There is one apple|]1,Inf[ There are %count% apples',
- 10,
- ['%count%' => 10]
- ) ?>
diff --git a/validation/custom_constraint.rst b/validation/custom_constraint.rst
index 9af22a03480..69fcfe07ee1 100644
--- a/validation/custom_constraint.rst
+++ b/validation/custom_constraint.rst
@@ -93,11 +93,6 @@ The validator class is also simple, and only has one required method ``validate(
}
}
-.. versionadded:: 4.4
-
- The feature to allow passing an object as the ``buildViolation()`` argument
- was introduced in Symfony 4.4.
-
Inside ``validate``, you don't need to return a value. Instead, you add violations
to the validator's ``context`` property and a value will be considered valid
if it causes no violations. The ``buildViolation()`` method takes the error
diff --git a/workflow.rst b/workflow.rst
index db131726b85..21c9488ed01 100644
--- a/workflow.rst
+++ b/workflow.rst
@@ -345,16 +345,19 @@ order:
* ``workflow.[workflow name].announce``
* ``workflow.[workflow name].announce.[transition name]``
+ You can avoid triggering those events by using the context::
+
+ $workflow->apply($subject, $transitionName, [Workflow::DISABLE_ANNOUNCE_EVENT => true]);
+
+ .. versionadded:: 5.1
+
+ The ``Workflow::DISABLE_ANNOUNCE_EVENT`` constant was introduced in Symfony 5.1.
+
.. note::
The leaving and entering events are triggered even for transitions that stay
in same place.
-.. versionadded:: 4.3
-
- Following events are also dispatched when the subject enters the workflow
- for the first time: ``workflow.entered`` and ``workflow.[worflow name].entered``.
-
Here is an example of how to enable logging for every time a "blog_publishing"
workflow leaves a place::
@@ -549,10 +552,6 @@ place::
}
}
-.. versionadded:: 4.1
-
- The transition blockers were introduced in Symfony 4.1.
-
Usage in Twig
-------------
@@ -606,10 +605,6 @@ The following example shows these functions in action:
Storing Metadata
----------------
-.. versionadded:: 4.1
-
- The feature to store metadata in workflows was introduced in Symfony 4.1.
-
In case you need it, you can store arbitrary metadata in workflows, their
places, and their transitions using the ``metadata`` option. This metadata can
be as simple as the title of the workflow or as complex as your own application
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