Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Php Translation Bundle Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Getting Started

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:

  1. Read the source before composer. Clone the repo and open 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.
  2. Identify the underlying library's job. The bundle is only glue. The real capability — talking to a translation API, reading/writing translation files, or managing catalogs — lives in sooyoos/php-translation. Check that package's README and API for the actual day-to-day surface.
  3. Wire it into a scratch Symfony app, not your Laravel app. In a Symfony 3/4-era app this is registering the bundle in 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.
  4. First use case: run whatever console commands the bundle ships with (look in 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.

Implementation Patterns

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.

Gotchas and Tips

  • Framework mismatch is the headline gotcha. A Symfony bundle uses 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.
  • Maintenance risk. 0 stars, 0 dependents, and a repository URL that looks like a mono-repo rather than a dedicated package means you are on your own for Symfony version drift, PHP 8.x compatibility, and security patches. Pin the exact version, and consider forking or vendoring the small amount of glue you actually need.
  • Configuration key guessing. The extension alias rarely matches the package name exactly. Dump the reference (config:dump-reference) or read Configuration.php; do not iterate on YAML until something stops throwing.
  • Service IDs are not public API. If you inject the client by its private service id, a minor version bump can rename it. Prefer injecting by the interface/type hint the bundle aliases, or read the service wiring once and document it in your own provider.
  • Silent failures on bad credentials. Translation clients often swallow HTTP errors and return the original string. Turn on the library's logging, or bind a PSR-3 logger into the client, before you conclude the integration works. Test with a string you know is missing.
  • Cache invalidation. Symfony's translator caches compiled catalogs in var/cache; Laravel caches in bootstrap/cache. After any config or catalog change, clear both sides of the pipe, not just one.
  • Extension points worth knowing. Compiler passes (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.
  • Verdict for a Laravel team: consume the library, not the bundle. Copy the command logic and the client construction from the bundle source, add tests around the HTTP boundary, and isolate it behind your own interface so replacing it later is a one-file change.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
skyraptor/chatter
edlugz/sasapay
abbasudo/artisan-route
mirvan/ippanel
ignibyte/aic-framework
glavweb/data-schema-bundle
glavweb/datagrid-bundle
tacticmedia/scim-server
uni-method/frame
neika-ai/sdk
adachsoft/php-code-style
pharaonic/laravel-notification-dependencies
beautinow/translug
dev-brainiac/bot-cloaked
octoberrain/html
octoberrain/extension
octoberrain/exception
octoberrain/contracts
adachsoft/api-version-bundle
cgv/localized-resource