Let’s take over the world                                   with Zend Framework                                         Ma...
Introduction                                     2Monday, 23 May 2011
Introduction         Martin de Keijzer         Software engineer at Ibuildings         Board member of PHPBenelux         ...
DISCLAIMER            DISCLAIMER: ALL EXAMPLE CODE           IS WRITTEN IN THE CONTROLLER BY               EXAMPLE! USE MO...
Monday, 23 May 2011
The case                      What do we need to take over the                                  world?                    ...
The case            ✓Location (Country and region)            ✓Language            ✓Date and time            ✓Currency    ...
“Location! Location! Location!”                                  Quote from Achmed (2009)                                 ...
Zend LocaleMonday, 23 May 2011
Zend Locale             A locale defines a country (territory) and a language to                   bind the various locali...
Zend Locale              nl_NL              de_BE              fr_BE              nl_BE                       11Monday, 23...
Zend Locale                              CLDR                  Common Locale Data Repository                     http://cl...
Zend Locale                       13Monday, 23 May 2011
Zend Locale        The current locale is is: nl       The browsers locale is is: nl       The environments locale is is: d...
Zend Locale                       15Monday, 23 May 2011
Zend Locale                       16Monday, 23 May 2011
Zend Locale                       In FR people speak fr                                               17Monday, 23 May 2011
Zend Locale                  In FR people speak fr.                  In France people speak French.                       ...
Zend Locale                       19Monday, 23 May 2011
Zend Locale                       20Monday, 23 May 2011
Zend Locale          array(6) {           ["yes"]=>           string(2) "ja"           ["no"]=>           string(3) "nee" ...
Zend Locale                ["yesarray"]=>                array(2) {                  [0]=>string(2)   "ja"                ...
Zend Locale          ["yesexpr"]=>           string(20) "^([jJ][aA]?)|([jJ]?)"           ["noexpr"]=>           string(26)...
Zend Locale                      A list of supported locales:            http://framework.zend.com/manual/                ...
Zend Locale         Utilized by:         Zend_Controller_Router         Zend_Currency         Zend_Date         Zend_Filte...
Speaking the language                      Zend_Translate                                              26Monday, 23 May 2011
Zend Translate         Operates using adapters:              Array              Csv              Gettext              Tbx ...
Zend Translate                          28Monday, 23 May 2011
Zend Translate                          29Monday, 23 May 2011
Zend Translate                          nl.php                          fr.php                                   30Monday,...
Zend Translate                          my-view.phtml                                          31Monday, 23 May 2011
Zend Locale                       32Monday, 23 May 2011
Zend Locale                           Quick hint: Google uses locales too!                      Zend Framework is your gat...
Monday, 23 May 2011
Do not get lost in time                      Zend_Date                                                35Monday, 23 May 2011
Zend Date                      The date is May 2, 2011 9:13:41 PM.                       The date is 2 mei 2011 21:13:41. ...
Zend Timesync                      2 mai 2011 21:25:09                                            37Monday, 23 May 2011
Zend_Locale revisited                 You can use Zend_Locale_Format to override                         date and number f...
Show me the money!                      Zend_Currency                                           39Monday, 23 May 2011
Zend Currency                         40Monday, 23 May 2011
Zend Currency               In the Netherlands you pay with Euro (€).               And in the UK you pay with British Pou...
Zend Currency                         42Monday, 23 May 2011
Zend Currency                      Please hand me 10.00                      US Dollar for food and                       ...
Zend Currency                      Got lost in locales?                        getCurrencyList()                         g...
Never trust a user!                      Zend_Validate                                            45Monday, 23 May 2011
Zend Validate                         46Monday, 23 May 2011
Zend Validate                         47Monday, 23 May 2011
Measures please?                      Zend_Measure                                         48Monday, 23 May 2011
Zend Measure                        49Monday, 23 May 2011
Zend Measure            A Big Mac’s weight is 200,05 g in the Netherlands.                          In the USA this would ...
Zend Measure                      Zend_Measure doesn’t utilize locales to give you                       the correct units...
Conclusion                      52Monday, 23 May 2011
Image sources         Achmed http://barenakedislam.wordpress.com/2011/01/27/sweden-muslim-offended-by-ahmed-the-dead-terro...
Questions ?                                    54Monday, 23 May 2011
Thank you!                                         Contact details:                                    Twitter: @Martin198...
Upcoming SlideShare
Loading in...5
×

Let's take over the world with Zend Framework

2,820

Published on

Many people use Zend Framework for it's MVC implementation, but it has a lot of hidden gems. Internationalization (i18n) is one of them. We will look how you can create an application that will have the right languages, currencies, dates and times all based on the location of the visiting user. This session will take away a lot of headaches in international projects and will improve the quality in overall.

Published in: Technology
1 Comment
5 Likes
Statistics
Notes
  • This common rationalization of county/language is kind of useless for the apps which allows inhabitants of any country to speak whatever language, for example a Swedish speaking Norwegian.

    Thereby, 'In France people speak French' (slide 18) is false if you'd like to display Swedish content in Norwegian instead of serving the pure Norwegian content.
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
No Downloads
Views
Total Views
2,820
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
49
Comments
1
Likes
5
Embeds 0
No embeds

No notes for slide

Let's take over the world with Zend Framework

  1. 1. Let’s take over the world with Zend Framework Martin de Keijzer Dutch PHP Conference 2011Monday, 23 May 2011
  2. 2. Introduction 2Monday, 23 May 2011
  3. 3. Introduction Martin de Keijzer Software engineer at Ibuildings Board member of PHPBenelux PHP 5 Zend Certified Engineer Twitter: Martin1982 Joind.in: http://joind.in/3253 Blog: www.martindekeijzer.nl 3Monday, 23 May 2011
  4. 4. DISCLAIMER DISCLAIMER: ALL EXAMPLE CODE IS WRITTEN IN THE CONTROLLER BY EXAMPLE! USE MODELS!!!! 4Monday, 23 May 2011
  5. 5. Monday, 23 May 2011
  6. 6. The case What do we need to take over the world? 6Monday, 23 May 2011
  7. 7. The case ✓Location (Country and region) ✓Language ✓Date and time ✓Currency ✓Measuring 7Monday, 23 May 2011
  8. 8. “Location! Location! Location!” Quote from Achmed (2009) 8Monday, 23 May 2011
  9. 9. Zend LocaleMonday, 23 May 2011
  10. 10. Zend Locale A locale defines a country (territory) and a language to bind the various localized information to it. 10Monday, 23 May 2011
  11. 11. Zend Locale nl_NL de_BE fr_BE nl_BE 11Monday, 23 May 2011
  12. 12. Zend Locale CLDR Common Locale Data Repository http://cldr.unicode.org 12Monday, 23 May 2011
  13. 13. Zend Locale 13Monday, 23 May 2011
  14. 14. Zend Locale The current locale is is: nl The browsers locale is is: nl The environments locale is is: de_DE The set locale is is: en_US 14Monday, 23 May 2011
  15. 15. Zend Locale 15Monday, 23 May 2011
  16. 16. Zend Locale 16Monday, 23 May 2011
  17. 17. Zend Locale In FR people speak fr 17Monday, 23 May 2011
  18. 18. Zend Locale In FR people speak fr. In France people speak French. 18Monday, 23 May 2011
  19. 19. Zend Locale 19Monday, 23 May 2011
  20. 20. Zend Locale 20Monday, 23 May 2011
  21. 21. Zend Locale array(6) { ["yes"]=> string(2) "ja" ["no"]=> string(3) "nee" } 21Monday, 23 May 2011
  22. 22. Zend Locale ["yesarray"]=> array(2) { [0]=>string(2) "ja" [1]=>string(1) "j" } ["noarray"]=> array(2) { [0]=>string(3) "nee" [1]=>string(1) "n" } 22Monday, 23 May 2011
  23. 23. Zend Locale ["yesexpr"]=> string(20) "^([jJ][aA]?)|([jJ]?)" ["noexpr"]=> string(26) "^([nN]([eE][eE])?)| ([nN]?)" 23Monday, 23 May 2011
  24. 24. Zend Locale A list of supported locales: http://framework.zend.com/manual/ en/zend.locale.appendix.html 24Monday, 23 May 2011
  25. 25. Zend Locale Utilized by: Zend_Controller_Router Zend_Currency Zend_Date Zend_Filter Zend_Measure Zend_Service_Technorati Zend_Timesync Zend_Translate Zend_Validate 25Monday, 23 May 2011
  26. 26. Speaking the language Zend_Translate 26Monday, 23 May 2011
  27. 27. Zend Translate Operates using adapters: Array Csv Gettext Tbx Tmx Qt Xliff Xmltm 27Monday, 23 May 2011
  28. 28. Zend Translate 28Monday, 23 May 2011
  29. 29. Zend Translate 29Monday, 23 May 2011
  30. 30. Zend Translate nl.php fr.php 30Monday, 23 May 2011
  31. 31. Zend Translate my-view.phtml 31Monday, 23 May 2011
  32. 32. Zend Locale 32Monday, 23 May 2011
  33. 33. Zend Locale Quick hint: Google uses locales too! Zend Framework is your gateway to more power! 33Monday, 23 May 2011
  34. 34. Monday, 23 May 2011
  35. 35. Do not get lost in time Zend_Date 35Monday, 23 May 2011
  36. 36. Zend Date The date is May 2, 2011 9:13:41 PM. The date is 2 mei 2011 21:13:41. 36Monday, 23 May 2011
  37. 37. Zend Timesync 2 mai 2011 21:25:09 37Monday, 23 May 2011
  38. 38. Zend_Locale revisited You can use Zend_Locale_Format to override date and number formatting. I never had any use for it though..... 38Monday, 23 May 2011
  39. 39. Show me the money! Zend_Currency 39Monday, 23 May 2011
  40. 40. Zend Currency 40Monday, 23 May 2011
  41. 41. Zend Currency In the Netherlands you pay with Euro (€). And in the UK you pay with British Pound Sterling (£). 41Monday, 23 May 2011
  42. 42. Zend Currency 42Monday, 23 May 2011
  43. 43. Zend Currency Please hand me 10.00 US Dollar for food and shelter. 43Monday, 23 May 2011
  44. 44. Zend Currency Got lost in locales? getCurrencyList() getRegionList() getLocale() 44Monday, 23 May 2011
  45. 45. Never trust a user! Zend_Validate 45Monday, 23 May 2011
  46. 46. Zend Validate 46Monday, 23 May 2011
  47. 47. Zend Validate 47Monday, 23 May 2011
  48. 48. Measures please? Zend_Measure 48Monday, 23 May 2011
  49. 49. Zend Measure 49Monday, 23 May 2011
  50. 50. Zend Measure A Big Mac’s weight is 200,05 g in the Netherlands. In the USA this would be 0.441034755500847600236309 lbs 50Monday, 23 May 2011
  51. 51. Zend Measure Zend_Measure doesn’t utilize locales to give you the correct units, but only the correct number formats. 51Monday, 23 May 2011
  52. 52. Conclusion 52Monday, 23 May 2011
  53. 53. Image sources Achmed http://barenakedislam.wordpress.com/2011/01/27/sweden-muslim-offended-by-ahmed-the-dead-terrorist-demands-compensation-for-mental- anguish/jeff-dunham_achmed/ Clocks http://blogs.manageengine.com/image/501000000062207/timezones.jpg Cat http://icanhascheezburger.com Pinky & the brain http://blogg.visir.is/purplemagic/category/truarbrogð/ Zend Framework logo http://www.myskills.be/ Sneaking in: http://fakeposters.com 53Monday, 23 May 2011
  54. 54. Questions ? 54Monday, 23 May 2011
  55. 55. Thank you! Contact details: Twitter: @Martin1982 Blog: http://www.martindekeijzer.nl Please give feedback on Joind.in! http://joind.in/3253Monday, 23 May 2011
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×