Download the PHP package symfony/phrase-translation-provider without Composer

On this page you can find all versions of the php package symfony/phrase-translation-provider. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package phrase-translation-provider

Phrase Translation Provider

Provides Phrase integration for Symfony Translation.

DSN example

DSN elements

Required DSN query parameters

See fine tuning your Phrase api calls for additional DSN options.

Phrase locale names

Translations being imported using the Symfony XLIFF format in Phrase, locales are matched on locale name in Phrase. Therefor it's necessary the locale names 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.

Locale creation

If you define a locale in your translation.yaml which is not configured in your Phrase project, it will be automatically created. Deletion of locales however, is (currently) not managed by this provider.

Domains as tags

Translations will be tagged in Phrase with the Symfony translation domain they belong to. Check the wickedone/phrase-translation-bundle if you need help managing your tags in Phrase.

Cache

The read responses from Phrase are cached to speed up the read and delete methods of this provider and also to contribute to the rate limit as little as possible. Therefor the factory should be initialised with a PSR-6 compatible cache adapter.

Fine tuning your Phrase api calls

You can fine tune the read and write methods of this provider by adding query parameters to your dsn configuration. General usage is read|write[option_name]=value

example: phrase://PROJECT_ID:API_TOKEN@default?read[encoding]=UTF-8&write[update_descriptions]=0

Read

In order to read translations from Phrase the download locale call is made to the Phrase API, supported parameters can be found in their documentation.

One additional read parameter is fallback_locale_enabled (defaults to 0). When set to 1, this provider will use the fallback locales as they are configured in Phrase.

❗enabling the fallback locale will disable the caching of the conditional get requests

Write

In order to write translations to Phrase the upload call is made to the Phrase API, supported parameters can be found in their documentation.

Default values This provider uses the following default values for read and write requests. All but file_format and tags can be overridden by configuring your DSN query parameters.

method(s) name type default value
read & write file_format string symfony_xliff
read & write tags string dynamically set to symfony translation domain
read include_empty_translations bool 1
read format_options array enclose_in_cdata
read fallback_locale_enabled bool 0
write update_translations bool 1

Resources


All versions of phrase-translation-provider with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2
psr/cache Version ^3.0
symfony/http-client Version ^6.4|^7.0
symfony/mime Version ^6.4|^7.0
symfony/translation Version ^7.2
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package symfony/phrase-translation-provider contains the following files

Loading the files please wait ....