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

On this page you can find all versions of the php package wickedone/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

symfony phrase translation provider bridge

infection codecov psalm stable downloads license php

:warning: this translation provider has been integrated into symfony starting at version 6.4. this repository will be archived once lts expires for symfony 5.4

installation

dsn example

dsn elements

required dsn query parameters

see fine tuning your phrase api calls for additional dsn options

service phrase provider

in your services.yaml add the following to enable the phrase provider.

and in your translations.yaml you can add:

phrase locale names

translations being imported using the symfony xlf 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-tag-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 method of this provider. therefor the factory should be initialised with a PSR-6 compatible cache adapter.

events

to enable you to perform post-processing on translation values and / or keys, two events are dispatched by this provider class.

PhraseReadEvent

after reading the catalogue from phrase, the resulting TranslatorBag is dispatched in a PhraseReadEvent prior to being returned from the read method.

PhraseWriteEvent

before writing the catalogue to phrase, the TranslatorBag is dispatched in a PhraseWriteEvent.

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

see tables below for available options and, if applicable, their default values.

read

in order to read translations from phrase the download locale call is made to the phrase api. this call provides the following options.

name type default value comment
branch string
include_empty_translations bool 1
exclude_empty_zero_forms bool
include_translated_keys bool
keep_notranslate_tags bool
format_options array enclose_in_cdata
encoding string
skip_unverified_translations bool
include_unverified_translations bool
use_last_reviewed_version bool
fallback_locale_enabled bool 0 when the fallback locale is enabled, caching responses from phrase will be disabled

write

in order to write translations to phrase the upload call is made to the phrase api. this call provides the following options.

name type default value comment
update_translations bool 1
update_descriptions bool
skip_upload_tags bool
skip_unverification bool
file_encoding string
locale_mapping array
format_options array
autotranslate bool
mark_reviewed bool

All versions of phrase-translation-provider with dependencies

PHP Build Version
Package Version
Requires php Version ~8.2.0 || ~8.3.0
psr/cache Version ^3.0
psr/event-dispatcher Version ^1.0
symfony/event-dispatcher-contracts Version ^3.4.0
symfony/http-client Version ^5.4 || ^6.4 || ^7.0
symfony/mime Version ^5.4 || ^6.4 || ^7.0
symfony/translation Version ^5.4 || ^6.4 || ^7.0
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 wickedone/phrase-translation-provider contains the following files

Loading the files please wait ....