Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.6k
[RFC] Factor loading and caching out of Translator#14622
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
I'm not sure if we need |
@aitboudad Yes, I am not sure yet how we need to design those interfaces. Let's see what we're aiming at: The long-term goal is to get a better encapsulation of There are, however,use cases where clients need to access the full set of messages. Currently they can get those from So it would be helpful if the That would also simplify If the fallback locales were moved to the So why do I currently need another interface? Inside This naturally led to a decorator-based approach for the Providers. But the cache has at least to be aware of the resources used to correctly separate cached data. Thus, we need Does that make sense? In what direction should we proceed from here? |
nicolas-grekas commentedFeb 14, 2017 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
I think we don't need this one: optimized caching is already dealt with on PHP7, where static arrays and static strings are far superior optimization strategies. Thus, no need to do anything more on our side to me. |
Closing for the reason given above (and lack of contra-arguments :) ) |
See#14530 for a discussion what this PR tries to achieve.
This is WIP, so for the time being please comment on the general approach and not on CS glitches.
Todo:
Translator
into the newDefaultProvider
? That way the Providers would resemble (or could even implement)TranslatorBagInterface
.protected
methods appropriatelyassertValidLocale
calls are put in a few but "strategically right" places to prevent fixed problems from re-appearing (also when possibly using new components in isolation).