Skip to content

Symfony, CodeIgniter and Yii ​

The three packages are built the same way: the translation memory in your database through Doctrine DBAL, the translator in the container, a command that creates the tables and one that translates the language files with sync. What a person changed in a written file is kept; only what is missing is translated. Laravel has its own package, on Eloquent.

SymfonyCodeIgniter 4Yii 3
Packagesymfony-icu-i18n-translatorcodeigniter-icu-i18n-translatoryii-icu-i18n-translator
Registered bythe bundle, in config/bundles.phpCodeIgniter's module discoveryyiisoft/config
Databasea DBAL connection of DoctrineBundlea group of app/Config/Database.php, or a DBAL URLa DBAL URL, else SQLite in @runtime
Filestranslations/*+intl-icu.{locale}.yaml and .xlfapp/Language/{locale}/*.phpmessages/{locale}/*.php
Languagesicu_i18n.localesApp::$supportedLocaleslocales of the params
Providersservices tagged icu_i18n.providerIcuI18n::providers()providers of the params
Tablesbin/console icu-i18n:installphp spark icu-i18n:install./yii icu-i18n:install
Translate the filesbin/console icu-i18n:syncphp spark icu-i18n:sync./yii icu-i18n:sync

Each command takes --source, --locale, --dry-run (which files would be written) and --show-machine (which keys a provider translated, to review them); install --dump-sql prints the statements for a migration of yours.

The files of each framework hold ICU messages already — Symfony's +intl-icu catalogs, CodeIgniter's lang(), Yii's IntlMessageFormatter — so the framework reads the written files as they are.