chameleon-system-private/translation-tools-bundle

Provides a set of tools that help you work with translations in chameleon

8.47.1 2025-12-15 13:55 UTC

README

Description

The Bundle provides a set of tools to translate text and work with / on translations.

Installation / configuration

  • Execute composer require chameleon-system/translation-tools-bundle
  • Copy the content from the config.yml.dist into your app/config/config.yml
  • Make sure to provide the DEEPL_API_KEY env variable containing your DeepL api key
  • Optionally if you don't want to configure the API key via. env you can also create a table called deepl_api_key that has a column called api_key. The API key from the database overwrites the env. It doesn't matter if you have only one or both configs, it only matters that you have one.
  • Execute the database updates

Export Database Translations as XLIFF

You can export database translations using the console command chameleon_system:translation_tools:export_translations.

The command will generate an XLIFF file for every table with translatable fields in every language defined for the system.

Output

Translation files are written into cmsdata/xliff (please make sure the folder exists).

Testing

Since translations via deepl are expensive, you can use the mock lorem ipsum translator service (chameleon_system_translation_tools.mock_translator_lorem_ipsum) to test your code.