Let's take over the world with Zend Framework
Upcoming SlideShare
Loading in...5
×
 

Like this? Share it with your network

Share

Let's take over the world with Zend Framework

on

  • 3,200 views

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 ...

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.

Statistics

Views

Total Views
3,200
Views on SlideShare
3,193
Embed Views
7

Actions

Likes
5
Downloads
48
Comments
1

1 Embed 7

http://protalk.me 7

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
  • 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.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Let's take over the world with Zend Framework Presentation Transcript

  • 1. Let’s take over the world with Zend Framework Martin de Keijzer Dutch PHP Conference 2011Monday, 23 May 2011
  • 2. Introduction 2Monday, 23 May 2011
  • 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. DISCLAIMER DISCLAIMER: ALL EXAMPLE CODE IS WRITTEN IN THE CONTROLLER BY EXAMPLE! USE MODELS!!!! 4Monday, 23 May 2011
  • 5. Monday, 23 May 2011
  • 6. The case What do we need to take over the world? 6Monday, 23 May 2011
  • 7. The case ✓Location (Country and region) ✓Language ✓Date and time ✓Currency ✓Measuring 7Monday, 23 May 2011
  • 8. “Location! Location! Location!” Quote from Achmed (2009) 8Monday, 23 May 2011
  • 9. Zend LocaleMonday, 23 May 2011
  • 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. Zend Locale nl_NL de_BE fr_BE nl_BE 11Monday, 23 May 2011
  • 12. Zend Locale CLDR Common Locale Data Repository http://cldr.unicode.org 12Monday, 23 May 2011
  • 13. Zend Locale 13Monday, 23 May 2011
  • 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. Zend Locale 15Monday, 23 May 2011
  • 16. Zend Locale 16Monday, 23 May 2011
  • 17. Zend Locale In FR people speak fr 17Monday, 23 May 2011
  • 18. Zend Locale In FR people speak fr. In France people speak French. 18Monday, 23 May 2011
  • 19. Zend Locale 19Monday, 23 May 2011
  • 20. Zend Locale 20Monday, 23 May 2011
  • 21. Zend Locale array(6) { ["yes"]=> string(2) "ja" ["no"]=> string(3) "nee" } 21Monday, 23 May 2011
  • 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. Zend Locale ["yesexpr"]=> string(20) "^([jJ][aA]?)|([jJ]?)" ["noexpr"]=> string(26) "^([nN]([eE][eE])?)| ([nN]?)" 23Monday, 23 May 2011
  • 24. Zend Locale A list of supported locales: http://framework.zend.com/manual/ en/zend.locale.appendix.html 24Monday, 23 May 2011
  • 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. Speaking the language Zend_Translate 26Monday, 23 May 2011
  • 27. Zend Translate Operates using adapters: Array Csv Gettext Tbx Tmx Qt Xliff Xmltm 27Monday, 23 May 2011
  • 28. Zend Translate 28Monday, 23 May 2011
  • 29. Zend Translate 29Monday, 23 May 2011
  • 30. Zend Translate nl.php fr.php 30Monday, 23 May 2011
  • 31. Zend Translate my-view.phtml 31Monday, 23 May 2011
  • 32. Zend Locale 32Monday, 23 May 2011
  • 33. Zend Locale Quick hint: Google uses locales too! Zend Framework is your gateway to more power! 33Monday, 23 May 2011
  • 34. Monday, 23 May 2011
  • 35. Do not get lost in time Zend_Date 35Monday, 23 May 2011
  • 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. Zend Timesync 2 mai 2011 21:25:09 37Monday, 23 May 2011
  • 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. Show me the money! Zend_Currency 39Monday, 23 May 2011
  • 40. Zend Currency 40Monday, 23 May 2011
  • 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. Zend Currency 42Monday, 23 May 2011
  • 43. Zend Currency Please hand me 10.00 US Dollar for food and shelter. 43Monday, 23 May 2011
  • 44. Zend Currency Got lost in locales? getCurrencyList() getRegionList() getLocale() 44Monday, 23 May 2011
  • 45. Never trust a user! Zend_Validate 45Monday, 23 May 2011
  • 46. Zend Validate 46Monday, 23 May 2011
  • 47. Zend Validate 47Monday, 23 May 2011
  • 48. Measures please? Zend_Measure 48Monday, 23 May 2011
  • 49. Zend Measure 49Monday, 23 May 2011
  • 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. 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. Conclusion 52Monday, 23 May 2011
  • 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. Questions ? 54Monday, 23 May 2011
  • 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