Skip to content
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

Find solution for missing $resource in Translation\DatabaseLoader.php #6

Open
3 tasks
maschmann opened this issue Jan 3, 2014 · 0 comments
Open
3 tasks

Comments

@maschmann
Copy link
Owner

The MessageCatalogue in DatabaseLoader still has no $resource set when created. So the caching will not be triggered to refresh the translations cachefile.
Since this is complete file-based at the moment (symfony-wise), the resource is a file resource and sf watches for changes in timestamp.
A few thoughts:

  • Since dumping the database content is acceptably fast, we might want to refresh the translations at specific time intervals? But what happens if people use files AND database (vendor translations...)?
  • If history is completed, we could dump as soon as there's a change in the history table. Therefore we'd need a new type of resource object.
  • Completely ignore? In my specific case here, we're deploying symfony and every time there's a complete cache build, so all translations are dumped.

Resolution:

  • Implement new resource class "DatabaseResource"
  • Add resource factory service(?) or possibly use existing one
  • save updated-date from latest database entry as resource "filetime" and compare to latest entry on next call

This should keep translation MessageCatalogue in cache as consistent and current as the file-based checks.

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

No branches or pull requests

1 participant