8000 [DX] Detect translation file name changes in development · Issue #11530 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content
8000

[DX] Detect translation file name changes in development #11530

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

Closed
wouterj opened this issue Jul 31, 2014 · 0 comments
Closed

[DX] Detect translation file name changes in development #11530

wouterj opened this issue Jul 31, 2014 · 0 comments
Labels
DX DX = Developer eXperience (anything that improves the experience of using Symfony)

Comments

@wouterj
Copy link
Member
wouterj commented Jul 31, 2014

The problem

When debug is enabled, you don't have to worry about the cache. If you change a file related to the cache, the cache is simply rebuild. However, there is one exception on this: Translation files.

  • When you add a new translation file, it is not automatically detected by the Translation caching system.
  • When you rename a translation file, it is not automatically detected

This means you have to clear the cache each time you do one of these actions. That's an action you simply forget to do, since it's not needed for any other cache system used by Symfony.

The Solution

Simply check if there are new translation files in the application on each request when debug is enabled. (we may want to create a new configuration setting to check for it, which is enabled by default in the SE)

@fabpot fabpot added the Hackday label Sep 5, 2014
fabpot added a commit that referenced this issue Feb 5, 2015
… (iamluc)

This PR was merged into the 2.7 branch.

Discussion
----------

[Translation] Refresh catalogues when resources change

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #11530
| License       | MIT
| Doc PR        | no

When a translation file is added in a bundle, the container is refreshed thanks to a DirectoryResource watching for changes.
But the translator has his own cache that is not refreshed.

This PR adds a hash check when cached is used.

Commits
-------

1113999 Refresh catalogues when resources change
@fabpot fabpot closed this as completed Feb 5, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DX DX = Developer eXperience (anything that improves the experience of using Symfony)
Projects
None yet
Development

No branches or pull requests

3 participants
0