Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

2011 - DotNetFranken: ASP.NET MVC Localization

393 views

Published on

ASP.NET MVC Localization

Published in: Software
  • Login to see the comments

  • Be the first to like this

2011 - DotNetFranken: ASP.NET MVC Localization

  1. 1. devcoach.com ASP.NET MVC Localization Daniel Fisher | devcoach Καλώς Ήλθατε Willkommen Welcome přivítat bienvenido bienvenu sevilen
  2. 2. devcoach.com devcoach.com BERTAUNG + SCHULUNG + PROJEKTE • Themen – Architektur & Technologie Evaluierung, Performance Optimierung, Entwicklungs- Unterstützung, Security Reviews, QA, POC & Know-how-Transfer • Technologien – Services: WCF & WF – Data: ADO.NET & EF – Web: ASP.NET, MVC & Silverlight • Kunden – Versicherung, Finanzindustrie, Mittelstand, Handel, Kommunikation, Softwarehersteller… Und sie? • Kontakt – info@devcoach.com
  3. 3. devcoach.com Daniel Fisher • devcoach.com – Mit-Gründer und Geschäftsführer • Justcommunity.de – Mit-Gründer und Vorstand • nrwconf.de – Mit-Gründer und Organisator • netug-niederrhein.de – Mit-Gründer und Leiter • microsoft.com – Community Leader & Insider (CLIP) – Certified Professional Developer – Business Platform Technology Advisor • lennybacon.com – Blog • twitter.com – @lennybacon
  4. 4. devcoach.com Efficient Communication…
  5. 5. devcoach.com Agenda • Loco?lize • Server – Thread Localization – Resource Localization – View Localization • Client – Jquery Localization • Summary
  6. 6. devcoach.com Customer • "Users should select a language (by clicking e.g. a flag) and information will be presented in the corresponding language."
  7. 7. devcoach.com Developer • "If the users clicks on a flag I reload the page and transmit the language as parameter to load the information in the corresponding language."
  8. 8. devcoach.com The process of localization… Server HTTP GET HTTP 200 HTTP GET (select language) HTTP 200 HTTP GET HTTP 200
  9. 9. devcoach.com
  10. 10. devcoach.com Customer • "Users should select a language (by clicking e.g. a flag) and information will be presented in the corresponding language. The selection should be maintained as long as the user browses out site!"
  11. 11. devcoach.com The process of localization… Server HTTP GET HTTP 200 HTTP GET (select language) HTTP 200 HTTP GET HTTP 200 STATE
  12. 12. devcoach.com Code var language = Session["Language"] ?? Request.QueryString["lang"]; if(!string.IsNullOrWhitespace(language ) { Session["Language"] = language ; }
  13. 13. devcoach.com
  14. 14. devcoach.com
  15. 15. devcoach.com Requirements • Customer: Information should be presented in the language requested if possible.
  16. 16. devcoach.com Wait… that is part of HTTP • RFC2295: Transparent Content Negotiation in HTTP – http://gewis.win.tue.nl/~koen/conneg/rfc2295.txt
  17. 17. devcoach.com
  18. 18. devcoach.com In the beginning there was nothing… …God said, 'Let there be URI!' And there was URI.
  19. 19. devcoach.com
  20. 20. devcoach.com HTTP://LOCALHOST/EN/DEMO1 Thread Localization
  21. 21. devcoach.com Resource Localization • The .NET Way – *.resx – *.de.resx – …
  22. 22. devcoach.com Resource Localization • The ASP.NET Web Forms Way – [Page/Control].GetGlobalResourceObject(…) – [Page/Control].GetLocalResourceObject(…) – <asp:Button ID="btnSubmit" runat="server" Text="<%$ Resources:btnSubmit.Text %>" /> – <asp:Button ID="btnSubmit" runat="server" meta:resourcekey="btnSubmit" />
  23. 23. devcoach.com Resource Localization Tools • Zeta Resource Editor? • Kein ASP.NET? WPF? – NLocalize ;-) • http://www.nlocalize.de • Auch hier Sponsor!
  24. 24. devcoach.com Resource Localization Extensibility ASP.NET ResourceProviderFactory ResourceProvider ResourceReader Your Code
  25. 25. devcoach.com HTTP://LOCALHOST/EN/DEMO2 Resource Localization
  26. 26. devcoach.com
  27. 27. devcoach.com HTTP://LOCALHOST/EN/DEMO3 View Localization
  28. 28. devcoach.com
  29. 29. devcoach.com
  30. 30. devcoach.com HTTP://LOCALHOST/EN/DEMO4 jQuery Plugins Localization
  31. 31. devcoach.com THX C U @LENNYBACON

×