sooyoos/php-translation-bundle
sooyoos/php-translation-bundle provides translation support for PHP applications, helping you organize locale-specific messages and integrate translation workflows into your project. It offers a lightweight way to manage language resources and keep multilingual content consistent across your app.
Before you install anything, be clear about what you are evaluating: sooyoos/php-translation-bundle is a Symfony bundle, not a Laravel package. It has 0 stars, 0 dependents, and a generic repository name, which are strong signals that it is a thin, likely unmaintained integration layer around the sooyoos/php-translation library. Treat it as a reference implementation for wiring that library into a framework, not as a production dependency you should adopt blindly.
Minimal steps to evaluate it:
composer.json, then the bundle class and Resources/config/services.yml (or config/services.yaml on Symfony 4+ Flex-style bundles). You want to know three things: which Symfony versions are allowed, what the configuration tree exposes (DependencyInjection/Configuration.php), and what services the bundle registers. That is the entire contract of the package.sooyoos/php-translation. Check that package's README and API for the actual day-to-day surface.AppKernel.php (or config/bundles.php) and adding the config block under the bundle's extension alias — typically something like sooyoos_translation: with credentials/endpoint settings. Run bin/console config:dump-reference <alias> to see the full tree rather than guessing keys.Command/) to push or pull a translation catalog, or inject the client service into a small command of your own and make a single read call. That tells you whether the library is usable independently of Symfony.For a Laravel codebase, the realistic path is: do not try to make the bundle run. Install sooyoos/php-translation alone and bind it in a service provider. The bundle's service definitions are your blueprint for that binding.
Direct library use inside Laravel (recommended). Skip the bundle, register a singleton in a service provider that constructs the underlying client from config:
$this->app->singleton(TranslationClient::class, function ($app) {
return new TranslationClient(
config('services.translations.api_key'),
config('services.translations.endpoint'),
);
});
Then keep credentials in config/services.php and .env, mirroring what the bundle's configuration tree would have exposed. This is the lowest-friction way to get value from the package.
Sync via Artisan commands. The bundle's console commands are the useful part. Port them as Artisan commands — translations:pull, translations:push — each one calling the client and writing into lang/ or resources/lang/. This gives you the same workflow the Symfony bundle would, with Laravel-native scheduling ($schedule->command(...)->hourly()).
Symfony sidecar (only if you need the bundle intact). If you must use the bundle itself, run a small Symfony app alongside Laravel that owns the translation sync, and have it write to a shared path or push to your app's API. This is heavyweight and only worth it if the Symfony integration contains logic you can't cheaply reproduce.
Translation lookup decoration. In Symfony the bundle likely exposes or decorates the translator service. In Laravel the equivalent hook is app('translator')->addLines(...) at boot, or a custom Loader implementation registered via app('translation.loader')->extend(...). Use this when you want remote/dynamic strings merged into Laravel's loader chain rather than baked into PHP files.
Cache-aware sync. Whatever the bundle does, wrap it so a successful pull clears php artisan optimize:clear or at least the translation cache. Stale catalogs are the most common "the package is broken" report.
Bundle, Extension, Configuration, and DI compiler passes. None of that exists in Laravel. Do not add it to composer.json expecting it to boot; at best it loads inert classes. Only the underlying sooyoos/php-translation library is portable.config:dump-reference) or read Configuration.php; do not iterate on YAML until something stops throwing.var/cache; Laravel caches in bootstrap/cache. After any config or catalog change, clear both sides of the pipe, not just one.prepend/append on the translator), event subscribers for pre/post-sync, and custom loaders are the three places this family of packages usually allows behavior changes. If you need something else, you're forking.How can I help you explore Laravel packages today?