Are you kidding me? Far from professional? I believe you didn't understood what John suggested. You don't need to change the helper file but rather to create a pot file.
Here, this might help you: http://book.cakephp.org/view/162/Internationalizing-Your-Application On Fri, May 21, 2010 at 11:07 PM, Abraham Boray <[email protected]>wrote: > Pretty nice solution, but I found it a little far away from > professionalism. > > Isn't there any variant 4 the time helper in french and keep the > english one 4 future purpose ? > > > > On May 21, 8:21 pm, John Andersen <[email protected]> wrote: > > The time helper uses the __() function to translate the time labels, > > should you provide them. > > Look at the time helper code and see which labels are used and then > > provide the corresponding translations in your language. > > > > For example, the time helper method niceShort: > > [code] > > function niceShort($dateString = null, $userOffset = null) { > > 105 $date = $dateString ? $this->fromString($dateString, > > $userOffset) : time(); > > 106 > > 107 $y = $this->isThisYear($date) ? '' : ' Y'; > > 108 > > 109 if ($this->isToday($date)) { > > 110 $ret = sprintf(__('Today, %s',true), date("H:i", $date)); > > 111 } elseif ($this->wasYesterday($date)) { > > 112 $ret = sprintf(__('Yesterday, %s',true), date("H:i", $date)); > > 113 } else { > > 114 $ret = date("M jS{$y}, H:i", $date); > > 115 } > > 116 > > 117 return $this->output($ret); > > [/code] > > > > As you can see in line 110, the time helper uses __() function with > > the text "Today, %s", so you just have to provide the french > > translation for that. > > > > Browse through the code and find all occurrences for your translation. > > Enjoy, > > John > > > > On May 21, 5:11 pm, Abraham Boray <[email protected]> wrote: > > > > > How can I translate or make the time helper in french > > > Actually I'm on a french project(I mean a french language) > > > And I need time helper in french as well to print time in french > > > Intead of 2 weeks, 3 days ago ==> depuis 2 semaines et 3 jours > > > > > Got it guys ? > > > > > Thx in advance ;) > > > > > Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp others > with their CakePHP related questions. > > > > > You received this message because you are subscribed to the Google > Groups "CakePHP" group. > > > To post to this group, send email to [email protected] > > > To unsubscribe from this group, send email to > > > [email protected]<cake-php%[email protected]>For > > > more options, visit this group athttp:// > groups.google.com/group/cake-php?hl=en > > > > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others > with their CakePHP related questions. > > > > You received this message because you are subscribed to the Google Groups > "CakePHP" group. > > To post to this group, send email to [email protected] > > To unsubscribe from this group, send email to > > [email protected]<cake-php%[email protected]>For > > more options, visit this group athttp:// > groups.google.com/group/cake-php?hl=en > > Check out the new CakePHP Questions site http://cakeqs.org and help others > with their CakePHP related questions. > > You received this message because you are subscribed to the Google Groups > "CakePHP" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected]<cake-php%[email protected]>For > more options, visit this group at > http://groups.google.com/group/cake-php?hl=en > Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
