Download the PHP package vanengers/catalog-translator without Composer

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

catalog-translator

Translates a whole catalog and saves it to disk for re-use. By default we are using Deepl for translations, but you can use any translator you want.


This is for development usage. This should not be used in a production environment.

Install

composer require --dev vanengers/catalog-translator

Usage

``

Example

First create a catalog with the base language keys, this is the language you want to translate from. So the key is the same as the value. ``

Create an array of locales to translate to.

``

Load an external translator, in this case we are using Deepl. ``

Location of the translations json file to retrieve and store translations. This file will be created if it does not exist. Existing translations will be used if the file exists and not be translated again. ``

External Translators

You can use any translator you want, as long as it implements the ITranslateClient. ``

Available translators

Deepl

``

Languages

Each external translator has its own set of languages it supports. You can retrieve these languages by calling the getSourceLanguages() or getTargetLanguages() methods on the translator.

``

The iso and locale codes from the external translator are not always the same as the ones. Convert them using the config/languages.json file. You should do this with every External client so it matches the languages in the config file.

We use locales throughout the application, but the external translator might use iso codes. This differs per external translator
``

And when parsing the languages from the external translator, convert them to locales. In this case we have Language objects from Deepl. But this differs per external translator. ``

Exceptions in iso/locale conversion

Within the catalog-translator we use locales. For example: en-GB is supported here. When converting the locale en-GB to iso, we get "gb", officially this is a correct iso language code.
But Deepl doesn't allow this code to be a language source. So translate "gb" to "en" when it's a source language.
Deepl does however accept "en-gb" as an iso-code for a target language.

So keep in mind when implementing a new external translator! Use the languages.json file to convert the iso codes to locales and vice versa.


All versions of catalog-translator with dependencies

PHP Build Version
Package Version
Requires deeplcom/deepl-php Version dev-main
ext-json Version *
symfony/translation Version *
symfony/filesystem Version *
symfony/http-client Version 4.4.51
nyholm/psr7 Version ^1.8@dev
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 vanengers/catalog-translator contains the following files

Loading the files please wait ....