vardumper / ibexa-theme-translations-bundle
Ibexa DXP bundle for managing theme translations with tiered caching (static PHP arrays + Redis + Database)
Package info
github.com/vardumper/IbexaThemeTranslationsBundle
Type:symfony-bundle
pkg:composer/vardumper/ibexa-theme-translations-bundle
Requires
- php: ^8.2
- doctrine/doctrine-bundle: ^2.7.2
- doctrine/orm: ^2.11|^3.0
- guzzlehttp/promises: ^2.3
- ibexa/admin-ui: ^4.4|^5.0.5
- ibexa/core: ^4.4|^5.0.5
- league/csv: ^9.28
- nyholm/psr7: ^1.8.2
- pagerfanta/pagerfanta: ^2.0|^3.8|^4.0
- symfony/cache: ^5.4|^6.0|^7.0|^8.0
- symfony/console: ^5.4|^6.0|^7.0|^8.0
- symfony/form: ^5.4|^6.0|^7.0|^8.0
- symfony/framework-bundle: ^5.4|^6.0|^7.0|^8.0
- symfony/validator: ^5.4|^6.0|^7.3.11|^8.0
- twig/twig: ^3.23
Requires (Dev)
- brainmaestro/composer-git-hooks: dev-master
- doctrine/doctrine-fixtures-bundle: ^3.5|^4.3.1
- friendsofphp/php-cs-fixer: ^3.94.2
- guzzlehttp/guzzle: ^7.10
- ibexa/automated-translation: ^4.4|^5.0.5
- pestphp/pest: >=4.4.1
- phpmd/phpmd: ^2.15
- phpstan/phpstan: ^2.1.40
- rector/swiss-knife: ^2.3.5
- symplify/easy-coding-standard: ^13.0.4
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
|
|
IbexaThemeTranslationsBundle
This is a bundle for Ibexa DXP. It allows managing string translations for use in themes outside Ibexa's regular content object and translation logic. While there are a couple of i18n concepts pre-included with Ibexa, they lack a user interface. So here's a simple Doctrine ORM based approach with a UI, string search, Deepl integration, and very basic approval flow for translation editors.
Requirements
- Ibexa DXP >= v5.0
- Ibexa DXP >= v4.4
- Ibexa Automated Translations installed, activated and configured ibexa/automated-translation if you want to use Deepl Translations
Features
- Supports Deepl Free API Key - by replacing the Ibexas' default Deepl Client
- 3-layered caching: OPCache via static PHP Array and Redis if available
- Event Listeners warm caches when there are changes
- Brings a console command for cache warming
- Supports headless frontends by providing JSON and Typescript language files
- Allows importing/exporting translations to and from CSV
- Supports Doctrine Fixtures to pre-popultae translations.
- Supports Ibexa DXP v5.0+ and v4.4+
Installation
1. Point Symfony Flex at this bundle's recipe (once per project)
This bundle is proprietary and requires Ibexa DXP, so its Flex recipe is not part of the public recipe index — it is hosted in this repository:
composer config extra.symfony.endpoint https://raw.githubusercontent.com/vardumper/IbexaThemeTranslationsBundle/main/flex/index.json
2. Install the bundle
composer require vardumper/ibexa-theme-translations-bundle
The bundle, its configuration, routes, and migrations are registered automatically.
3. Run Migrations
bin/console doctrine:migrations:migrate
Manual installation (without Symfony Flex)
Register the bundle in your config/bundles.php:
return [ // ... vardumper\IbexaThemeTranslationsBundle\IbexaThemeTranslationsBundle::class => ['all' => true], ];
Register Entities
# config/packages/ibexa_theme_translations.yaml doctrine: orm: mappings: IbexaThemeTranslationsBundle: type: attribute is_bundle: false dir: '%kernel.project_dir%/vendor/vardumper/ibexa-theme-translations-bundle/src/Entity' prefix: 'vardumper\IbexaThemeTranslationsBundle\Entity' alias: IbexaThemeTranslations
Register Routes
# config/routes/ibexa_theme_translations.yaml ibexa_theme_translations: resource: '@IbexaThemeTranslationsBundle/config/routes.yaml'
Copy Migrations
Copy the migration files from the bundle into your app's migrations/ directory:
cp vendor/vardumper/ibexa-theme-translations-bundle/flex/recipe/migrations/*.php migrations/
Run Migrations
bin/console doctrine:migrations:migrate
Run Tests
This library is fully unit tested with PEST. You can run the tests by executing the following commands in the root directory of the project.
Unit Tests
vendor/bin/pest
Coverage Report
You can also generate a coverage report by running the following command.
XDEBUG_MODE=coverage vendor/bin/pest --coverage-html=coverage-report