Download the PHP package mautic/transifex without Composer

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

This is fork of archived repository by Michael Babker. Mautic use this library and so we decided to maintain it.

Transifex API Package Scrutinizer Code Quality Code Coverage Build Status Build Status

Latest Stable Version Total Downloads Latest Unstable Version License

The Transifex API Package is a PHP client for accessing the Transifex API.

Requirements

Installation

Installation via GIT

Get the source code from GIT:

Installation via Composer

To include this package in your Composer project, run the following command from the command line:

Documentation

The Transifex API package provides a PHP interface for interacting with the Transifex API.

Basic Use

The primary interface for interacting with the Transifex package is the Transifex class. This class serves as the API factory and allows developers to manage the options used by the API objects and HTTP connector as well as retrieve instances of the API objects. To create a Transifex object, you only need to instantiate it with the appropriate dependencies.

Follow the Transifex documentation on how to get the API Token.

The Config object can be also created from environmental variables:

To retrieve an instance of an API object, you would use the get() method. API objects are named based on the documented sections of the Transifex API. To retrieve an object that can interface with the "resources" API section, you would use the following code:

API Responses

This package returns a PSR-7 compatible response created by the underlying PSR-18 HTTP client.

This package is not catching Exceptions thrown by the HTTP client so users implementing this package should implement appropriate error handling mechanisms.

An exception of Mautic\Transifex\Exception\ResponseException will be thrown when the response code is > 400. The error message contains the URI, request and response. This simplifies debugging. The Request and Response object can be retreived from this exception.

Resources

Resources are the basic files that should be translated.

Get the Resource connector for the bellow examples like so:

Get all resources

Docs: https://developers.transifex.com/reference/get_resources

Create a resource

This is a syncronous operation so you get the response rightaway. You need another request to upload a content to this resource though. See the docs for example responses.

For the list of available i18n formats (the third param) trigger this endpoint.

Upload resource content

This is an asynchronous operation so the first request will just add the task to the queue and returns a unique ID See the docs. Then we have to poll another endpoint for the status of this task.

The polling for promise status happens automatically every 0.5 seconds.

As fetching for the promise status happens asynchronously and the order of processed promises is not cretain there are callbacks for your implementation to react on successful and failed statuses. Another perk is that further processing is not blocked until all promisses are resolved.

Deleting a resource

Docs: https://developers.transifex.com/reference/delete_resources-resource-id

Translations

Translations translate the resource content to another languages.

Get the Translations connector for the bellow examples like so:

Upload a translation

Uploading a translation is also asynchronous. The worflow is similar to downloading translations or resources.

Download a translation

This is the endpoint you need to get the work of the translators back to your app. Also an async operation. Check the docs. It uses the same pattern as the others:

Tests

There is one functional test that can run all the covered API requests against an existing Transifex project. It needs a configuration to connect to that project. Copy the phpunit.xml.dist file and rename it to phpunit.xml. This creates an override of the default PHPUNIT configuration. Fill in the organization, project and API token values. The test project must have the cs translation available.

To run the live test execute composer test -- --testsuite=Functional To run the unit tests execute composer test -- --testsuite=Unit

Run the whole test suite: composer test Run static analysis checks: composer phpstan Run code style checks: composer cs Fix code style issues: composer fixcs


All versions of transifex with dependencies

PHP Build Version
Package Version
Requires php Version ~7.4|^8.0|^8.1
ext-json Version *
psr/http-client Version ^1.0
psr/http-factory Version ^1.0
psr/http-message Version ^1.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 mautic/transifex contains the following files

Loading the files please wait ....