Skip to content

Commit 04ec7c8

Browse files
committed
Tweaks
1 parent fb1fa0d commit 04ec7c8

File tree

2 files changed

+53
-41
lines changed

2 files changed

+53
-41
lines changed

reference/configuration/framework.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2463,11 +2463,12 @@ providers
24632463

24642464
**type**: ``array`` **default**: ``[]``
24652465

2466-
This option allows you to enable translation providers to push and pull your translations to third party providers.
2466+
.. versionadded:: 5.3
24672467

2468-
.. seealso::
2468+
The ``providers`` option was introduced in Symfony 5.3.
24692469

2470-
For more information about how to configure providers, see :ref:`translation-providers`.
2470+
This option enables and configures :ref:`translation providers <translation-providers>`
2471+
to push and pull your translations to/from third party translation services.
24712472

24722473
property_access
24732474
~~~~~~~~~~~~~~~

translation.rst

Lines changed: 49 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -598,25 +598,32 @@ Translation Providers
598598

599599
.. versionadded:: 5.3
600600

601-
The "Translation Providers" feature was introduced in Symfony 5.3 as an
601+
Translation providers were introduced in Symfony 5.3 as an
602602
:doc:`experimental feature </contributing/code/experimental>`.
603603

604-
The translation component can push and pull translations to third party providers (e.g. Crowdin or PoEditor).
604+
When using external translators to translate your application, you must send
605+
them the new contents to translate frequently and merge the results back in the
606+
application.
605607

606-
Installing and configuring a 3rd Party Provider
607-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
608+
Instead of doing this manually, Symfony provides integration with several
609+
third-party translation services (e.g. Crowdin or PoEditor). You can upload and
610+
download (called "push" and "pull") translations to/from these services and
611+
merge the results automatically in the application.
608612

609-
Instead of editing your translation files as code, you can push them to one of the supported third-party providers.
610-
This will make the translations edition easier for you or your translators.
613+
Installing and Configuring a Third Party Provider
614+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
611615

612-
==================== ===========================================================
613-
Service Install with
614-
==================== ===========================================================
615-
Crowdin ``composer require symfony/crowdin-translation-provider``
616-
Loco (localise.biz) ``composer require symfony/loco-translation-provider``
617-
Lokalise ``composer require symfony/lokalise-translation-provider``
618-
PoEditor ``composer require symfony/po-editor-translation-provider``
619-
==================== ===========================================================
616+
Before pushing/pulling translations to a third-party provider, you must install
617+
the package that provides integration with that provider:
618+
619+
==================== ===========================================================
620+
Provider Install with
621+
==================== ===========================================================
622+
Crowdin ``composer require symfony/crowdin-translation-provider``
623+
Loco (localise.biz) ``composer require symfony/loco-translation-provider``
624+
Lokalise ``composer require symfony/lokalise-translation-provider``
625+
PoEditor ``composer require symfony/po-editor-translation-provider``
626+
==================== ===========================================================
620627

621628
Each library includes a :ref:`Symfony Flex recipe <symfony-flex>` that will add
622629
a configuration example to your ``.env`` file. For example, suppose you want to
@@ -633,25 +640,25 @@ You'll now have a new line in your ``.env`` file that you can uncomment:
633640
# .env
634641
LOCO_DSN=loco://API_KEY@default
635642
636-
The ``LOCO_DSN`` isn't a *real* address: it's a convenient format that
637-
offloads most of the configuration work to translation. The ``loco`` scheme
638-
activates the Loco provider that you just installed, which knows all about
639-
how to push and pull translations via Loco. The *only* part you need to change is the
643+
The ``LOCO_DSN`` isn't a *real* address: it's a convenient format that offloads
644+
most of the configuration work to Symfony. The ``loco`` scheme activates the
645+
Loco provider that you just installed, which knows all about how to push and
646+
pull translations via Loco. The *only* part you need to change is the
640647
``API_KEY`` placeholder.
641648

642-
This table shows the full list of available DSN formats for each third party provider:
649+
This table shows the full list of available DSN formats for each provider:
643650

644-
===================== =================================================================
645-
Provider DSN
646-
===================== =================================================================
647-
Crowdin crowdin://PROJECT_ID:API_TOKEN@ORGANIZATION_DOMAIN.default
648-
Loco (localise.biz) loco://API_KEY@default
649-
Lokalise lokalise://PROJECT_ID:API_KEY@default
650-
PoEditor poeditor://PROJECT_ID:API_KEY@default
651-
===================== =================================================================
651+
===================== ==========================================================
652+
Provider DSN
653+
===================== ==========================================================
654+
Crowdin crowdin://PROJECT_ID:API_TOKEN@ORGANIZATION_DOMAIN.default
655+
Loco (localise.biz) loco://API_KEY@default
656+
Lokalise lokalise://PROJECT_ID:API_KEY@default
657+
PoEditor poeditor://PROJECT_ID:API_KEY@default
658+
===================== ==========================================================
652659

653660
To enable a translation provider, add the correct DSN in your ``.env`` file and
654-
configure the ``providers``:
661+
configure the ``providers`` option:
655662

656663
.. configuration-block::
657664

@@ -706,37 +713,41 @@ configure the ``providers``:
706713
],
707714
]);
708715
709-
Push and pull translations
710-
~~~~~~~~~~~~~~~~~~~~~~~~~~
716+
Pushing and Pulling Translations
717+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
711718

712-
To push your existing translations to your configured third party provider, you have to use the `translation:push` command:
719+
After configuring the credentials to access the translation provider, you can
720+
now use the following commands to push (upload) and pull (download) translations:
713721

714722
.. code-block:: terminal
715723
716-
# push all local translations to the Loco provider for the locales and domains configured in config/packages/translation.yaml file
724+
# push all local translations to the Loco provider for the locales and domains
725+
# configured in config/packages/translation.yaml file.
717726
# it will update existing translations already on the provider.
718727
$ php bin/console translation:push loco --force
719728
720-
# push new local translations to the Loco provider for the French locale and the validators domain.
729+
# push new local translations to the Loco provider for the French locale
730+
# and the validators domain.
721731
# it will **not** update existing translations already on the provider.
722732
$ php bin/console translation:push loco --locales fr --domain validators
723733
724-
# push new local translations and delete provider's translations that not exists anymore in local files for the French locale and the validators domain.
734+
# push new local translations and delete provider's translations that not
735+
# exists anymore in local files for the French locale and the validators domain.
725736
# it will **not** update existing translations already on the provider.
726737
$ php bin/console translation:push loco --delete-missing --locales fr --domain validators
727738
728739
# check out the command help to see its options (format, domains, locales, etc.)
729740
$ php bin/console translation:push --help
730741
731-
To pull translations from a provider in your local files, you have to use the `translation:pull` command:
732-
733742
.. code-block:: terminal
734743
735-
# pull all provider's translations to local files for the locales and domains configured in config/packages/translation.yaml file
744+
# pull all provider's translations to local files for the locales and domains
745+
# configured in config/packages/translation.yaml file.
736746
# it will overwrite completely your local files.
737747
$ php bin/console translation:pull loco --force
738748
739-
# pull new translations from the Loco provider to local files for the French locale and the validators domain.
749+
# pull new translations from the Loco provider to local files for the French
750+
# locale and the validators domain.
740751
# it will **not** overwrite your local files, only add new translations.
741752
$ php bin/console translation:pull loco --locales fr --domain validators
742753

0 commit comments

Comments
 (0)