CakePHP: When using Translitable behavior, how do I make English as a fallback language?

when some record in the table has no translation, is it possible to display the default / english translation instead? Thanks in advance!

+2


a source to share


1 answer


I wrote a patch to do this very recently. It has only been lightly tested but is available in my "Scratchpad" project in Codaset. The fact that it is only lightly tested is the reason for this in the Scratchpad project and not in its own project.

If / until the patch is applied to the kernel, I just copied the file (renamed the behavior Translatable

and used it from my directory app/models/behaviors/

. README , which discusses the changed behavior.



Let me know if this helps you. Feel free to introduce bugs, etc. As I said, it's only lightly tested, so YMMV and of course no guarantees are implied. :-)

0


a source







All Articles