Download the PHP package survos/translator-bundle without Composer

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

Survos Translator Bundle

A Symfony 7.3 / PHP 8.4 bundle that unifies multiple translation engines (DeepL, LibreTranslate, …), adds smart caching, and optional async processing via Messenger. Designed to replace the legacy libre-bundle in the Survos translation server.

Target repo to integrate with next: https://github.com/survos-sites/translation-server


Features


Installation

If you use Symfony Flex, the bundle is auto‑enabled. Otherwise, add to config/bundles.php:


Environment & API Keys

Set the following in your .env.local (or server secrets). Only configure the engines you’ll use.

Pro tip: keep engine‑specific keys/names distinct per environment to avoid accidental cross‑use.


Bundle Configuration

Create config/packages/survos_translator.yaml:

Optional: Dedicated Cache Pool

The bundle will auto‑wire a pool named survos_translator.cache if present, otherwise falls back to cache.app.


Quick Start (Sync)

Minimal Service Call (no controller)


Async Translation (Messenger)

Enable a transport (choose one) in config/packages/messenger.yaml:

Dispatch work:

Run a worker:

The worker uses the same caching rules; repeated requests are cheap.


CLI Utilities (Symfony 7.3 style)

The bundle ships a small demo command to smoke‑test config and warm cache.

Sample implementation pattern (your app command):

Notes for this user/project: parameters follow your preferred Symfony 7.3 attribute style (invokable, SymfonyStyle, attributes in __invoke).


Engine Behavior

Both engines normalize language codes and report back detectedSource when source is omitted.


Caching Strategy


Error Handling

Catch & fallback example:


Replacing the Legacy libre-bundle

  1. Remove old services/config tied to libre-bundle.
  2. Install this bundle and add envs: LIBRETRANSLATE_BASE_URI, optional LIBRETRANSLATE_API_KEY.
  3. Search/Replace old client/service with Survos\TranslatorBundle\Service\Translator.
  4. Switch endpoints: old /translate controllers can now delegate to the new service.
  5. Enable async in the translation server by routing TranslateText via Messenger.
  6. Keep your existing cache: point the pool name to survos_translator.cache.

Minimal controller in translation‑server style:


Testing Locally


Extending with New Engines

  1. Implement EngineInterface (e.g., AcmeEngine).
  2. Tag the service with survos.translator.engine and give it a name.
  3. Now you can call with options: ['engine' => 'acme'].

Skeleton:


Roadmap


License

MIT © Survos


All versions of translator-bundle with dependencies

PHP Build Version
Package Version
Requires php Version ^8.4
psr/cache Version ^3.0
psr/container Version ^2.0
symfony/cache Version ^7.3
symfony/config Version ^7.3
symfony/console Version ^7.3
symfony/dependency-injection Version ^7.3
symfony/http-client Version ^7.3
symfony/string Version ^7.3
symfony/http-kernel Version ^7.3
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 survos/translator-bundle contains the following files

Loading the files please wait ....