Friday, October 31, 2008

AW: Translation and placeholders

Found something for my porblem.

Seems the good old sprintf ist still the solutionfro general strings:
E.g.
sprintf(__('Wollen Sie # %s wirklich löschen?', true), $ort['id'])

Anja

-----Ursprüngliche Nachricht-----
Von: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] Im Auftrag von Liebermann, Anja Carolin
Gesendet: Freitag, 31. Oktober 2008 11:48
An: cake-php@googlegroups.com
Betreff: Translation and placeholders


Hi everybody,

I need a hint how I get my variables into a translateed string.

E.g. (you surely know that one *g*)
'Page %page% of %pages%, showing %current% records out of %count% total, starting on record %start%, ending on %end%'

Where do %page% etc come from?

I have several strings like that:
$this->Session->setFlash(__('This image %name% already exists.', true));

So how can I get my variable in this string?

Thanks a lot in advance!

Anja

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

No comments: