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

Mention cache in translation page #342

Closed
pdugas opened this issue May 29, 2011 · 6 comments
Closed

Mention cache in translation page #342

pdugas opened this issue May 29, 2011 · 6 comments

Comments

@pdugas
Copy link

pdugas commented May 29, 2011

I got bit by this so I thought I'd mention it. I added FOW\UserBundle to my app after I'd been working on other pieces. I found the strings on FOSUB's stock login page and others were not being translated. I found I needed to add the config entry to enable translation but that didn't fix the issue. I needed to clear my cache before the change was applied. Perhaps a little blurb suggesting "cache:clear" next to the instructions for adding the config entry is in order?

@weaverryan
Copy link
Member

Hi Paul-

I'm not sure about this quite yet. When you add the translator configuration entry, the configuration should automatically reload in the dev environment. I've just tried this and verified that it behaves that way (of course, you will need to clear the cache for the prod environment). However, I swear that I've done this before and seen the behavior your described. Can you repeat this issue, or shed more light on what part confused you? I do want to be as clear as possible.

Thanks!

@stof
Copy link
Member

stof commented May 29, 2011

@weaverryan The issue is when you add a translation file. In this case, the kernel does not know that the cache needs to be refreshed as this file is not in the list of watched resources yet.

@pdugas
Copy link
Author

pdugas commented May 29, 2011

I just tried to recreate it but wasn't able to. I pulled a copy of sf2_std, added FOSUB, then pointed a browser to /login and got the untranslated strings. I added framework.translator.fallback to my config, hit /login again, and got the translated strings. Weird.

I didn't add any of my own translation files but perhaps adding FOSUB and the translations it includes triggers the situation @stof described. Not sure.

I'll let you close this issue if you like since I'm not sure what else I may have done to trigger the situation I was in. I've been tinkering with all kinds of things in this project lately so I'm not sure how to reproduce it.

@weaverryan
Copy link
Member

Well, it would cause problems, as @stof mentioned, if you already had the translator enabled, but then brought in a new bundle (like the UserBundle) that included new translation files. That's actually exactly what I experienced before.

What do you think about this? deccf86

@pdugas
Copy link
Author

pdugas commented May 29, 2011

That would have saved me some time :)

Thanks.

@pdugas pdugas closed this as completed May 29, 2011
@weaverryan
Copy link
Member

Beautiful, that's the goal :)

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

No branches or pull requests

3 participants