Tags
Recent Comments
Elsewhere
Read: "I think saying no is far too often misunderstood and misrepresented. I think it automatically puts..." http://t.co/CTbzPLqX
Bookmarked 19 links
CurdBee - Online billing for small businesses and freelancers.
CurdBee - Online billing for small businesses and freelancers.
UNISON™ - fully-unified communications software
Snipshot: Edit pictures online
Visual and Audio PHP CAPTCHA Generation Class - Ed Eliot
Proto.Menu :: prototype based context menu
Proto.Menu :: prototype based context menu
Website Marketing SEO Score Tool
Sync & Backup Files to the Cloud - Access Online with Any Device ...
Snipshot: Edit pictures online
Visual and Audio PHP CAPTCHA Generation Class - Ed Eliot
UNISON™ - fully-unified communications software
Read: Top 20 Most-Shared Video Ads This Month http://bit.ly/j2oJbS
Links


!["Empire State of Mind" Jay-Z | Alicia Keys [OFFICIAL VIDEO]](http://i.ytimg.com/vi/0UjsXo9l6I8/default.jpg)




Extracting PO file with CakePHP I18n Shell
I have always been religiously wrapping
__()and__n()around my texts knowing that it needs to be localized some day. Then it got to me that I never knew how to actually localize it! Out of curiosity, I went ahead to extract the PO file using the I18n shell.What it does is basically look through your entire app folder for files and within each file extract all instances of
__()and gang, then grab the tokens necessarily for building the PO file. Now, this is where it gets picky.// error! invalid marker content! __('Delete post #' . $id); __n('comment', 'comments', $array[0]); __n('comment', 'comments', $object->noOfComments()); __n('comment', 'comments', (int) $noOfComments); // valid! it makes it easier to translate anyways sprintf(__('Delete post #%d', true), $id); // just $var will work, nothing funky sprintf(__n('%d comment', '%d comments', $noOfComments, true), $noOfComments);So if you are thinking of using the I18n shell, you should take note that the text to be translated should really be one single token. Also, the generated file has an extension of .pot but it should really be renamed to .po instead since Cake expects .po files in the locale folder.