SlideShare ist ein Scribd-Unternehmen logo
1 von 40
Internationalization
Agenda
 What is Internationalization
 What it offers
 Sample Application
 How to use it
 Best Practices

 Questions
What is Internationalization
 Internationalization (i18n)

the process of changing your software so that it
isn't hardwired to one language/locale/culture.
 Localization (l10n)

the process of adding the appropriate resources to
your software so that a particular language/locale is
supported.
What is Internationalization
 The terms are frequently abbreviated to

the numeronyms i18n (where 18 stands for the number of
letters between the first i and last n in internationalization, a
usage coined at DEC in the 1970s or
80s) and L10n respectively, due to the length of the words.
 Some companies, like IBM and Sun Microsystems, use the

term "globalization" for the combination of
internationalization and localization.
 Microsoft defines Internationalization as a combination of

World-Readiness and localization. World-Readiness is a
developer task, which enables a product to be used with
multiple scripts and cultures (globalization) and separating
user interface resources in a localizable format
(localizability, abbreviated to L12y).
What it offers
 Build once, sell anywhere
 Modularity demands it!
 Ease of translation

 “With the addition of localization data, the same

executable can be run worldwide.”
Characteristics
 Textual elements such as status messages and

the GUI component labels are not hardcoded in
the program. Instead, they are stored outside the
source code and retrieved dynamically.
 Support for new languages does not require

recompilation.
 Other culturally-dependent data, such as dates

and currencies, appear in formats that conform to
the end-user's region and language.
Sample Application
 Before Internationalization
 After Internationalization
Before Internationalization
After Internationalization
% java I18NSample fr FR
Bonjour.
Comment allez-vous?
Au revoir.

% java I18NSample en US
Hello.
How are you?
Goodbye.
How does it work
1) Create Properties Files
2) Define the Locale
3) Create Resource Bundle
4) Fetch Text from Resource Bundle
Properties file
 A properties file stores information about the

characteristics of a program or environment. A
properties file is in plain-text format.
 E.g.
greetings = Hello
farewell = Goodbye
inquiry = How are you?
Locale
 The Locale object identifies a particular language






and country.
has the form xx_YY
xx is two-character language code (ISO-639)
YY is two-character country code (ISO-3166)
Examples:
 en_US - United States English
 en_GB - Great Britain English
 es_MX - Mexico Spanish (Espanol)
1) Create Properties file
 MessagesBundle_fr_FR.properties
greetings = Bonjour.
farewell = Au revoir.
inquiry = Comment allez-vous?

 Keys remains same, values changes
2) Define the locale
3) Create a ResourceBundle
4) Fetch Text from
ResourceBundle
What may need
Internationalization
 Just a few thing

 And some more

 messages

• numbers

 labels on GUI

• currencies









components
online help
sounds
colors
graphics
icons
dates
times

• measurements
• phone numbers
• honorifics and personal

titles
• postal addresses
• page layouts
What’s easily translatable?
 Status messages
 Error messages
 Log file entries
 GUI component labels
 BAD!
Button okButton = new Button(“OK”);

 GOOD!
String okLabel = ButtonLabel.getString("OkKey");
Button okButton = new Button(okLabel);
What’s NOT (easily translatable)?


“At 1:15 PM on April 13, 1998, we attack the 7 ships on Mars.”

MessageBundle_en_US.properties
template = At {2,time,short} on {2,date,long}, we attack 
the {1,number,integer} ships on planet {0}.
planet = Mars
The time portion of a
Date object. The "short"
style specifies the
DateFormat.SHORT
formatting style.

The date portion of a Date
object. The same Date object
is used for both the date and
time variables. In the Object
array of arguments the index
of the element holding the
Date object is 2.

A Number
object, further
qualified with the
"integer" number
style.

The String in the
ResourceBundle
that corresponds
to the "planet"
key.
1. Compound Messages:
messageArguments...
 Set the message

arguments…
 Remember the

numbers in the
template refer to the
index in
messageArguments!
2. Compound Messages:
create formatter...
 Don’t forget setting

the Locale of the
formatter object...
3. Compound Messages:

 Get the template we

defined earlier…
 Then pass in our

arguments!
 And finally RUN...
Sample Run…
currentLocale = en_US
At 1:15 PM on April 13, 1998, we attack the 7 ships on the
planet Mars.
currentLocale = de_DE
Um 13.15 Uhr am 13. April 1998 haben wir 7 Raumschiffe auf dem
Planeten Mars entdeckt.
What’s NOT (easily translatable)?
 Plurals!

There
There
There

are no files
is one file
are 2 files

on XDisk.
on XDisk.
on XDisk.

Also variable...
3 possibilities
for output
templates.

Possible integer value in
one of the templates.
Plurals
ChoiceBundle_en_US.properties
pattern = There {0} on {1}.
noFiles = are no files
oneFile = is one file
multipleFiles = are {2} files

noFiles = are no files
oneFile = is one file
multipleFiles = are {2} files

There are 2 files on XDisk.
Plurals
 What’s different?
 Now we even

index our
templates… see
fileStrings, indexe
d with fileLimits.
 First create the

array of templates.
Sample Run
currentLocale = en_US
There
There
There
There

are no files on XDisk.
is one file on XDisk.
are 2 files on XDisk.
are 3 files on XDisk.

currentLocale = fr_FR
Il
Il
Il
Il

n' y a pas des
y a un fichier
y a 2 fichiers
y a 3 fichiers

fichiers sur XDisk.
sur XDisk.
sur XDisk.
sur XDisk.
Numbers
 Supported through NumberFormat!
o Shows what locales are available. Note, you can also
Locale[] create custom formats if needed.
locales = NumberFormat.getAvailableLocales();

345 987,246
345.987,246
345,987.246

fr_FR
de_DE
en_US
Currency
 Supported with:

NumberFormat.getCurrencyInstance!

9 876 543,21 F
fr_FR
9.876.543,21 DM
de_DE
$9,876,543.21
en_US
A Date and Time
 Supported with:
 DateFormat.getDateInstance
DateFormat dateFormatter =
DateFormat.getDateInstance(DateFormat.DEFAULT, currentLocale);

 DateFormat.getTimeInstance
DateFormat timeFormatter =
DateFormat.getTimeInstance(DateFormat.DEFAULT, currentLocale);

 DateFormat.getDateTimeInstance
DateFormat dateTimeFormatter = DateFormat.getDateTimeInstance(
DateFormat.LONG, DateFormat.LONG, currentLocale);
Date example
 Supported with: DateFormat.getDateInstance

9 avr 98
9.4.1998
09-Apr-98

fr_FR
de_DE
en_US
Unicode Characters
 16 bit!
 65,536 characters
 Encodes all major languages
 In Java Char is a Unicode character
 See unicode.org/

Future Use
ASCII

0x0000

Greek

Kana
Symbols

Internal

0xFFFF
Java support for the Unicode
Char
 Character API:










isDigit
isLetter
isLetterOrDigit
isLowerCase
isUpperCase
isSpaceChar
isDefined

 Unicode Char values accessed with:

String eWithCircumflex = new String("u00EA");
Java support for the Unicode
Char
 Example of some repair…
 BAD!

if ((ch
 GOOD!>=

'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z'))
// ch is a letter

if (Character.isLetter(ch))
// ch is a letter
Java support for the Unicode
Char
 Get the Unicode category for a Char:







LOWERCASE_LETTER
UPPERCASE_LETTER
MATH_SYMBOL
CONNECTOR_PUNCTUATION
etc...

if (Character.getType('_') == Character.CONNECTOR_PUNCTUATION)
// ch is a “connector”
Next Steps - Internationalization
 Expedite and make necessary business decisions
 Identify the scope and timelines for

internationalization
 Implement design and code changes
Localization
 Identify the specific localization need
 Country / Culture
 Language(s) to be supported
 Pages / Interfaces / data elements to be localized

 Translation
 Language experts for translation
 Localize content (text, graphics, etc)
 Build a translation database, if required

 Implement design & code changes that may arise
Questions
Thank you ..
References:
 http://docs.oracle.com/javase/tutorial/i18n/index.h

tml
 https://www.slideshare.net
 https://www.google.com
 http://gwt.googleusercontent.com/samples/Showc
ase/Showcase.html

Weitere ähnliche Inhalte

Was ist angesagt?

Was ist angesagt? (20)

Fundamentals of User Interface Design
Fundamentals of User Interface DesignFundamentals of User Interface Design
Fundamentals of User Interface Design
 
Introduction to Mobile Development
Introduction to Mobile DevelopmentIntroduction to Mobile Development
Introduction to Mobile Development
 
Layer architecture of ios (1)
Layer architecture of ios (1)Layer architecture of ios (1)
Layer architecture of ios (1)
 
Hexagonal architecture - message-oriented software design
Hexagonal architecture  - message-oriented software designHexagonal architecture  - message-oriented software design
Hexagonal architecture - message-oriented software design
 
Deconstructing Monoliths with Domain Driven Design
Deconstructing Monoliths with Domain Driven DesignDeconstructing Monoliths with Domain Driven Design
Deconstructing Monoliths with Domain Driven Design
 
Domain driven design and model driven development
Domain driven design and model driven developmentDomain driven design and model driven development
Domain driven design and model driven development
 
Redhat Open Day - Integracion JBoss Fuse A-MQ
Redhat Open Day - Integracion JBoss Fuse A-MQRedhat Open Day - Integracion JBoss Fuse A-MQ
Redhat Open Day - Integracion JBoss Fuse A-MQ
 
Engineering Software Products: 10. Devops and code management
Engineering Software Products: 10. Devops and code managementEngineering Software Products: 10. Devops and code management
Engineering Software Products: 10. Devops and code management
 
Usability Engineering Presentation Slides
Usability Engineering Presentation SlidesUsability Engineering Presentation Slides
Usability Engineering Presentation Slides
 
SDLC
SDLCSDLC
SDLC
 
Domain Driven Design (DDD)
Domain Driven Design (DDD)Domain Driven Design (DDD)
Domain Driven Design (DDD)
 
User Interface Design Module 5 screen based controls
User Interface Design Module 5  screen based controlsUser Interface Design Module 5  screen based controls
User Interface Design Module 5 screen based controls
 
HCI - Chapter 6
HCI - Chapter 6HCI - Chapter 6
HCI - Chapter 6
 
Domain Driven Design – DDD além da teoria!, por Paulo Victor Gomes
Domain Driven Design – DDD além da teoria!, por Paulo Victor GomesDomain Driven Design – DDD além da teoria!, por Paulo Victor Gomes
Domain Driven Design – DDD além da teoria!, por Paulo Victor Gomes
 
Swift Programming Language
Swift Programming LanguageSwift Programming Language
Swift Programming Language
 
Graphical user-interface
Graphical user-interfaceGraphical user-interface
Graphical user-interface
 
Graphical User Interface
Graphical User InterfaceGraphical User Interface
Graphical User Interface
 
Domain Driven Design Quickly
Domain Driven Design QuicklyDomain Driven Design Quickly
Domain Driven Design Quickly
 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven Design
 
Introduction to DDD
Introduction to DDDIntroduction to DDD
Introduction to DDD
 

Andere mochten auch

Vacation Planner
Vacation PlannerVacation Planner
Vacation Planner
ashkamodi
 
Honorary Degree Leaflet
Honorary Degree LeafletHonorary Degree Leaflet
Honorary Degree Leaflet
Shirley
 
Lingkungan presentation - liz
Lingkungan presentation - lizLingkungan presentation - liz
Lingkungan presentation - liz
liz
 
What's Hot On Facebook - 19/10/2011
What's Hot On Facebook - 19/10/2011What's Hot On Facebook - 19/10/2011
What's Hot On Facebook - 19/10/2011
David Nattriss
 
Skf q4 2010_pr_eng
Skf q4 2010_pr_engSkf q4 2010_pr_eng
Skf q4 2010_pr_eng
SKF
 

Andere mochten auch (20)

Lua 30+ Programming Skills and 20+ Optimization Tips
Lua 30+ Programming Skills and 20+ Optimization TipsLua 30+ Programming Skills and 20+ Optimization Tips
Lua 30+ Programming Skills and 20+ Optimization Tips
 
Vacation Planner
Vacation PlannerVacation Planner
Vacation Planner
 
Honorary Degree Leaflet
Honorary Degree LeafletHonorary Degree Leaflet
Honorary Degree Leaflet
 
Lingkungan presentation - liz
Lingkungan presentation - lizLingkungan presentation - liz
Lingkungan presentation - liz
 
Progressive Movement
Progressive MovementProgressive Movement
Progressive Movement
 
Career Development 101
Career Development 101Career Development 101
Career Development 101
 
Samri Ki Jawala
Samri Ki JawalaSamri Ki Jawala
Samri Ki Jawala
 
Genitori code week 2016
Genitori code week 2016 Genitori code week 2016
Genitori code week 2016
 
Visual I Solutions
Visual I SolutionsVisual I Solutions
Visual I Solutions
 
Dontjustchangeengine
DontjustchangeengineDontjustchangeengine
Dontjustchangeengine
 
Telstra\'s Climate Change Opportunities Report
Telstra\'s Climate Change Opportunities ReportTelstra\'s Climate Change Opportunities Report
Telstra\'s Climate Change Opportunities Report
 
galeria wolontariatu
galeria wolontariatugaleria wolontariatu
galeria wolontariatu
 
Designing Special Feature Pages
Designing Special Feature PagesDesigning Special Feature Pages
Designing Special Feature Pages
 
Sonder groupintromay2011
Sonder groupintromay2011Sonder groupintromay2011
Sonder groupintromay2011
 
What's Hot On Facebook - 19/10/2011
What's Hot On Facebook - 19/10/2011What's Hot On Facebook - 19/10/2011
What's Hot On Facebook - 19/10/2011
 
People of Durban
People of DurbanPeople of Durban
People of Durban
 
Skf q4 2010_pr_eng
Skf q4 2010_pr_engSkf q4 2010_pr_eng
Skf q4 2010_pr_eng
 
Datta Nadkarni portfolio 2014- Marketing Strategist for- Farmers, LensCrafter...
Datta Nadkarni portfolio 2014- Marketing Strategist for- Farmers, LensCrafter...Datta Nadkarni portfolio 2014- Marketing Strategist for- Farmers, LensCrafter...
Datta Nadkarni portfolio 2014- Marketing Strategist for- Farmers, LensCrafter...
 
Twitter
TwitterTwitter
Twitter
 
Presentatie Ps Verkort Klant
Presentatie Ps Verkort KlantPresentatie Ps Verkort Klant
Presentatie Ps Verkort Klant
 

Ähnlich wie Internationalization

Internationlization
InternationlizationInternationlization
Internationlization
Tuan Ngo
 
Case Summary Assignment Planning and organization fundamentally .docx
Case Summary Assignment Planning and organization fundamentally .docxCase Summary Assignment Planning and organization fundamentally .docx
Case Summary Assignment Planning and organization fundamentally .docx
troutmanboris
 

Ähnlich wie Internationalization (20)

Internationlization
InternationlizationInternationlization
Internationlization
 
F# Tutorial @ QCon
F# Tutorial @ QConF# Tutorial @ QCon
F# Tutorial @ QCon
 
GNU Internationalization Presentation
GNU Internationalization PresentationGNU Internationalization Presentation
GNU Internationalization Presentation
 
Avoiding Pitfalls with Internationalization & Localization
Avoiding Pitfalls with Internationalization & LocalizationAvoiding Pitfalls with Internationalization & Localization
Avoiding Pitfalls with Internationalization & Localization
 
Multi Lingual Websites In Umbraco
Multi Lingual Websites In UmbracoMulti Lingual Websites In Umbraco
Multi Lingual Websites In Umbraco
 
Technical Interview
Technical InterviewTechnical Interview
Technical Interview
 
Filehandlinging cp2
Filehandlinging cp2Filehandlinging cp2
Filehandlinging cp2
 
Localization and Shared Preferences in android
Localization and Shared Preferences in androidLocalization and Shared Preferences in android
Localization and Shared Preferences in android
 
Lecture10
Lecture10Lecture10
Lecture10
 
Python unit1
Python unit1Python unit1
Python unit1
 
Lab 1 Essay
Lab 1 EssayLab 1 Essay
Lab 1 Essay
 
Files
FilesFiles
Files
 
Code as Data workshop: Using source{d} Engine to extract insights from git re...
Code as Data workshop: Using source{d} Engine to extract insights from git re...Code as Data workshop: Using source{d} Engine to extract insights from git re...
Code as Data workshop: Using source{d} Engine to extract insights from git re...
 
VB Dot net
VB Dot net VB Dot net
VB Dot net
 
Case Summary Assignment Planning and organization fundamentally .docx
Case Summary Assignment Planning and organization fundamentally .docxCase Summary Assignment Planning and organization fundamentally .docx
Case Summary Assignment Planning and organization fundamentally .docx
 
Software Internationalization Crash Course
Software Internationalization Crash CourseSoftware Internationalization Crash Course
Software Internationalization Crash Course
 
FIT XXth World Congress in Berlin - SDL Tools Workshop
FIT XXth World Congress in Berlin - SDL Tools WorkshopFIT XXth World Congress in Berlin - SDL Tools Workshop
FIT XXth World Congress in Berlin - SDL Tools Workshop
 
Python interview questions and answers
Python interview questions and answersPython interview questions and answers
Python interview questions and answers
 
Python Interview questions 2020
Python Interview questions 2020Python Interview questions 2020
Python Interview questions 2020
 
Python interview questions
Python interview questionsPython interview questions
Python interview questions
 

Kürzlich hochgeladen

Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
AnaAcapella
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
KarakKing
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
 

Kürzlich hochgeladen (20)

Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 

Internationalization

  • 2. Agenda  What is Internationalization  What it offers  Sample Application  How to use it  Best Practices  Questions
  • 3. What is Internationalization  Internationalization (i18n) the process of changing your software so that it isn't hardwired to one language/locale/culture.  Localization (l10n) the process of adding the appropriate resources to your software so that a particular language/locale is supported.
  • 4. What is Internationalization  The terms are frequently abbreviated to the numeronyms i18n (where 18 stands for the number of letters between the first i and last n in internationalization, a usage coined at DEC in the 1970s or 80s) and L10n respectively, due to the length of the words.  Some companies, like IBM and Sun Microsystems, use the term "globalization" for the combination of internationalization and localization.  Microsoft defines Internationalization as a combination of World-Readiness and localization. World-Readiness is a developer task, which enables a product to be used with multiple scripts and cultures (globalization) and separating user interface resources in a localizable format (localizability, abbreviated to L12y).
  • 5. What it offers  Build once, sell anywhere  Modularity demands it!  Ease of translation  “With the addition of localization data, the same executable can be run worldwide.”
  • 6. Characteristics  Textual elements such as status messages and the GUI component labels are not hardcoded in the program. Instead, they are stored outside the source code and retrieved dynamically.  Support for new languages does not require recompilation.  Other culturally-dependent data, such as dates and currencies, appear in formats that conform to the end-user's region and language.
  • 7. Sample Application  Before Internationalization  After Internationalization
  • 9. After Internationalization % java I18NSample fr FR Bonjour. Comment allez-vous? Au revoir. % java I18NSample en US Hello. How are you? Goodbye.
  • 10. How does it work 1) Create Properties Files 2) Define the Locale 3) Create Resource Bundle 4) Fetch Text from Resource Bundle
  • 11. Properties file  A properties file stores information about the characteristics of a program or environment. A properties file is in plain-text format.  E.g. greetings = Hello farewell = Goodbye inquiry = How are you?
  • 12. Locale  The Locale object identifies a particular language     and country. has the form xx_YY xx is two-character language code (ISO-639) YY is two-character country code (ISO-3166) Examples:  en_US - United States English  en_GB - Great Britain English  es_MX - Mexico Spanish (Espanol)
  • 13. 1) Create Properties file  MessagesBundle_fr_FR.properties greetings = Bonjour. farewell = Au revoir. inquiry = Comment allez-vous?  Keys remains same, values changes
  • 14. 2) Define the locale
  • 15. 3) Create a ResourceBundle
  • 16. 4) Fetch Text from ResourceBundle
  • 17. What may need Internationalization  Just a few thing  And some more  messages • numbers  labels on GUI • currencies        components online help sounds colors graphics icons dates times • measurements • phone numbers • honorifics and personal titles • postal addresses • page layouts
  • 18. What’s easily translatable?  Status messages  Error messages  Log file entries  GUI component labels  BAD! Button okButton = new Button(“OK”);  GOOD! String okLabel = ButtonLabel.getString("OkKey"); Button okButton = new Button(okLabel);
  • 19. What’s NOT (easily translatable)?  “At 1:15 PM on April 13, 1998, we attack the 7 ships on Mars.” MessageBundle_en_US.properties template = At {2,time,short} on {2,date,long}, we attack the {1,number,integer} ships on planet {0}. planet = Mars The time portion of a Date object. The "short" style specifies the DateFormat.SHORT formatting style. The date portion of a Date object. The same Date object is used for both the date and time variables. In the Object array of arguments the index of the element holding the Date object is 2. A Number object, further qualified with the "integer" number style. The String in the ResourceBundle that corresponds to the "planet" key.
  • 20. 1. Compound Messages: messageArguments...  Set the message arguments…  Remember the numbers in the template refer to the index in messageArguments!
  • 21. 2. Compound Messages: create formatter...  Don’t forget setting the Locale of the formatter object...
  • 22. 3. Compound Messages:  Get the template we defined earlier…  Then pass in our arguments!  And finally RUN...
  • 23. Sample Run… currentLocale = en_US At 1:15 PM on April 13, 1998, we attack the 7 ships on the planet Mars. currentLocale = de_DE Um 13.15 Uhr am 13. April 1998 haben wir 7 Raumschiffe auf dem Planeten Mars entdeckt.
  • 24. What’s NOT (easily translatable)?  Plurals! There There There are no files is one file are 2 files on XDisk. on XDisk. on XDisk. Also variable... 3 possibilities for output templates. Possible integer value in one of the templates.
  • 25. Plurals ChoiceBundle_en_US.properties pattern = There {0} on {1}. noFiles = are no files oneFile = is one file multipleFiles = are {2} files noFiles = are no files oneFile = is one file multipleFiles = are {2} files There are 2 files on XDisk.
  • 26. Plurals  What’s different?  Now we even index our templates… see fileStrings, indexe d with fileLimits.  First create the array of templates.
  • 27. Sample Run currentLocale = en_US There There There There are no files on XDisk. is one file on XDisk. are 2 files on XDisk. are 3 files on XDisk. currentLocale = fr_FR Il Il Il Il n' y a pas des y a un fichier y a 2 fichiers y a 3 fichiers fichiers sur XDisk. sur XDisk. sur XDisk. sur XDisk.
  • 28. Numbers  Supported through NumberFormat! o Shows what locales are available. Note, you can also Locale[] create custom formats if needed. locales = NumberFormat.getAvailableLocales(); 345 987,246 345.987,246 345,987.246 fr_FR de_DE en_US
  • 29. Currency  Supported with: NumberFormat.getCurrencyInstance! 9 876 543,21 F fr_FR 9.876.543,21 DM de_DE $9,876,543.21 en_US
  • 30. A Date and Time  Supported with:  DateFormat.getDateInstance DateFormat dateFormatter = DateFormat.getDateInstance(DateFormat.DEFAULT, currentLocale);  DateFormat.getTimeInstance DateFormat timeFormatter = DateFormat.getTimeInstance(DateFormat.DEFAULT, currentLocale);  DateFormat.getDateTimeInstance DateFormat dateTimeFormatter = DateFormat.getDateTimeInstance( DateFormat.LONG, DateFormat.LONG, currentLocale);
  • 31. Date example  Supported with: DateFormat.getDateInstance 9 avr 98 9.4.1998 09-Apr-98 fr_FR de_DE en_US
  • 32. Unicode Characters  16 bit!  65,536 characters  Encodes all major languages  In Java Char is a Unicode character  See unicode.org/ Future Use ASCII 0x0000 Greek Kana Symbols Internal 0xFFFF
  • 33. Java support for the Unicode Char  Character API:        isDigit isLetter isLetterOrDigit isLowerCase isUpperCase isSpaceChar isDefined  Unicode Char values accessed with: String eWithCircumflex = new String("u00EA");
  • 34. Java support for the Unicode Char  Example of some repair…  BAD! if ((ch  GOOD!>= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z')) // ch is a letter if (Character.isLetter(ch)) // ch is a letter
  • 35. Java support for the Unicode Char  Get the Unicode category for a Char:      LOWERCASE_LETTER UPPERCASE_LETTER MATH_SYMBOL CONNECTOR_PUNCTUATION etc... if (Character.getType('_') == Character.CONNECTOR_PUNCTUATION) // ch is a “connector”
  • 36. Next Steps - Internationalization  Expedite and make necessary business decisions  Identify the scope and timelines for internationalization  Implement design and code changes
  • 37. Localization  Identify the specific localization need  Country / Culture  Language(s) to be supported  Pages / Interfaces / data elements to be localized  Translation  Language experts for translation  Localize content (text, graphics, etc)  Build a translation database, if required  Implement design & code changes that may arise
  • 40. References:  http://docs.oracle.com/javase/tutorial/i18n/index.h tml  https://www.slideshare.net  https://www.google.com  http://gwt.googleusercontent.com/samples/Showc ase/Showcase.html

Hinweis der Redaktion

  1. Internationalization (i18n) is the process of designing an application so that it can be adapted to different languages and regions, without requiring engineering changes.Localization (l10n) is the process of adapting software for a specific region or language by adding locale-specific components and translating text.According to Apple:Internationalization is the process of designing and building an application to facilitate localization. Localization, in turn, is the cultural and linguistic adaptation of an internationalized application to two or more culturally-distinct markets.
  2. You&apos;ve decided that this program needs to display these same messages for people living in France and Germany. Unfortunately your programming staff is not multilingual, so you&apos;ll need help translating the messages into French and German. Since the translators aren&apos;t programmers, you&apos;ll have to move the messages out of the source code and into text files that the translators can edit. Also, the program must be flexible enough so that it can display the messages in other languages, but right now no one knows what those languages will be.It looks like the program needs to be internationalized.
  3. There are several steps involved in the processCreate properties files (externalized locale-specific UI messages)Create the localeCreate a resource bundle (using the locale)Retrieve UI messages from the resource bundle
  4. In the example the properties files store the translatable text of the messages to be displayed. Before the program was internationalized, the English version of this text was hardcoded in the System.out.printlnstatements. The default properties file, which is called MessagesBundle.properties, contains the following lines:greetings = Hello farewell = Goodbye inquiry = How are you? Now that the messages are in a properties file, they can be translated into various languages. No changes to the source code are required.
  5. The French translator has created a properties file calledMessagesBundle_fr_FR.properties, which contains these lines:greetings = Bonjour. farewell = Au revoir. inquiry = Comment allez-vous? Notice that the values to the right side of the equal sign have been translated but that the keys on the left side have not been changed. These keys must not change, because they will be referenced when your program fetches the translated text.The name of the properties file is important. For example, the name of the MessagesBundle_fr_FR.properties file contains the fr language code and the FR country code. These codes are also used when creating a Locale object.To compile and run this program, you need these source files:I18NSample.javaMessagesBundle.propertiesMessagesBundle_de_DE.propertiesMessagesBundle_en_US.propertiesMessagesBundle_fr_FR.properties
  6. To compile and run this program, you need these source files:I18NSample.javaMessagesBundle.propertiesMessagesBundle_de_DE.propertiesMessagesBundle_en_US.propertiesMessagesBundle_fr_FR.properties
  7. To compile and run this program, you need these source files:I18NSample.javaMessagesBundle.propertiesMessagesBundle_de_DE.propertiesMessagesBundle_en_US.propertiesMessagesBundle_fr_FR.properties
  8. To compile and run this program, you need these source files:I18NSample.javaMessagesBundle.propertiesMessagesBundle_de_DE.propertiesMessagesBundle_en_US.propertiesMessagesBundle_fr_FR.properties
  9. What do you consider will require internationalization from your website ?Explain thru various examples from slides like , Text Lengths, Images, Language Direction, Fonts, Address Formats, Currency, Date Formats etcLength of text may varyIn terms of number of characters In terms of pixelsImpacts UIUnexpected text wrapsHidden / overlapping UI elementsWidth extending beyond page width / or getting croppedBitmaps &amp; ImagesSymbolic images may at time be understood differently in different countriesSome images may have adverse political / cultural impact in some countriesImages containing text may not represent the user’s language of choice.Some images / colors may lead to legal conflicts