Download the PHP package dschuppelius/php-translation-toolkit without Composer

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

php-translation-toolkit

Schlankes Übersetzungs-Toolkit mit Provider-Abstraktion, Cache-Port und Providern für DeepL, Azure Translator und LibreTranslate auf Basis von daniel-jorg-schuppelius/php-api-toolkit (Retry mit Backoff, Rate-Limit-Handling, Auth-Abstraktion, Log-Redaktion).

Entwurfsgrundlage: ADR-0010 (Übersetzungsdienst mit Translation-Cache und Nutzungserfassung).

Bausteine

Baustein Zweck
TranslationService Orchestrierung: Cache prüfen → Provider aufrufen → Cache füllen → Nutzung melden
TranslationProviderInterface Port für Provider (DeepL, Azure, LibreTranslate, ...)
TranslationCacheInterface Port für den globalen Übersetzungs-Cache (DB-Implementierung beim Host)
TranslationUsageListenerInterface Port für die Nutzungserfassung (Berechnungsgrundlage, auch Cache-Hits)
GlossaryIdStoreInterface Port für die Persistenz einer Provider-Glossar-ID (DeepL v3)
Entities\TranslateOptions Format, Förmlichkeit, Glossarbegriffe je Aufruf
Entities\TranslationResult Ergebnis inkl. charCount, fromCache, deterministicTerminology
Providers\DeepLProvider DeepL REST v2 + natives v3-Glossar; Free-Keys (…:fx) → api-free.deepl.com
Providers\AzureTranslatorProvider Azure Translator v3.0 + Dynamic-Dictionary-Markup je Request
Providers\LibreTranslateProvider Selbst gehostet, Glossar über Token-Maskierung
Caches\ArrayTranslationCache In-Memory-Cache für Tests/Kurzläufer
Stores\InMemoryGlossaryIdStore Glossar-ID für die Prozesslaufzeit (Tests/Kurzläufer)
Providers\CompositeProvider Fallback-Kette: erster verfügbarer Provider übersetzt, bei Fehlern der nächste
TranslationRegistry Statische Injektion für Umgebungen ohne Konstruktor-DI (analog LoggerRegistry)

Verwendung

Batch, Default-Optionen und Fallback

Der DeepL-Glossar-Sync läuft nur bei geänderten Einträgen (Fingerprint im GlossaryIdStoreInterface — persistente Stores vermeiden so auch über Prozessgrenzen unnötige Requests und Glossar-Neuanlagen).

TranslationService::needsTranslation() bildet die v1-Heuristik ab (nicht-lateinische Zeichen und Mindestlänge), cacheHash() den ADR-0010-Cache-Schlüssel SHA-256(text|source|target|provider).

Optionen: Format, Förmlichkeit, Glossar

deterministicTerminology beschreibt diesen Aufruf und ist bei Cache-Treffern immer false — dort wird nicht übersetzt, und der Cache hält nur den Text. Da Glossar und Quellsprache im Schlüssel stecken, stammt ein Treffer aber garantiert aus einem Lauf mit identischen Vorgaben.

Wie ein Provider Terminologie erzwingt, unterscheidet sich — das Ergebnis führt mit deterministicTerminology die tatsächliche Wirkung je Aufruf:

Provider Mechanik Voraussetzung
DeepL natives multilinguales v3-Glossar, Dictionary je Sprachpaar wird idempotent voll ersetzt explizite Quellsprache — ohne sourceLang bleibt das Glossar ungenutzt
Azure Translator <mstrans:dictionary translation="…">Begriff</mstrans:dictionary> je Request schaltet automatisch auf textType=html
LibreTranslate Token-Maskierung vor/nach dem Aufruf Begriff muss im Text vorkommen

Nicht-Default-Optionen gehen in den Cache-Schlüssel ein; bei Defaults bleibt er identisch zu Einträgen ohne Optionen (bestehende Caches behalten ihre Treffer).

Für DeepL sollte die Glossar-ID persistiert werden, sonst legt jeder Prozess ein neues Remote-Glossar an:

Qualitätssicherung


All versions of php-translation-toolkit with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1 <8.6
ext-mbstring Version *
daniel-jorg-schuppelius/php-api-toolkit Version ^2.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 dschuppelius/php-translation-toolkit contains the following files

Loading the files please wait ...