symfony/symfony — pull request #2570 by pulzarraider (2011-11-05 22:14:19+00:00)
Title: [Translation] [FrameworkBundle] Translation: Optimised loading of domains

Bug fix: no
Feature addition: yes
Backwards compatibility break: no
Symfony2 tests pass: yes (tests updated)
Fixes the following tickets: -

Website can have hundreds messages in each domain. Some domains (and their translations) will not be used during different requests (for example "admin" domain will not be used on public pages, "validation" domain will not be used until validating some entities/processing forms). This PR changes the way how messages are cached. Instead of storing all domains in one file (catalogue.en.php), domains are saved separately (/en/messages.php, /en/validators.php, etc.) and they are processing and loaded into memory only when they are required (to translate some text). This will optimise memory consumption.