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
Ux Translator

Ux Translator Laravel Package

symfony/ux-translator

Symfony UX Translator brings Symfony's translation system to JavaScript. Translate messages in JS with ICU MessageFormat support, share catalogs between frontend and backend, and keep strings consistent across your entire Symfony app without duplication.

View on GitHub
Deep Wiki
Context7

Exposes Symfony Translations directly to JavaScript.

Frequently asked questions about Ux Translator
Is symfony/ux-translator compatible with Laravel?
No. symfony/ux-translator assumes Symfony's FrameworkBundle, DI container, Twig, symfony/translation, and optionally symfony/asset-mapper, none of which Laravel understands, since Laravel ships Blade, its own trans() helpers, and Vite. There is no Laravel service provider, no Blade extractor, and no Vite or asset integration. For a Laravel-only estate this package is effectively a no-op, so shortlist Laravel-native translation tooling instead.
What does symfony/ux-translator actually do?
It extracts translations from Twig templates and exposes Symfony's Translator catalogues directly to JavaScript, with ICU MessageFormat support. That lets the same catalogues drive both frontend and backend so strings stay consistent without duplication. It is wired into Symfony's dependency injection container and AssetMapper rather than being a standalone library.
How do I install symfony/ux-translator?
In a Symfony application you run composer require symfony/ux-translator and accept the Symfony Flex recipe, which registers the bundle and wires up the JavaScript side. It expects FrameworkBundle, Twig, and symfony/translation to already be present and configured. Running the same command in a Laravel app will not produce a working integration because there is no service provider or recipe for Laravel.
Does symfony/ux-translator support ICU MessageFormat in JavaScript?
Yes. The package brings Symfony's ICU MessageFormat handling to the JavaScript side so pluralization and select-style messages resolve consistently on frontend and backend. That consistency is the main reason teams adopt it inside Symfony projects. It does rely on Symfony's Translator catalogues as the source of truth.
Is symfony/ux-translator 3.6.0 a breaking change from 3.5.x?
By inspection there are no new features, no deprecations, and no documented breaking changes; the changelog is entirely bug fixes and tooling chores. However, fix #4059 fully escapes translation IDs, so output changes for IDs containing quotes, backslashes, or HTML-sensitive characters. Re-baseline any snapshot tests or JavaScript consumers that read the generated catalogue.
Why does symfony/ux-translator conflict with symfony/asset-mapper 8.2 and later?
Issue #3919 adds an explicit upper-bound conflict between the bundle and symfony/asset-mapper 8.2 and later, so the two are mutually incompatible today. Treat it as a version-lock coupling: upgrading AssetMapper elsewhere in your estate can block ux-translator upgrades, or the reverse. Run composer why-not symfony/asset-mapper before committing to any bump.
My translation dumps are empty or landing in the wrong directory, is that a known bug?
Yes. Fixes #4073 and #4067 in 3.6.0 address dump-directory problems and empty translation output. These were silent-failure classes, meaning translations were written empty or to the wrong path without an obvious error. If you are on 3.5.0 or earlier with AssetMapper, assume your artefacts may have been quietly wrong and re-verify them.
Can I use symfony/ux-translator in Laravel with a Twig bridge such as rcrowe/twigbridge?
Not realistically. Even with a Twig bridge, the bundle still depends on its compiler passes and container extensions, which the bridge does not provide. Making it work would mean standing up a Symfony kernel inside your Laravel app purely for translation extraction, which is disproportionate to the value. The realistic adoption unit is a Symfony service or a legacy Symfony component, not a Laravel application.
What should Laravel teams use instead for frontend translations?
Stay on Laravel's native lang/ pipeline with the __() and trans() helpers, paired with community tooling such as laravel-lang packages, barryvdh/laravel-translation-manager, or a Vite-compatible extraction plugin. On the JavaScript side, i18next or vue-i18n cover ICU-style formatting without needing a Symfony runtime. symfony/ux-translator does not compete on that axis and should not be shortlisted for Laravel.
How do I verify translation output before deploying an upgrade?
Run catalogue diffs in a lower environment first, because the escaping fix in #4059 changes output for IDs with quotes, backslashes, or HTML-sensitive characters. Check composer why-not for the AssetMapper conflict before promoting, then compare generated JavaScript catalogues and any snapshot tests. Confirm dumps are non-empty and landing in the expected directory after the upgrade.
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.
robertmarney/lara-hierarchial-collections
simonschaufi/rule-doc-generator
emissaoja/emissaoja
blackbricksoftware/gravityforms-civicrm-form-processor
al-rahabi/fancy-crud
jinas/dhivatar-component
mltstephane/laravel-quality
bernskiold/laravel-talentlms
bernskioldmedia/laravel-form-architect
youbar/easy-crud
c-point-labs/laravel-hostyourai
dbravoan/dbcms-admin-theme-dbcms
dbravoan/dbcms-theme-db-cyber
dbravoan/dbcms-blocks-basic
dbravoan/dbcms-module-content-audit
dbravoan/dbcms-module-ai-assistant
paygate-to/paygate-php
padosoft/askmydocs-connector-base
defstudio/supercharged-carbon
bernskioldmedia/laravel-matomo