Locale module's string translation is a powerful old style API which got bloated through the years with several special cases and new features. There are very specific workarounds in the installer and some hacks to support fixed runtime string overrides. By unifying this system under one API and using that across all systems, we can remove the boundaries between the installer and the runtime and make the translation system properly pluggable.
The current system has various inter-dependencies and is hard to debug, seefor example.
Introduce a TranslationInterface that is implemented by both simpler string / file based lookups as well as the "regular" Locale module database lookup. Implement a TranslationFallback wrapper to combine these lookups in order of preferred lookup so fallback between different methods is possible. Finally, use the dependency injection container to define which methods of lookup are to be used. The installer would use the file based lookup, while fully bootstrapped runtime would use the LocaleTranslation lookup (with fallbacks).
This makes it possible to remove st(), get_t() and $t (in a followup atto not clutter this issue up) in addition to all the API cleanup and generalization benefits.
|PASSED: [[SimpleTest]]: [MySQL] 56,316 pass(es).|
|PASSED: [[SimpleTest]]: [MySQL] 55,412 pass(es).|
|PASSED: [[SimpleTest]]: [MySQL] 55,845 pass(es).|