As a company located in Belgium, Kunstmaan is always asked to build multilingual websites. Dutch, French are a given, and often several other language as well. We didn't find any solution able to reliably cope with these multilangual needs, and that's the main reason we started with the Kunstmaan Bundles project. To this date, it is still the only implementation that can handle those needs.
Until now, all database related content was easily manageable in the admin interface, but minor translations like words, taglines, formlabels, error messages, ... were administered in the native Symfony2 translation files in GIT. Of course, that's not really client friendly. While there are some projects to provide interfaces on top of these files, they edit these files and these changes did not transfer well to our GIT repo's.
This is why we created the KunstmaanTranslatorBundle, a bundle which enables editing translations in the admin interface without need for editing the translations files. Translations will be stored in a (default) database and retrieved on the most efficient way possible.
- Import bundle/global translations from any type of translation file
- Import only specific translations (only from console command)
- Force import to overwrite existing translations with same domain/keyword/locale
- Edit stored translations from the backend interface
- Add new translations from the backend interface
- Translations are cached (if debug is disabled)
- Warning when cached translations aren't up to date with the stored translations
- Clear translation cache to rebuild translations from the stored translations
- Newer or updated translations are flagged
- Create a Doctrine Migrations file with all flagged translations
- Reset all flagged translations (from console command)
- Clear and check translation cache from console command
- Check your page with the keyword and domain of all translations
The Symfony2 Profiler shows the number of translations used on the current request:
When you click on this item, you can see all translations used on the current request, so you can easily edit them in the Kunstmaan Admin backend.
This makes it easy to find the keys in a dev environment, but if you need to find this information in a production environment, you can add an extra GET parameter to your request. Add ?transSource=1 to your url to see all sources of the translated labels.
- keyword is header.hello_world
- domain is messages
- Add translations (with keywords) in your template files (dev)
- Add the translations of (1) into your backend via "Add Translation" (dev)
- Repeat 1 & 2
- Create migrations diff app/console kuma:translator:migrations:diff (dev)
- Reset translation flags app/console kuma:translator:flag --reset (dev)
- Deploy your application
- Execute doctrine migrations app/console doctrine:migrations:migrate (prod)
- Edit/add translations (prod)
- When ready editing/adding, click Refresh live or app/console kuma:translator:cache --flush (prod)
- Repeat 7 & 8 when editing/adding translations in prod
- Import current translations, click Import -> Import or app/console kuma:translator:import (prod/dev)
- If you did 1 in dev, go to 4 of "Workflow example (new project)", otherwise go to 7 "Workflow example (new project)"
For installation and configuration details check out the documentation on GitHub, and if you like it, please recommend this bundle on KnpBundles.