transi-store / symfony-translation-provider
Transi-Store Translation Provider Bridge for Symfony
Package info
github.com/transi-store/symfony-translation-provider
Type:symfony-translation-bridge
pkg:composer/transi-store/symfony-translation-provider
Requires
- php: >=8.4
- symfony/dependency-injection: ^6.4|^7.0|^8.0
- symfony/http-client: ^6.4|^7.0|^8.0
- symfony/http-kernel: ^6.4|^7.0|^8.0
- symfony/mime: ^6.4|^7.0|^8.0
- symfony/translation: ^6.4|^7.0|^8.0
Requires (Dev)
- phpstan/extension-installer: 1.4.x-dev
- phpstan/phpstan: 2.2.x-dev
- phpstan/phpstan-symfony: 2.0.x-dev
- phpunit/phpunit: ^11.0
- symfony/config: ^6.4|^7.0|^8.0
- symfony/phpunit-bridge: ^6.4|^7.0|^8.0
README
Provides Transi-Store integration for Symfony Translation.
Installation
composer require transi-store/translation-provider
DSN example
# .env
TRANSI_STORE_DSN=transi-store://API_KEY@default/ORG_SLUG/PROJECT_SLUG
where:
API_KEYis the API key generated from your Transi-Store organization settingsORG_SLUGis your Transi-Store organization slugPROJECT_SLUGis your Transi-Store project slug
The default host resolves to transi-store.com. You may replace it with a
custom host if you run Transi-Store behind your own domain.
How it works
Each Transi-Store file maps to a Symfony translation domain. The provider
fetches the project metadata (GET /api/orgs/{org}/projects/{project}) to
build this mapping from the filePath declared for each file (e.g.
translations/messages.<lang>.yaml ↔ domain messages).
Translations are exchanged using the XLIFF format.
Supported operations
- read: downloads XLIFF translations per locale and domain.
- write: uploads the catalogue as XLIFF per locale and domain.
- delete: not supported — calling it raises a
RuntimeException.
Configuration (Symfony)
1. Enable the bundle
If you use Symfony Flex, the bundle is enabled automatically. Otherwise,
register it manually in config/bundles.php:
// config/bundles.php return [ // ... TransiStore\TranslationProvider\TransiStoreTranslationProviderBundle::class => ['all' => true], ];
The bundle registers TransiStoreProviderFactory as a service tagged with
translation.provider_factory, so nothing else is needed in services.yaml.
2. Declare the provider
# config/packages/translation.yaml framework: translator: providers: transi_store: dsn: "%env(TRANSI_STORE_DSN)%" locales: ["en", "fr"] domains: ["messages"]
ICU Support
To use ICU message format, make sure your file paths include the +intl-icu, but before the <lang> placeholder, e.g. translations/messages+intl-icu.<lang>.yaml.
But in your domain, you should omit the +intl-icu part, e.g. messages AND you should add the --intl-icu --force option to the command.
If you don't, then Symfony will not suffix the file with +intl-icu.