Presentation is loading. Please wait.

Presentation is loading. Please wait.

L10n and I18n in the Real World Dan Moore Moore Consulting June 9, 2005.

Similar presentations


Presentation on theme: "L10n and I18n in the Real World Dan Moore Moore Consulting June 9, 2005."— Presentation transcript:

1 L10n and I18n in the Real World Dan Moore Moore Consulting June 9, 2005

2 My experience ● Contractor who worked on 3 year old ecommercish site. – Added to existing working application ● Java on Tomcat with Oracle backend ● 36 countries,15 languages, two frameworks. ● Vast majority of work outlined here was done by Zia Consulting – They get the blame! ● Reflects state of system as of February

3 Your experience ● How many folks have worked on i18n applications – J2SE – J2EE – J2ME? ● What locales (any programming lang) – European – Asian – Other

4 Outline ● General process ● Definitions ● Display ● Locale Identification ● Data flow ● Issues ● Resources ● Ask questions anytime

5 General process Locale Key Output “HELLO_KEY” “en_US” “Hello there.” Datastore Frame work

6 Definitions ● Locale – ISO standard: language_country_variant ● fr_CA, en_US_jive ● Internationalization ● Localization ● Character set – UTF-8 or ascii ● Bundle (resource)

7 Bundle Examples ● Greeting.properties – HELLO_KEY=Hello there. – GOODBYE_KEY=Bye ● Greeting_fr.properties – HELLO_KEY=Bonjour. – GOODBYE_KEY=Au revoir ● Greeting_kr.properties – HELLO_KEY=\uc0ac\uc774\ud2b8\ub9f5 – GOODBYE_KEY=\uc0bc\ucd74\ud2b2\ub345 ● One bundle, multiple files

8 Display ● Web ● PDF/Email ● Localized features ● Other localization possibilities

9 Web ● Some class matches keys and locales to generate text ● Jetspeed (velocity) – $l10n.HELLO_KEY – Path like configuration ● Expresso (taglib) – – Schema pointed to one bundle. – Also provided java method to do so. ● Struts similar to expresso

10 PDF/Email ● iText – Specify encoding, possibly specify TT font – com.lowagie.text.pdf.BaseFont – createFont() method ● Character set in content-type header – text/plain;charset=utf-8 – text/html; charset=utf-8

11 Localized features ● Different sections of site were localized in different languages – Product A supported for en and de, but product B only for en – In db, tie features (Product A) to locales – Always have a fallback locale of en ● Allow users to change locale easily ● Locale specific fields on forms – In db, tied fields (last name) on forms to locales.

12 Other localization possibilities ● Currency – DecimalFormat class ● Dates – Not localized—one common format ● Name of company ● Sorting – Not localized that I saw – Could have been done on client side

13 Locale identification ● How do you handle statelessness ● Custom solution vs headers – Headers: browser – Cookies, url rewriting or hidden form fields – Localization feature required folks to switch – Other business reasons (pass locale via params) – Consider headers ● Look at user set – Everyone knows some english, technical crowd. ● Locale Choice page – Image “Please choose your country...” – Drop down box (in English)

14 Data Flow ● Message bundles – Infrequently changing ● Database loads – Frequently changing ● Why not all in database?

15 Message bundles process Excel Access Framework Native.txt files.properties files Client Us deployment manual Export native2ascii HELLO_KEY=Hi Keys defined HELLO_KEY=\uc0ac\uc774\ud2b8\ub9f5

16 Message bundles continued ● Dynamic generation of strings – Sample value: Email Dan now! – EMAIL_KEY1=Email and EMAIL_KEY2=now! – EMAIL_KEY=Email {0} now! – Struts allows in taglib; JS and Exp don't ● Access/excel – Character limits (1024) ● Images and common properties – Separate property file ● Native2ascii – Ant task

17 Native2ascii example

18 Data process Legacy systems SQL Server Test staging tables Access Text files Client Us sqlldr feeds export Export to UTF-8 text test db prod staging PL/SQL ODBC prod

19 Data process continued ● Oracle – NLS_LANG=american_america.AL32UTF8 ● Sqlldr – CHARACTERSET UTF-8 – Case study on sqlldr i18n on OTN ● PL/SQL ● Setup your database browser ● Tried ODBC – 3 rows/sec

20 Issues ● Translation time ● QA of output – External testing resources ● Scheduling restart times – “It's 5 o'clock somewhere.” ● Locale fk everywhere that data is displayed ● Custom locale code (not en_US, rather eng_US)

21 Resources ● ziaconsulting.com ● blogs.msdn.com/michkap/default.aspx ● java.sun.com/docs/books/tutorial/i18n/ ● mooreds.com/weblog/archives/000199.html ● joelonsoftware.com/Unicode.html ● ppewww.ph.gla.ac.uk/~flavell/www/lang- neg.html ● mooreds.com/i18n/ ● databasejournal.com/features/oracle/article.p hp/3493691 ● ant.apache.org/manual/OptionalTasks/native 2ascii.html

22 Thanks ● Reviewers – Ben Galde – Susan Mowery – Corey Snipes – Karen Josey ● Ziaconsulting – Mike Mahon ● Y'all


Download ppt "L10n and I18n in the Real World Dan Moore Moore Consulting June 9, 2005."

Similar presentations


Ads by Google