Internationalization An introduction to Drupal i18n Russell Blakeborough [email protected].
Introduction to Internationalization (I18n)
-
Upload
lingoport-wwwlingoportcom -
Category
Technology
-
view
2.829 -
download
0
description
Transcript of Introduction to Internationalization (I18n)
Introduction to Internationalization
Reaching worldwide markets with a single code base
Presented by: Adam AsnesLingoport, Inc.
Agenda
• Internationalization• Key Internationalization (i18n) Concepts
• Business Cases
• Approaching Globalization
• Architecture and Code Review
• Scanning code for issues with Globalyzer
• Building a plan
• Ongoing Processes
• Questions
Internationalization and Localization Fit
• Lingoport - Internationalization– Development oriented consulting and software– Adapt products so they are world ready
• Localization– Translation specific to market needs– Coordinated management of strings for translation– Linguistic Testing and more
Internationalization (i18n)• Engineering a product so it can be adapted to
target languages and regions efficiently and without requiring subsequent engineering changes to the core product
• Common abbreviation is i18n (i + 18 letters + n)• A product must be internationalized before
localization can occur
Business Case – why it’s important
• Survival• Global Revenues
– Key business partners– 60% or more of revenues
• Competitiveness• Strategic Growth
• One-time Higher Initial Cost– I18n as part of development process
• Lower Overall Cost as End Result– Future releases incur only localization costs
I18n Cost/Benefit
New Globalization Requirement
I18n Needs – Biz vs. Tech
Engineering thinks about…
1. Multi-tiered web application?2. Complex Interface?3. Database components?4. Embedded Strings?5. Locale aware application?6. Can it manage multiple data formats?7. I18n testing plan?8. Tactics to get it done
Our Software must be in Japanese, French,
German, Chinese, and Spanish by November
Example: Hard-Coded English Text
1 million lines of source codeTypically Found:
At least 40,000 Embedded Strings which cannot be efficiently translated
String orderStatus = “Your order has been processed. A confirmation e-mail will be sent to you shortly.”;
11
String Concatenation
• Avoid Concatenation– Combining two or more text strings at runtime to form
a single string
– What order do these appear at runtime?– Are they switched around? – Do they combine with other strings that aren’t here?
fileActions = {1} file(s)successfulAction = successfully {2} locationAction = to {3}
Character Sets/Encodings
• Character set– A set of characters used to support a given language or series of
languages
• Character encoding– A set of code points that defines numeric values for each
character within a character set (coded character set)
Character Encoding
• The Binary Letter AThe Letter:
ABinary Encoding Examples
ASCII: 1000001 (7-bit)ISO Latin 1: 01000001 (single-byte)
UTF-16: 00000000 01000001 (double-byte)
The Letter:
ABinary Encoding Examples
ASCII: 1000001 (7-bit)ISO Latin 1: 01000001 (single-byte)
UTF-16: 00000000 01000001 (double-byte)
Character Sets and Encoding• This is broken:
Internationalization Challenge
• Software Data Path - it’s not just the display
Display Input Transform
Store
RetrieveTransform
I18n Architectural Challenge – what’s not in the code
DatabaseCharacter encoding
support
Application Codee.g. Java, C++, VB
3rd Party Products
U/Ie.g. JSP,
ASP, ASPX
Business LogicPlatforms, Browser Support Requirements
Marketing RequirementsLocale behavior
I18n Design Considerations Checklist*• Locale implementation
(determination, tracking)• Character encodings• Strings
– Externalization– Concatenation– Display/Layout
• Date/time handling• Number handling• Currency handling• Sorting• Searching
• Encoding conversions• Locale-specific functions• Address formats• Telephone formats• Page layout• Fonts and attributes• Images, icons, colors• Bi-directional support?• Reporting, workflow• Database enabling• Multi-byte enabling
Locale
• Language + territory [ + variant ]– en_US = English (US)– en_GB = English (UK)
• Combines language and territorial conventions for spelling, formatting, etc.– en_US = "color," mm/dd/yyyy, $1,234.56– en_GB = "colour," dd/mm/yyyy, £1.234,56
• A more accurate representation than language
Locale-Specific Formatting ExamplesLocale Short Date Long Date Number Currency
English, US 05/06/02 May 6, 2002 1,234.56 $1,234.56
English, UK 06/05/02 06 May 2002 1.234,56 £1.234,56
French, France 06/05/02 6 mai 2002 1 234,56 1 234,56 €
Japanese 02/05/06 2002年 5月 6日 1,234.56 ¥1,234.56
Sorting/Collation
• Which list is correct?
Ångström Helsinki
Helsinki Zürich
Österreich Ångström
Zürich Österreich
New Internationalization Project!
• What to do?– Large amount of code– Change in requirements– Change in architecture– Change in development practices– Change in testing requirements
I18n Process• Planning
• Market Requirements Analysis• Architectural Requirements Analysis• Code Review
• I18n Design• I18n Implementation• Testing• And beyond…
• Localization• Support
Code Review – what’s in the code that needs to be found and changed
• What to Identify– Embedded strings– Unsafe methods/functions– Image references– Unsafe programming constructs (ex: regular expressions)
• How to Identify– “Brute force” iterations
• Engineers search for and resolve known issues
– Globalyzer-assisted review• An I18n code analysis tool is employed to examine source code for
a large range of potential and known issues• Issues can be identified and resolved in a more systematic fashion
Globalyzer Server and ClientsServer
Client
Command Line
Example Project Plan
Combine:•1 Part Architecture•1 Part Code Metrics•1 Part Experience
Let’s Look at Some Code
I18n Testing
• PseudoJudo Utility in Globalyzer• Pseudo-localization
– A “pseudo-locale” is created and implemented with “pseudo-translated” content
• Before pseudo-translation:UserNameLabel=UsernameSomeMessage=The quick brown fox jumps over the lazy dog.
• After pseudo-translation: UserNameLabel=縞 Ùsèérnâàæmê史SomeMessage=嚮 Thëëë qúûîìck bröööwn fòöõx jüùümps òvèèr thêê
lãâzÿ dõøg燭 .
– Tests for:• String-length expansion issues• Extended character display/corruption issues
Keeping Software Worldready
I18n As An Ongoing Process
• Pervasive influence on entire organization– Paradigm shift: not US-centric!– I18n Coding Standards
• Quality Assurance• I18n software lifecycle tools: Globalyzer
• Avoid code forks– New features with international focus to launch in ALL
locales
• Relationship with Localization partner
I18n As An Ongoing Process
• Globalyzer Command Line• Automated i18n checking
• Create i18n Standards• Training
Contact Information
31
Questions?Contact
Lingoporthttp://[email protected]+1 303 444 8020Based in Boulder, Colorado
Visit lingoport.com for more articles, newsletters and whitepapersTry Globalyzer – sign up at http://globalyzer.com