L10n and I18n in the Real World - PowerPoint PPT Presentation

About This Presentation
Title:

L10n and I18n in the Real World

Description:

blogs.msdn.com/michkap/default.aspx. java.sun.com/docs/books/tutorial/i18n/ mooreds.com/weblog/archives/000199.html. joelonsoftware.com/Unicode.html ... – PowerPoint PPT presentation

Number of Views:17
Avg rating:3.0/5.0
Slides: 23
Provided by: moor7
Category:
Tags: i18n | l10n | real | world

less

Transcript and Presenter's Notes

Title: L10n and I18n in the Real World


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
(No Transcript)
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_KEYHello there.
  • GOODBYE_KEYBye
  • Greeting_fr.properties
  • HELLO_KEYBonjour.
  • GOODBYE_KEYAu 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)
  • ltbeanmessage key"HELLO_KEY" schema"com.zia..."
    /gt
  • 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/plaincharsetutf-8
  • text/html charsetutf-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 localizedone 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
(No Transcript)
16
Message bundles continued
  • Dynamic generation of strings
  • Sample value Email Dan now!
  • EMAIL_KEY1Email and EMAIL_KEY2now!
  • EMAIL_KEYEmail 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
ltnative2ascii encoding"UTF-8"
src"indir" dest"outdir" ext"properties"gt
ltinclude name".txt"/gt
ltexclude name"readme.txt"/gt ltexclude
name"CVS/"/gt lt/native2asciigt
18
(No Transcript)
19
Data process continued
  • Oracle
  • NLS_LANGamerican_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.php/34
    93691
  • ant.apache.org/manual/OptionalTasks/native2ascii.h
    tml

22
Thanks
  • Reviewers
  • Ben Galde
  • Susan Mowery
  • Corey Snipes
  • Karen Josey
  • Ziaconsulting
  • Mike Mahon
  • Y'all
Write a Comment
User Comments (0)
About PowerShow.com