This project is archived and is in readonly mode.
i18n fallback doesn't work for localized views
-
Ola Tuvesson
Could someone at least confirm if this is the expected behaviour or not?
-
Josh Kalderimis
- Tag changed from i18n fallbacks views to action_pack, action_view, i18n
- Assigned user set to Josh Kalderimis
- Importance changed from to Low
Hi Ola,
I have spoken to José about this issue and it does seem to be a bug when using I18n Fallbacks.
Thanks for reporting the issue, I will take a look at creating a patch for master this week.
Thanks,
Josh
-
Ola Tuvesson
- Assigned user cleared.
Thanks Josh! I need this as I'm working on a site which is available in both France and Canada, as well as in French language in other countries. So I en up with lots of language-country combinations; fr-FR, fr-CA, fr-CH, fr-UK - I really don't want to have separate help files for all of them!
-
Ola Tuvesson
- Assigned user set to Josh Kalderimis
-
Ola Tuvesson
While waiting for this to be patched, does anyone have any suggestions how I might implement a temporary fix for this? I need to do a new release of my project within the next day or so and this has to include the help pages.
-
Josh Kalderimis
- State changed from new to open
Hey Ola,
Sorry for the delay, http://travis-ci.org is eating up my time. I have one patch I need to attend to first, then this one.
The temp fix could be to check if the file exists and render it if it does, otherwise strip off the country portion. This is a hack and ugly controller code, but it should work.
Thanks,
Josh
-
Ola Tuvesson
Thanks, that makes sense. But I was wondering which method it is I need to override? I've been digging around in the ActionView source, PathResolver and other places but I can't seem to locate the relevant locale based view lookup - though admittedly I'm not very well traveled in the Rails source. Could you drop me a hint?
Cheers,
Ola
-
Ola Tuvesson
For example, putting this in an initializer does not give me the German help view:
module ActionView
class LookupContexmodule Details def locale :de end endend end
-
Ola Tuvesson
Any thoughts on this, anyone?