开发者

CakePHP: when using Translatable behavior, how to make English as the fallback language?

开发者 https://www.devze.com 2022-12-27 08:20 出处:网络
when a certain entry in a table has no translation, is it possible 开发者_如何学Pythonto display the default/english translation instead? Thanks in advance!I wrote a patch to do this very thing a whil

when a certain entry in a table has no translation, is it possible 开发者_如何学Pythonto display the default/english translation instead? Thanks in advance!


I wrote a patch to do this very thing a while back. It's only been lightly tested, but it's available in my "Scratchpad" project in Codaset. The fact that it's only lightly tested is the reason it's in the Scratchpad project rather than a project of its own.

Unless/until the patch is applied to core, I just copied the file (renaming the behavior Translatable and use it from within my app/models/behaviors/ directory. A README file is also available that discusses the modified behavior.

Let me know if it helps you. Feel free to enter bugs, etc. As I said, it's only lightly tested, so YMMV and, of course, no warranty is given or implied. :-)

0

精彩评论

暂无评论...
验证码 换一张
取 消