Skip to content

[Translation] phrase translation provider #17861

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
Aug 7, 2023
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
17 changes: 17 additions & 0 deletions translation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -600,6 +600,7 @@ Provider Install with
Crowdin ``composer require symfony/crowdin-translation-provider``
Loco (localise.biz) ``composer require symfony/loco-translation-provider``
Lokalise ``composer require symfony/lokalise-translation-provider``
Phrase ``composer require symfony/phrase-translation-provider``
==================== ===========================================================

Each library includes a :ref:`Symfony Flex recipe <symfony-flex>` that will add
Expand Down Expand Up @@ -689,6 +690,14 @@ configure the ``providers`` option:
],
]);

.. important::

If you use Phrase as a provider you must configure a user agent in your dsn. See
`Identification via User-Agent`_ for reasoning and some examples.

Also make the locale _names_ in Phrase should be as defined in RFC4646 (e.g. pt-BR rather than pt_BR).
Not doing so will result in Phrase creating a new locale for the imported keys.

.. tip::

If you use Lokalise as a provider and a locale format following the `ISO
Expand All @@ -698,6 +707,12 @@ configure the ``providers`` option:
capital letters that specifies the national variety (e.g. "GB" or "US"
according to `ISO 3166-1 alpha-2`_)).

.. tip::

The Phrase provider uses Phrase's tag feature to map translations to Symfony's translation
domains. If you need some assistance with organising your tags in Phrase, you might want
to consider the `Phrase Tag Bundle`_ which provides some commands helping you with that.

Pushing and Pulling Translations
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down Expand Up @@ -1479,3 +1494,5 @@ Learn more
.. _`GitHub Actions`: https://docs.github.com/en/free-pro-team@latest/actions
.. _`pseudolocalization`: https://en.wikipedia.org/wiki/Pseudolocalization
.. _`Symfony Demo`: https://github.com/symfony/demo
.. _`Identification via User-Agent`: https://developers.phrase.com/api/#overview--identification-via-user-agent
.. _`Phrase Tag Bundle`: https://github.com/wickedOne/phrase-tag-bundle