Tags
Recent Comments
Elsewhere
Lousy day n now I am stuck in the car where I can't reverse and the car in front is freaking near.
Original French toast? (@@ octa hotel cafe @@ parco millenia walk) http://4sq.com/aigDMr
No work! Resisting the urge to check my mails. ~~~ (@@ Aerin's @@ Raffles City) http://4sq.com/aGpTYp
Still the best ra-men IMO (@@ Marutama Ramen @@ Liang Court w/ @berilyn) http://4sq.com/58Yssg
Read: LINK: Managing Conflict http://bit.ly/aVrjIG
Bookmarked a link: Sync & Backup Files to the Cloud - Access Online with Any Device ...
RT @jerictan: 陳傑瑞 《我不相信》MV 首播網路版 - 《荒島愛》 電影主題曲 http://fb.me/z5Vo4y8L
I'm at Coffee Club (Holland Village, 48A Lorong Mambong, Singapore). http://4sq.com/8NF3Am
OK girls, it's actually a contest but first 50 entries get S$80 cash! :p I will vote for you! http://bit.ly/c3q8LQ @evonnz @Yee_Ann @Rejinaa
Anyone keen on Free hair colour, treatment and styling?
Links
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.