Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Add getCacheId method to Translator #63

Conversation

mlocati
Copy link
Contributor

@mlocati mlocati commented Jan 30, 2017

What about adding a getCacheId method to get the ID of the cache item?

That would be useful when subclassing Translator (for instance, we'd need a cache ID that depends on the contents of the $files, $patterns and $remote properties).

@weierophinney
Copy link
Member

I'm afraid I don't understand the use case: what would this enable, exactly? You mention it would be useful for subclasses of Translator, but now how...

@MatthiasKuehneEllerhold
Copy link
Contributor

We have translation that are changing during the run time of our app and we need to invalidate the translation-cache to trigger a reload of the underlying translation providers.

Therefor I'd like to propose adding this function and marking it public.

Better yet: a function that clears the cache of a specific text domain / language.

@MatthiasKuehneEllerhold
Copy link
Contributor

I'm not sure if @mlocati is active on gh anymore that's why I've added a PR with my proposal based upon his PR.
Sorry if I'm stealing your thunder!

@mlocati
Copy link
Contributor Author

mlocati commented Apr 27, 2018

I'm afraid I don't understand the use case: what would this enable, exactly? You mention it would be useful for subclasses of Translator, but now how...

@weierophinney I absolutely can't remember why we needed this (there has been a lot of water under the bridge...), but I guess we needed something like @MatthiasKuehneEllerhold wrote above (and we solved in another way because of lack of activity of ZF).

I'm not sure if @mlocati is active on gh anymore

@MatthiasKuehneEllerhold Sure: loot at how green is my GitHub wall 😉

that's why I've added a PR with my proposal based upon his PR. Sorry if I'm stealing your thunder!

No problems at all! I'm closing this #63 in flavor of #93.

@mlocati mlocati closed this Apr 27, 2018
@mlocati mlocati deleted the add-getCacheId-method-to-translator branch April 27, 2018 11:57
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants