This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use the new forum.
Home » legacy support » symfony 1.2 » [SOVLED] time_ago_in_words & I18N
[SOVLED] time_ago_in_words & I18N [message #98070] Mon, 26 April 2010 18:32 Go to next message
rehanift  is currently offline rehanift
Messages: 17
Registered: March 2008
Junior Member
I was looking through the DateHelper because I needed to make sure time_ago_in_words() is i18n ready. As I suspected, it is. However when I run the sfI18NExtract task on my application the strings from this helper do not appear in my messages.po file.

Is there a way to easily extract these strings from the helpers into my own .PO file so I can have them translated? Or am I missing something?

TIA

-Rehan

[Updated on: Mon, 26 April 2010 18:58]

Re: time_ago_in_words & I18N [message #98073 is a reply to message #98070 ] Mon, 26 April 2010 18:57 Go to previous message
rehanift  is currently offline rehanift
Messages: 17
Registered: March 2008
Junior Member
Not sure if there is a better solution to this or not, but I wrote a simple grep and sed script to pull out the strings I needed. I have now put them into a custom helper class of my app so that the sfI18NExtract task will pull them out.

grep -E "= '[a-z\ \%]{2}" DateHelper.php | sed 's/\$string\ =\ /__(/' | sed 's/\;/\)\;/' | sed -r 's/\s+//'


and produced this

__('less than 5 seconds');
__('less than 10 seconds');
__('less than 20 seconds');
__('half a minute');
__('less than a minute');
__('%minutes% minutes');
__('about 1 hour');
__('about %hours% hours');
__('%days% days');
__('about 1 month');
__('%months% months');
__('about 1 year');
__('over %years% years');
Previous Topic:using include_javascripts_for_form
Next Topic:How to set data to a custom form?
Goto Forum:
  

powered by FUDforum - copyright ©2001-2004 FUD Forum Bulletin Board Software