Skip to content

Clear the translations cache after editing with Edit In Place #71

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 16, 2017

Conversation

damienalexandre
Copy link
Contributor

This is a proposal for cache clearing after translation editing. As the Edit In Place functionality is supposed to be used "live", it was looking "broken" because even if a translation is edited correctly, Symfony still display the old messages until the cache is cleared.

I can't think of any better solution but I do not like this very much, editing the cache directory seems like a hack... 😕

II tried another approach: doing a touch() on the translation files and calling the warmer, but Symfony Cache implementation for translations don't have any resourceCheckers so it can't work. We have to remove the file for them to be rewritten.

About the name('*.'.$locale.'.*') pattern, I checked and it's compatible with Symfony 2.7 and more.

Ref #63

Copy link
Member

@Nyholm Nyholm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.
One could improve this further by only remove the correct domain.

I do not know any other way of doing this. We should, however, write a warning about this in the docs.

@Nyholm
Copy link
Member

Nyholm commented Jan 16, 2017

@damienalexandre, merge if you are happy with it =)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants