#4886: [RFC] TranslateBehavior fallback locale --------------------------+------------------------------------------------- Reporter: biesbjerg | Owner: Type: RFC | Status: new Priority: Medium | Milestone: 1.3.x.x Component: Behaviors | Version: Severity: Normal | Resolution: Keywords: translate | Php_version: n/a Cake_version: | --------------------------+------------------------------------------------- Comment (by robwilkerson):
Apologies for the long delay after saying I was working on this, but I've finally had a chance to create (and attach) the patch. Here are the highlights: * Modified the SQL so that the i18n conditions are not applied to the entire recordset, but only to the appropriate outer join. This allows records without a corresponding i18n record to be retrieved (with a NULL i18n value). * The "real" field value is simply changed to the i18n value if an i18n record exists for that field. Caveats: * There is one condition that keys on the locale being an array. I have no idea how to recreate that scenario, so I couldn't unit test it. The code looks like what I would expect (in fact, it looks like the change I made to the string locale code), but it's completely untested. * I'm not an i18n expert. This patch did what I expected it to do and what I expected it to do seems right to me, but YMMV pending review by the core team. Hopefully this will help someone else in the short term. -- Ticket URL: <https://trac.cakephp.org/ticket/4886#comment:4> CakePHP : The Rapid Development Framework for PHP <https://trac.cakephp.org/> Cake is a rapid development framework for PHP which uses commonly known design patterns like ActiveRecord, Association Data Mapping, Front Controller and MVC. Our primary goal is to provide a structured framework that enables PHP users at all levels to rapidly develop robust web applications, without any loss to flexibility. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "tickets cakephp" group. To post to this group, send email to tickets-cakephp@googlegroups.com To unsubscribe from this group, send email to tickets-cakephp+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/tickets-cakephp?hl=en -~----------~----~----~----~------~----~------~--~---