Prev | Current Page 349 | Next

Rob Allen, Nick Lo, and Steven Brown

"Zend Framework in Action"


Listing 14.12: Top part of the non-localized index.phtml

escape($this->title);?>


Welcome to Places to take the kids! This site will
help you to plan a good day out for you and your children. Every
place featured on this site has been reviewed by people like you,
so you'll be able to make informed decisions with no marketing
waffle!


Licensed to Menshu You
Zend Framework in Action (Ch01) Manning Publications Co. 45

Recent reviews


As you can see, with the exception of the title, all the text in the view template is hard coded directly and
so we have to change this as shown in listing 14.13.
Listing 14.13: Localized version of index.phtml

escape($this->title);?>


_('welcome-text'); ?>

1

_('Recent reviews'); ?>


1 use a simple key for the long text
With the localized template, every string is passed through the _() view helper. For the very long body of
text, we have simplified to a simple key (#1) in order to make the template easier to understand and the
language file simpler. The language files for English and German are shown in Listing 14.14.
Listing 14.14: English translation file, en.php
$translationStrings = array(
'welcome'=>'Welcome to Places to take the kids! This site will help you to plan a good
day out for you and your children.


Pages:
337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361
kierunki studiów Okna PCV Wrocław zakłady bukmacherskie pustaki szklane stolarka aluminiowa częstochowa