Skip to content

Commit 6b2e218

Browse files
committed
Tweaks
1 parent dcb9f7e commit 6b2e218

File tree

2 files changed

+14
-13
lines changed

2 files changed

+14
-13
lines changed

reference/dic_tags.rst

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1233,9 +1233,10 @@ This is the name that's used to determine which dumper should be used.
12331233
translation.provider_factory
12341234
----------------------------
12351235

1236-
**Purpose**: To register a factory creating custom Translation Provider
1236+
**Purpose**: to register a factory related to custom translation providers
12371237

1238-
Register your factory as a service and tag it with ``translation.provider_factory``:
1238+
When creating custom :ref:`translation providers <translation-providers>`, you
1239+
must register your factory as a service and tag it with ``translation.provider_factory``:
12391240

12401241
.. configuration-block::
12411242

@@ -1270,8 +1271,6 @@ Register your factory as a service and tag it with ``translation.provider_factor
12701271
->addTag('translation.provider_factory')
12711272
;
12721273
1273-
For more details, see :ref:`translation providers <translation-providers>`.
1274-
12751274
.. _reference-dic-tags-twig-extension:
12761275

12771276
twig.extension

translation.rst

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -746,16 +746,18 @@ now use the following commands to push (upload) and pull (download) translations
746746
# check out the command help to see its options (format, domains, locales, intl-icu, etc.)
747747
$ php bin/console translation:pull --help
748748
749-
Creating custom Provider
750-
~~~~~~~~~~~~~~~~~~~~~~~~
749+
Creating Custom Providers
750+
~~~~~~~~~~~~~~~~~~~~~~~~~
751+
752+
In addition to using Symfony's built-in translation providers, you can create
753+
your own providers. To do so, you need to create two classes:
754+
755+
#. The first class must implement :class:`Symfony\\Component\\Translation\\Provider\\ProviderInterface`;
756+
#. The second class needs to be a factory which will create instances of the first class. It must implement
757+
:class:`Symfony\\Component\\Translation\\Provider\\ProviderFactoryInterface` (you can extend :class:`Symfony\\Component\\Translation\\Provider\\AbstractProviderFactory` to simplify its creation).
751758

752-
If you wish to create new Translation Provider, you need to create two classes.
753-
First one must implement :class:`Symfony\\Component\\Translation\\Provider\\ProviderInterface`.
754-
Second needs to be a factory, that will create instances of the first class. It must implement
755-
:class:`Symfony\\Component\\Translation\\Provider\\ProviderFactoryInterface`.
756-
You may extend :class:`Symfony\\Component\\Translation\\Provider\\AbstractProviderFactory`
757-
to simplify its creation. Additionally you need to tag the factory service with
758-
:ref:`translation.provider_factory <reference-dic-tags-translation-provider-factory>`.
759+
After creating these two classes, you need to register your factory as a service
760+
and tag it with :ref:`translation.provider_factory <reference-dic-tags-translation-provider-factory>`.
759761

760762
.. _translation-locale:
761763

0 commit comments

Comments
 (0)