SlideShare a Scribd company logo
1 of 42
About Me 
 Working & living in İstanbul 
 Coding since ‘85, CGI Programming since ’94 (Perl, C/C++) 
 ColdFusion Developer since ’97 
 Interested in ColdFusion, Flex, AIR, Ruby, Ajax, 
Frameworks, i18N, L10N, G11N, Geolocation 
 Created projects in more than 20 languages!  
 Have big interest in Epistemology 
 Personal blog: http://blog.demirkapi.net
Getting basics on i18N 
Theory
Do we need multilingualism? 
 Yes!
Why i18N (Internationalization)? 
 English is just another language. 
 The World Wide Web should be truly world-wide! 
 Internationalization is important to ensure that users worldwide can 
equally benefit from Web technology. 
 Wide diversity world-wide: 
 Scripts (Latin, Cyrillic, Hebrew, Tamil, Katakana,...) 
 Languages (English, German, Turkish, Korean, Japanese,...) 
 Typographic conventions 
 Cultural conventions 
 Political circumstances 
 Avoid fragmentation of specifications due to localization. 
 Make sure internationalization is done at the right place.
 What is i18N (Internationalization)? 
 Application functions in at least two locales 
 What is L10N (Localization)? 
 Process of applying a locale or language "skin" to an 
I18N application 
 What is G11N (Globalization)? 
 i18N & L10N 
What is …?
Internationalization & Localization 
Globalization 
 Single character set 
 Single executable 
 Single install 
 Single server serves all clients 
in all languages 
Localization 
 Based on globalized software 
 Adds specific translations and 
adaptations for particular 
languages and markets 
Globalized software can be localized without any code changes
Character encoding 
Character encoding specifies mappings from a character 
set to the integer numbers that represent the characters 
on a computer. 
 EUC-JP (Japanese) 
 EUC-KR (Korean) 
 ISO-8859-1 (Western European and English) 
 SHIFT_JIS (Japanese) 
 UTF-8 (All Languages)
What is Locale? 
The combination of a language and a country code 
 en_US: US English (color, $) 
 en_GB: British English (colour, £) 
 de_CH: German in Switzerland 
 tr_TR: Turkish in Turkey
Selecting/Detecting Locale 
 Manual 
 Default locale can be loaded and other options would be 
available by selection via buttons/selects etc. 
 Locale Detection 
 Parsing ‘Accept-Language’ header on HTTP request 
 Not usable with URLLoader 
 Capabilities.language property in Flash Player and AIR 
 Parsing browser and OS language settings via JavaScript 
 Location detection depending on IP
What is Unicode? 
 Unicode (unicode.org) is an character set for all the 
characters and symbols of the world. 
 Unicode provides a unique number for every character. 
 Except Klingon!  
؟ "يونِكود"ما هيالشفرة الموحدة 
Unicode nedir? 
Τι είναι το Unicode 
Cos'è Unicode? 
유니코드에 대해? 
Что такое Unicode?
Unicode (cont.) 
 Why do we need to use Unicode? 
 Avoids data corruption 
 Single encoding for text in all languages 
 Makes software globalization possible 
 Vastly reduces development cost 
 Vastly reduces maintenance, update and support cost 
 Switching to Unicode has no disadvantages for single language 
users, to the contrary it usually offers advantages even for single 
language users. And it offers great advantages for multilingual 
users. 
 Encoding: Use Unicode wherever possible for content, 
databases, etc. Always declare the encoding of content.
i18N & web technologies 
i18N & Web
Unicode & Files 
 UTF-8 is the recommended encoding for files. 
 Use a Unicode capable editor (IDE) 
 ColdFusion/Flash Builder 
 Default encoding is UTF-8 
 Eclipse 
 Default encoding is Cp1252 
 Change it into UTF-8 
 Window-> Preferences -> General -> Workspace 
 Text file encoding 
 No BOM creation 
 OK for current files with BOM
Unicode & Files (cont.) 
 Dreamweaver 
 Supports full Unicode when selected 
 Support BOM (Byte Order Mark) 
 Homesite/CFStudio Never! 
http://www.adobe.com/go/tn_19059 
 Notepad 
 The best tool! 
Unicode & Database 
 Use a robust database with right settings 
 MS SQL Server 
 MySQL Server 
 PostgreSQL Server 
 Oracle 
 Beware of Unicode Support 
 MySQL 4.1 and up 
default-character-set=utf8 
character-set-server = utf8 
collation-server = utf8_general_ci 
 MS SQL Server 
 SQL Server nvarchar, ntext etc.
i18N & CFML Platform 
i18N & CFML
ColdFusion History 
 Supports Unicode starting from ColdFusion MX 
 Use ColdFusion MX 
 If possible ColdFusion MX 7.x and up 
 Use Updated JVM 
 Set Required Locale
ColdFusion & Databases 
 Use DSN Settings 
 MS SQL Server 
 String Format 
 Enable High ASCII characters and Unicode for data sources 
configured for non-Latin characters 
 MySQL 
 Select MySQL 4/5 driver
ColdFusion & Files 
 Use Unicode 
 If possible with BOM support 
 ColdFusion MX Detects BOM 
 If you have BOM support on your file ColdFusion 
understand your locale and there is no need to use extra 
tags such as cfprocessingdirective
ColdFusion & Files 
 ColdFusion MX Templates 
 If there is no BOM 
<cfprocessingdirective pageencoding="utf-8"> 
must be included in every CFM template. 
 Using in Application.cfm or cfc etc. does not help
ColdFusion & Tags & Functions 
 Beware of ColdFusion Functions & Tags 
 CFPROCESSINGDIRECTIVE, CFCONTENT, CFFILE, CFHEADER, CFHTTP, 
CFHTTPPARAM, CFMAIL, CFMAILPART tags and the SETENCODING, 
GETENCODING, TOBASE64, TOSTRING, URLDECODE, and URLENCODEDFORMAT 
functions etc. 
 Use encoding in Tags 
<cfmail to="#user#" from="#me#" subject="Unicode Test" charset="utf-8"> 
<cfmailpart charset="utf-8" type="plain“>#mymailasplaintext# 
</cfmailpart> 
<cfmailpart charset="utf-8" type="html“>#mymailashtml# 
</cfmailpart> 
</cfmail>
HTML & i18N 
 Multipart POST 
<form action="#FOO#“ method="post" 
enctype="multipart/form-data: charset=utf-8“> 
 HTML/XHTML 
<meta http-equiv="Content-Type" content="text/html; 
charset=utf-8" /> 
 Detect Locale 
 cgi.HTTP_ACCEPT_LANGUAGE 
 IP & GeoLocator
Code & Language Isolation 
 MVC Benefits 
 Java Resource Bundles 
 JRB General usage with CFCs 
 IBM ICU4J Library 
 GNU GetText () 
 Database 
 XML
Java Resource Bundles 
 Resource Bundle Tools 
 RM Manager (http://www.icu-project. 
org/repos/icu/tools/trunk/unicodetools/com/ibm/ 
rbm/docs/index.html) 
 Attesoro (attesoro.org) 
 Eclipse Plugin (sourceforge.net/projects/eclipse-rbe/) 
 Web based (www.jmpj.net/rbMan/)
i18N in ColdBox 
 ColdBox has an i18N plugin 
based on Java Resource Bundles 
http://wiki.coldbox.org/wiki/I18n.cfm
ColdBox config changes: 
//i18n & Localization 
i18n = { 
defaultResourceBundle = "includes/i18N/main", 
defaultLocale = "en_US", 
localeStorage = "session", // default session, cookie, client, session, request 
unknownTranslation = "**NOT FOUND**" 
}; 
Activating i18N Support
Loading Plugins 
 Base i18N Plugin 
getPlugin("i18n") 
 Resource Bundle Plugin 
getPlugin("resourceBundle")
Base i18N Methods 
 Get user’s current locale 
getfwLocale() 
Get the current user's locale from the locale storage 
 Set a specific locale 
setFWLocale( valid_locale ) 
Set the current user's locale, internally it uses the locale storage 
assigned 
 getResource(resource, [default], [locale], [values]) 
Get a language resource from the default user's locale or a 
specific locale and even do array/struct/string replacements via 
positional or named {} patterns: {1}, {2}, {username}, {lastName}
Prc Scope Usage 
 Prc scope usage 
function onRequestStart(event,rc,prc) { 
prc.i18n = getPlugin("i18n"); 
} 
A common practice for localized applications is to store a 
reference to the i18n plugin object in the prc scope for easy 
access throughout your application so you are not constantly 
calling getPlugin("i18n") all over the place if you need to rely 
heavily on i18n methods. 
This is a performance optimization best practice.
// function change a user's locale 
function changeLocale(event,rc,prc) { 
setFwlocale(rc.locale); 
setNextEvent('home‘); 
} 
<cffunction name="doChangeLocale" access="public" returntype="void" 
output="false"> 
<cfargument name="event" type="any"> 
<--- Change Locale ---> 
<cfset getPlugin("i18n").setfwLocale(event.getValue("locale"))> 
<cfset event.setNextEvent('main.home')> 
</cffunction> 
Changing Locale
i18N Methods 
 getLocales(), isValidLocale() 
 getISOlanguages(), showLanguage() 
 getISOcountries(), showCountry(), showISOCounty() 
 getAvailableTZ(), getServerTZ(), i18nDateTimeFormat(), i18nDateFormat(), 
i18nTimeFormat(), getLocaleQuery(), getTZQuery(), getTZDisplayName() , 
usesDST(), getDST(), inDST() 
 i18nDateAdd(), i18nDateDiff() 
 isBidi() 
 getCurrencySymbol(), getDecimalSymbols()
Sample Method Usage 
rc.now = getPlugin("i18n").toEpoch(now()); 
rc.locales = getPlugin("i18n").getLocales(); 
rc.lang = getPlugin("i18n").showLanguage(); 
rc.country = getPlugin("i18n").showCountry(); 
rc.timeZones = getPlugin("i18n").getAvailableTZ(); 
rc.serverTZ = getPlugin("i18n").getServerTZ(); 
rc.laterOn = getPlugin("i18n").i18nDateAdd(rc.now,"hour",hours,rc.thisTZ); 
rc.usesDST = getPlugin("i18n").usesDST(rc.thisTZ); 
if (rc.usesDST) rc.inDST=getPlugin("i18n").inDST(rc.now,rc.thisTZ); 
rc.tDate=getPlugin("i18n").i18nDateFormat(rc.now,rc.dateF,rc.thisTZ); 
rc.tDateTime=getPlugin("i18n").i18nDateTimeFormat(rc.now,rc.dateF,rc.timeF,rc.thisTZ); 
rc.tzOffset=getPlugin("i18n").getTZOffset(rc.now,rc.thisTZ);
Using Resource Bundle 
 Get basic resource based on default or a specific locale 
getResource(resource,[default],[locale]) 
#getresource("login")# // gets the login content for active locale 
 Get complex resource 
<cfscript> 
oRB = getPlugin("resourceBundle"); 
footerParams = ["Oğuz Demirkapı", "http://blog.demirkapi.net"]; 
</cfscript> 
#oRB.formatRBString(getResource('footerNote'),footerParams)#
Parameters in Resource 
 <cfset oRB = getPlugin("resourceBundle")> 
 <cfset orderDetails = ArrayNew(1)> 
 <cfset orderDetails[1] = "Luis Majano"> 
 <cfset orderDetails[2] = "1-800-CallOrtus"> 
 <cfoutput>#oRB.formatRBString(getResource('confir 
mMessage'),orderDetails)#</cfoutput>
DEMO
Designing i18N Application 
i18N Application Design
Content Structure 
 Same content in every locale 
 Mirroring sites 
 Isolated templates and contents 
 Different content tree in different locales 
 Roots for trees 
 Complex tree referencing
Database Modeling 
 Designing Database 
 Locale definitions 
 Content related pages have a flag field as locale. 
 Lookup tables have i18N key in table and gets the content from RB 
tools 
 Tables vs. Fields 
 Creating flags for any locale based content would be best practice 
instead of creating different tables. 
 Content Types 
 Isolating localized content 
 All content should be isolated in specific locales 
 Saving localized content 
 A localization manager would be a proper tool
Sample i18N Applications 
 ContentBox (http://gocontentbox.org) 
 MuraCMS (http://getmura.com) 
 FarCry Core (http://farcrycore.org) 
 ColdBox (http://coldbox.org) 
 CFWheels (http://cfwheels.org)
 Unicode 
Resources 
 http://unicode.org 
 Adobe Developer Center 
 http://www.adobe.com/devnet/coldfusion/localization_globalizatio 
n.html 
 Globalizing ColdFusionMX (Paul Hastings) 
 http://www.sustainablegis.com/blog/cfg11n/ 
 RBMan 
 http://rbman.riaforge.org 
 ColdBox Wiki 
 http://wiki.coldbox.org/wiki/I18n.cfm 
 My blog 
 http://blog.demirkapi.net
Questions & Answers 
? 
Oğuz Demirkapı 
http://blog.demirkapi.net 
demirkapi+ColdBox@gmail.com

More Related Content

What's hot

Computer Programming Overview
Computer Programming OverviewComputer Programming Overview
Computer Programming Overviewagorolabs
 
Everything multilingual in Drupal 8 (2015 November)
Everything multilingual in Drupal 8 (2015 November)Everything multilingual in Drupal 8 (2015 November)
Everything multilingual in Drupal 8 (2015 November)Gábor Hojtsy
 
Ndu06 typesof language
Ndu06 typesof languageNdu06 typesof language
Ndu06 typesof languagenicky_walters
 
The Ring programming language version 1.2 book - Part 4 of 84
The Ring programming language version 1.2 book - Part 4 of 84The Ring programming language version 1.2 book - Part 4 of 84
The Ring programming language version 1.2 book - Part 4 of 84Mahmoud Samir Fayed
 
Overview new programming languages
Overview new programming languagesOverview new programming languages
Overview new programming languagesumoren
 
PIL - A Platform Independent Language
PIL - A Platform Independent LanguagePIL - A Platform Independent Language
PIL - A Platform Independent Languagezefhemel
 
Source-to-Source Compiler
Source-to-Source CompilerSource-to-Source Compiler
Source-to-Source CompilerMintoo Jakhmola
 
Introduction to c_sharp
Introduction to c_sharpIntroduction to c_sharp
Introduction to c_sharpHEM Sothon
 
蔡学镛 Rebol漫谈
蔡学镛   Rebol漫谈蔡学镛   Rebol漫谈
蔡学镛 Rebol漫谈d0nn9n
 
The Ring programming language version 1.3 book - Part 4 of 88
The Ring programming language version 1.3 book - Part 4 of 88The Ring programming language version 1.3 book - Part 4 of 88
The Ring programming language version 1.3 book - Part 4 of 88Mahmoud Samir Fayed
 
3. Introduction to C language ||Learn C Programming Complete.
3. Introduction to C language ||Learn C Programming Complete.3. Introduction to C language ||Learn C Programming Complete.
3. Introduction to C language ||Learn C Programming Complete.Fiaz Hussain
 
The Ring programming language version 1.4.1 book - Part 2 of 31
The Ring programming language version 1.4.1 book - Part 2 of 31The Ring programming language version 1.4.1 book - Part 2 of 31
The Ring programming language version 1.4.1 book - Part 2 of 31Mahmoud Samir Fayed
 
Emscripten - compile your C/C++ to JavaScript
Emscripten - compile your C/C++ to JavaScriptEmscripten - compile your C/C++ to JavaScript
Emscripten - compile your C/C++ to JavaScript穎睿 梁
 
Developing Multilingual Applications
Developing Multilingual ApplicationsDeveloping Multilingual Applications
Developing Multilingual ApplicationsPriyank Kapadia
 
A whole new world for multilingual sites in Drupal 8 - jam's Drupal Camp session
A whole new world for multilingual sites in Drupal 8 - jam's Drupal Camp sessionA whole new world for multilingual sites in Drupal 8 - jam's Drupal Camp session
A whole new world for multilingual sites in Drupal 8 - jam's Drupal Camp sessionJeffrey McGuire
 
Building scalable and language-independent Java services using Apache Thrift ...
Building scalable and language-independent Java services using Apache Thrift ...Building scalable and language-independent Java services using Apache Thrift ...
Building scalable and language-independent Java services using Apache Thrift ...IndicThreads
 

What's hot (20)

Programming names
Programming namesProgramming names
Programming names
 
Programing Language
Programing LanguagePrograming Language
Programing Language
 
Computer Programming Overview
Computer Programming OverviewComputer Programming Overview
Computer Programming Overview
 
HTTP Potpourri
HTTP PotpourriHTTP Potpourri
HTTP Potpourri
 
Everything multilingual in Drupal 8 (2015 November)
Everything multilingual in Drupal 8 (2015 November)Everything multilingual in Drupal 8 (2015 November)
Everything multilingual in Drupal 8 (2015 November)
 
Ndu06 typesof language
Ndu06 typesof languageNdu06 typesof language
Ndu06 typesof language
 
Lecture # 1
Lecture # 1Lecture # 1
Lecture # 1
 
The Ring programming language version 1.2 book - Part 4 of 84
The Ring programming language version 1.2 book - Part 4 of 84The Ring programming language version 1.2 book - Part 4 of 84
The Ring programming language version 1.2 book - Part 4 of 84
 
Overview new programming languages
Overview new programming languagesOverview new programming languages
Overview new programming languages
 
PIL - A Platform Independent Language
PIL - A Platform Independent LanguagePIL - A Platform Independent Language
PIL - A Platform Independent Language
 
Source-to-Source Compiler
Source-to-Source CompilerSource-to-Source Compiler
Source-to-Source Compiler
 
Introduction to c_sharp
Introduction to c_sharpIntroduction to c_sharp
Introduction to c_sharp
 
蔡学镛 Rebol漫谈
蔡学镛   Rebol漫谈蔡学镛   Rebol漫谈
蔡学镛 Rebol漫谈
 
The Ring programming language version 1.3 book - Part 4 of 88
The Ring programming language version 1.3 book - Part 4 of 88The Ring programming language version 1.3 book - Part 4 of 88
The Ring programming language version 1.3 book - Part 4 of 88
 
3. Introduction to C language ||Learn C Programming Complete.
3. Introduction to C language ||Learn C Programming Complete.3. Introduction to C language ||Learn C Programming Complete.
3. Introduction to C language ||Learn C Programming Complete.
 
The Ring programming language version 1.4.1 book - Part 2 of 31
The Ring programming language version 1.4.1 book - Part 2 of 31The Ring programming language version 1.4.1 book - Part 2 of 31
The Ring programming language version 1.4.1 book - Part 2 of 31
 
Emscripten - compile your C/C++ to JavaScript
Emscripten - compile your C/C++ to JavaScriptEmscripten - compile your C/C++ to JavaScript
Emscripten - compile your C/C++ to JavaScript
 
Developing Multilingual Applications
Developing Multilingual ApplicationsDeveloping Multilingual Applications
Developing Multilingual Applications
 
A whole new world for multilingual sites in Drupal 8 - jam's Drupal Camp session
A whole new world for multilingual sites in Drupal 8 - jam's Drupal Camp sessionA whole new world for multilingual sites in Drupal 8 - jam's Drupal Camp session
A whole new world for multilingual sites in Drupal 8 - jam's Drupal Camp session
 
Building scalable and language-independent Java services using Apache Thrift ...
Building scalable and language-independent Java services using Apache Thrift ...Building scalable and language-independent Java services using Apache Thrift ...
Building scalable and language-independent Java services using Apache Thrift ...
 

Viewers also liked

TIPS for making Video Resume effectively , simple but eefective.
TIPS for making Video Resume effectively , simple but eefective.TIPS for making Video Resume effectively , simple but eefective.
TIPS for making Video Resume effectively , simple but eefective.girishklk
 
Effective CV Making (by Amin Nasrullah)
Effective CV Making (by Amin Nasrullah)Effective CV Making (by Amin Nasrullah)
Effective CV Making (by Amin Nasrullah)Amin Nasrullah
 
Tips in Making Impressive CV
Tips in Making Impressive CVTips in Making Impressive CV
Tips in Making Impressive CVEka Putra
 
Ferrous Metal and Non-Ferrous Metal for Design and Technology
Ferrous Metal and Non-Ferrous Metal for Design and TechnologyFerrous Metal and Non-Ferrous Metal for Design and Technology
Ferrous Metal and Non-Ferrous Metal for Design and Technologyzoolzaza
 
Photograph techniques
Photograph techniques Photograph techniques
Photograph techniques cocknoodle456
 
Resume - Electrical Engineer (MEP) 9+ Years Exp
Resume - Electrical Engineer (MEP) 9+ Years ExpResume - Electrical Engineer (MEP) 9+ Years Exp
Resume - Electrical Engineer (MEP) 9+ Years ExpSubhash +966535838322
 
Metals - Ferrous and Non Ferrous
Metals - Ferrous and Non FerrousMetals - Ferrous and Non Ferrous
Metals - Ferrous and Non Ferrousfjpwhelan
 
design electrical engineer cv
design electrical engineer cvdesign electrical engineer cv
design electrical engineer cvsaryhasabadly
 

Viewers also liked (14)

TIPS for making Video Resume effectively , simple but eefective.
TIPS for making Video Resume effectively , simple but eefective.TIPS for making Video Resume effectively , simple but eefective.
TIPS for making Video Resume effectively , simple but eefective.
 
Effective CV Making (by Amin Nasrullah)
Effective CV Making (by Amin Nasrullah)Effective CV Making (by Amin Nasrullah)
Effective CV Making (by Amin Nasrullah)
 
Cv Making
Cv MakingCv Making
Cv Making
 
How to make CV Resume
How to make CV ResumeHow to make CV Resume
How to make CV Resume
 
Tips in Making Impressive CV
Tips in Making Impressive CVTips in Making Impressive CV
Tips in Making Impressive CV
 
Ferrous Metal and Non-Ferrous Metal for Design and Technology
Ferrous Metal and Non-Ferrous Metal for Design and TechnologyFerrous Metal and Non-Ferrous Metal for Design and Technology
Ferrous Metal and Non-Ferrous Metal for Design and Technology
 
Photograph techniques
Photograph techniques Photograph techniques
Photograph techniques
 
Paint
PaintPaint
Paint
 
Paints
PaintsPaints
Paints
 
Paints And its types
Paints And its typesPaints And its types
Paints And its types
 
ELECTRICAL ENGINEER CV
ELECTRICAL ENGINEER CVELECTRICAL ENGINEER CV
ELECTRICAL ENGINEER CV
 
Resume - Electrical Engineer (MEP) 9+ Years Exp
Resume - Electrical Engineer (MEP) 9+ Years ExpResume - Electrical Engineer (MEP) 9+ Years Exp
Resume - Electrical Engineer (MEP) 9+ Years Exp
 
Metals - Ferrous and Non Ferrous
Metals - Ferrous and Non FerrousMetals - Ferrous and Non Ferrous
Metals - Ferrous and Non Ferrous
 
design electrical engineer cv
design electrical engineer cvdesign electrical engineer cv
design electrical engineer cv
 

Similar to ColdBox i18N

Software Internationalization Crash Course
Software Internationalization Crash CourseSoftware Internationalization Crash Course
Software Internationalization Crash CourseWill Iverson
 
Embedded firmware
Embedded firmwareEmbedded firmware
Embedded firmwareJoel P
 
Internationalize your JavaScript Application: Prepare for "the next billion" ...
Internationalize your JavaScript Application: Prepare for "the next billion" ...Internationalize your JavaScript Application: Prepare for "the next billion" ...
Internationalize your JavaScript Application: Prepare for "the next billion" ...Kevin Hakanson
 
Net framework
Net frameworkNet framework
Net frameworkjhsri
 
jhkghj
jhkghjjhkghj
jhkghjAdmin
 
test2PPT
test2PPTtest2PPT
test2PPTAdmin
 
Zend framework 06 - zend config, pdf, i18n, l10n, sessions
Zend framework 06 - zend config, pdf, i18n, l10n, sessionsZend framework 06 - zend config, pdf, i18n, l10n, sessions
Zend framework 06 - zend config, pdf, i18n, l10n, sessionsTricode (part of Dept)
 
.NET Core, ASP.NET Core Course, Session 3
.NET Core, ASP.NET Core Course, Session 3.NET Core, ASP.NET Core Course, Session 3
.NET Core, ASP.NET Core Course, Session 3aminmesbahi
 
Localization (l10n) - The Process
Localization (l10n) - The ProcessLocalization (l10n) - The Process
Localization (l10n) - The ProcessSundeep Anand
 
Lecture 1 introduction to language processors
Lecture 1  introduction to language processorsLecture 1  introduction to language processors
Lecture 1 introduction to language processorsRebaz Najeeb
 

Similar to ColdBox i18N (20)

Software Internationalization Crash Course
Software Internationalization Crash CourseSoftware Internationalization Crash Course
Software Internationalization Crash Course
 
Asp dot net
Asp dot netAsp dot net
Asp dot net
 
Synapse india reviews sharing asp.net
Synapse india reviews sharing  asp.netSynapse india reviews sharing  asp.net
Synapse india reviews sharing asp.net
 
Embedded firmware
Embedded firmwareEmbedded firmware
Embedded firmware
 
Asp net
Asp netAsp net
Asp net
 
Internationalize your JavaScript Application: Prepare for "the next billion" ...
Internationalize your JavaScript Application: Prepare for "the next billion" ...Internationalize your JavaScript Application: Prepare for "the next billion" ...
Internationalize your JavaScript Application: Prepare for "the next billion" ...
 
Introduction to .net
Introduction to .netIntroduction to .net
Introduction to .net
 
Net framework
Net frameworkNet framework
Net framework
 
jhkghj
jhkghjjhkghj
jhkghj
 
test2PPT
test2PPTtest2PPT
test2PPT
 
Asp net
Asp netAsp net
Asp net
 
Tml for Objective C
Tml for Objective CTml for Objective C
Tml for Objective C
 
Zend framework 06 - zend config, pdf, i18n, l10n, sessions
Zend framework 06 - zend config, pdf, i18n, l10n, sessionsZend framework 06 - zend config, pdf, i18n, l10n, sessions
Zend framework 06 - zend config, pdf, i18n, l10n, sessions
 
.NET Core, ASP.NET Core Course, Session 3
.NET Core, ASP.NET Core Course, Session 3.NET Core, ASP.NET Core Course, Session 3
.NET Core, ASP.NET Core Course, Session 3
 
.net framework
.net framework.net framework
.net framework
 
Localization (l10n) - The Process
Localization (l10n) - The ProcessLocalization (l10n) - The Process
Localization (l10n) - The Process
 
Microsoft .NET Framework
Microsoft .NET FrameworkMicrosoft .NET Framework
Microsoft .NET Framework
 
Net Interview questions
Net Interview questionsNet Interview questions
Net Interview questions
 
Lecture 1 introduction to language processors
Lecture 1  introduction to language processorsLecture 1  introduction to language processors
Lecture 1 introduction to language processors
 
.Net overview
.Net overview.Net overview
.Net overview
 

Recently uploaded

Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprisepreethippts
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtimeandrehoraa
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationBradBedford3
 
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfStefano Stabellini
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfFerryKemperman
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfMarharyta Nedzelska
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odishasmiwainfosol
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Velvetech LLC
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样umasea
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...confluent
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Natan Silnitsky
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Hr365.us smith
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanyChristoph Pohl
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based projectAnoyGreter
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfAlina Yurenko
 
Buds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in NoidaBuds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in Noidabntitsolutionsrishis
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commercemanigoyal112
 

Recently uploaded (20)

Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprise
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtime
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion Application
 
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdf
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdf
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdf
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based project
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
 
Buds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in NoidaBuds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in Noida
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commerce
 

ColdBox i18N

  • 1.
  • 2. About Me  Working & living in İstanbul  Coding since ‘85, CGI Programming since ’94 (Perl, C/C++)  ColdFusion Developer since ’97  Interested in ColdFusion, Flex, AIR, Ruby, Ajax, Frameworks, i18N, L10N, G11N, Geolocation  Created projects in more than 20 languages!   Have big interest in Epistemology  Personal blog: http://blog.demirkapi.net
  • 3. Getting basics on i18N Theory
  • 4. Do we need multilingualism?  Yes!
  • 5. Why i18N (Internationalization)?  English is just another language.  The World Wide Web should be truly world-wide!  Internationalization is important to ensure that users worldwide can equally benefit from Web technology.  Wide diversity world-wide:  Scripts (Latin, Cyrillic, Hebrew, Tamil, Katakana,...)  Languages (English, German, Turkish, Korean, Japanese,...)  Typographic conventions  Cultural conventions  Political circumstances  Avoid fragmentation of specifications due to localization.  Make sure internationalization is done at the right place.
  • 6.  What is i18N (Internationalization)?  Application functions in at least two locales  What is L10N (Localization)?  Process of applying a locale or language "skin" to an I18N application  What is G11N (Globalization)?  i18N & L10N What is …?
  • 7. Internationalization & Localization Globalization  Single character set  Single executable  Single install  Single server serves all clients in all languages Localization  Based on globalized software  Adds specific translations and adaptations for particular languages and markets Globalized software can be localized without any code changes
  • 8. Character encoding Character encoding specifies mappings from a character set to the integer numbers that represent the characters on a computer.  EUC-JP (Japanese)  EUC-KR (Korean)  ISO-8859-1 (Western European and English)  SHIFT_JIS (Japanese)  UTF-8 (All Languages)
  • 9. What is Locale? The combination of a language and a country code  en_US: US English (color, $)  en_GB: British English (colour, £)  de_CH: German in Switzerland  tr_TR: Turkish in Turkey
  • 10. Selecting/Detecting Locale  Manual  Default locale can be loaded and other options would be available by selection via buttons/selects etc.  Locale Detection  Parsing ‘Accept-Language’ header on HTTP request  Not usable with URLLoader  Capabilities.language property in Flash Player and AIR  Parsing browser and OS language settings via JavaScript  Location detection depending on IP
  • 11. What is Unicode?  Unicode (unicode.org) is an character set for all the characters and symbols of the world.  Unicode provides a unique number for every character.  Except Klingon!  ؟ "يونِكود"ما هيالشفرة الموحدة Unicode nedir? Τι είναι το Unicode Cos'è Unicode? 유니코드에 대해? Что такое Unicode?
  • 12. Unicode (cont.)  Why do we need to use Unicode?  Avoids data corruption  Single encoding for text in all languages  Makes software globalization possible  Vastly reduces development cost  Vastly reduces maintenance, update and support cost  Switching to Unicode has no disadvantages for single language users, to the contrary it usually offers advantages even for single language users. And it offers great advantages for multilingual users.  Encoding: Use Unicode wherever possible for content, databases, etc. Always declare the encoding of content.
  • 13. i18N & web technologies i18N & Web
  • 14. Unicode & Files  UTF-8 is the recommended encoding for files.  Use a Unicode capable editor (IDE)  ColdFusion/Flash Builder  Default encoding is UTF-8  Eclipse  Default encoding is Cp1252  Change it into UTF-8  Window-> Preferences -> General -> Workspace  Text file encoding  No BOM creation  OK for current files with BOM
  • 15. Unicode & Files (cont.)  Dreamweaver  Supports full Unicode when selected  Support BOM (Byte Order Mark)  Homesite/CFStudio Never! http://www.adobe.com/go/tn_19059  Notepad  The best tool! 
  • 16. Unicode & Database  Use a robust database with right settings  MS SQL Server  MySQL Server  PostgreSQL Server  Oracle  Beware of Unicode Support  MySQL 4.1 and up default-character-set=utf8 character-set-server = utf8 collation-server = utf8_general_ci  MS SQL Server  SQL Server nvarchar, ntext etc.
  • 17. i18N & CFML Platform i18N & CFML
  • 18. ColdFusion History  Supports Unicode starting from ColdFusion MX  Use ColdFusion MX  If possible ColdFusion MX 7.x and up  Use Updated JVM  Set Required Locale
  • 19. ColdFusion & Databases  Use DSN Settings  MS SQL Server  String Format  Enable High ASCII characters and Unicode for data sources configured for non-Latin characters  MySQL  Select MySQL 4/5 driver
  • 20. ColdFusion & Files  Use Unicode  If possible with BOM support  ColdFusion MX Detects BOM  If you have BOM support on your file ColdFusion understand your locale and there is no need to use extra tags such as cfprocessingdirective
  • 21. ColdFusion & Files  ColdFusion MX Templates  If there is no BOM <cfprocessingdirective pageencoding="utf-8"> must be included in every CFM template.  Using in Application.cfm or cfc etc. does not help
  • 22. ColdFusion & Tags & Functions  Beware of ColdFusion Functions & Tags  CFPROCESSINGDIRECTIVE, CFCONTENT, CFFILE, CFHEADER, CFHTTP, CFHTTPPARAM, CFMAIL, CFMAILPART tags and the SETENCODING, GETENCODING, TOBASE64, TOSTRING, URLDECODE, and URLENCODEDFORMAT functions etc.  Use encoding in Tags <cfmail to="#user#" from="#me#" subject="Unicode Test" charset="utf-8"> <cfmailpart charset="utf-8" type="plain“>#mymailasplaintext# </cfmailpart> <cfmailpart charset="utf-8" type="html“>#mymailashtml# </cfmailpart> </cfmail>
  • 23. HTML & i18N  Multipart POST <form action="#FOO#“ method="post" enctype="multipart/form-data: charset=utf-8“>  HTML/XHTML <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />  Detect Locale  cgi.HTTP_ACCEPT_LANGUAGE  IP & GeoLocator
  • 24. Code & Language Isolation  MVC Benefits  Java Resource Bundles  JRB General usage with CFCs  IBM ICU4J Library  GNU GetText ()  Database  XML
  • 25. Java Resource Bundles  Resource Bundle Tools  RM Manager (http://www.icu-project. org/repos/icu/tools/trunk/unicodetools/com/ibm/ rbm/docs/index.html)  Attesoro (attesoro.org)  Eclipse Plugin (sourceforge.net/projects/eclipse-rbe/)  Web based (www.jmpj.net/rbMan/)
  • 26. i18N in ColdBox  ColdBox has an i18N plugin based on Java Resource Bundles http://wiki.coldbox.org/wiki/I18n.cfm
  • 27. ColdBox config changes: //i18n & Localization i18n = { defaultResourceBundle = "includes/i18N/main", defaultLocale = "en_US", localeStorage = "session", // default session, cookie, client, session, request unknownTranslation = "**NOT FOUND**" }; Activating i18N Support
  • 28. Loading Plugins  Base i18N Plugin getPlugin("i18n")  Resource Bundle Plugin getPlugin("resourceBundle")
  • 29. Base i18N Methods  Get user’s current locale getfwLocale() Get the current user's locale from the locale storage  Set a specific locale setFWLocale( valid_locale ) Set the current user's locale, internally it uses the locale storage assigned  getResource(resource, [default], [locale], [values]) Get a language resource from the default user's locale or a specific locale and even do array/struct/string replacements via positional or named {} patterns: {1}, {2}, {username}, {lastName}
  • 30. Prc Scope Usage  Prc scope usage function onRequestStart(event,rc,prc) { prc.i18n = getPlugin("i18n"); } A common practice for localized applications is to store a reference to the i18n plugin object in the prc scope for easy access throughout your application so you are not constantly calling getPlugin("i18n") all over the place if you need to rely heavily on i18n methods. This is a performance optimization best practice.
  • 31. // function change a user's locale function changeLocale(event,rc,prc) { setFwlocale(rc.locale); setNextEvent('home‘); } <cffunction name="doChangeLocale" access="public" returntype="void" output="false"> <cfargument name="event" type="any"> <--- Change Locale ---> <cfset getPlugin("i18n").setfwLocale(event.getValue("locale"))> <cfset event.setNextEvent('main.home')> </cffunction> Changing Locale
  • 32. i18N Methods  getLocales(), isValidLocale()  getISOlanguages(), showLanguage()  getISOcountries(), showCountry(), showISOCounty()  getAvailableTZ(), getServerTZ(), i18nDateTimeFormat(), i18nDateFormat(), i18nTimeFormat(), getLocaleQuery(), getTZQuery(), getTZDisplayName() , usesDST(), getDST(), inDST()  i18nDateAdd(), i18nDateDiff()  isBidi()  getCurrencySymbol(), getDecimalSymbols()
  • 33. Sample Method Usage rc.now = getPlugin("i18n").toEpoch(now()); rc.locales = getPlugin("i18n").getLocales(); rc.lang = getPlugin("i18n").showLanguage(); rc.country = getPlugin("i18n").showCountry(); rc.timeZones = getPlugin("i18n").getAvailableTZ(); rc.serverTZ = getPlugin("i18n").getServerTZ(); rc.laterOn = getPlugin("i18n").i18nDateAdd(rc.now,"hour",hours,rc.thisTZ); rc.usesDST = getPlugin("i18n").usesDST(rc.thisTZ); if (rc.usesDST) rc.inDST=getPlugin("i18n").inDST(rc.now,rc.thisTZ); rc.tDate=getPlugin("i18n").i18nDateFormat(rc.now,rc.dateF,rc.thisTZ); rc.tDateTime=getPlugin("i18n").i18nDateTimeFormat(rc.now,rc.dateF,rc.timeF,rc.thisTZ); rc.tzOffset=getPlugin("i18n").getTZOffset(rc.now,rc.thisTZ);
  • 34. Using Resource Bundle  Get basic resource based on default or a specific locale getResource(resource,[default],[locale]) #getresource("login")# // gets the login content for active locale  Get complex resource <cfscript> oRB = getPlugin("resourceBundle"); footerParams = ["Oğuz Demirkapı", "http://blog.demirkapi.net"]; </cfscript> #oRB.formatRBString(getResource('footerNote'),footerParams)#
  • 35. Parameters in Resource  <cfset oRB = getPlugin("resourceBundle")>  <cfset orderDetails = ArrayNew(1)>  <cfset orderDetails[1] = "Luis Majano">  <cfset orderDetails[2] = "1-800-CallOrtus">  <cfoutput>#oRB.formatRBString(getResource('confir mMessage'),orderDetails)#</cfoutput>
  • 36. DEMO
  • 37. Designing i18N Application i18N Application Design
  • 38. Content Structure  Same content in every locale  Mirroring sites  Isolated templates and contents  Different content tree in different locales  Roots for trees  Complex tree referencing
  • 39. Database Modeling  Designing Database  Locale definitions  Content related pages have a flag field as locale.  Lookup tables have i18N key in table and gets the content from RB tools  Tables vs. Fields  Creating flags for any locale based content would be best practice instead of creating different tables.  Content Types  Isolating localized content  All content should be isolated in specific locales  Saving localized content  A localization manager would be a proper tool
  • 40. Sample i18N Applications  ContentBox (http://gocontentbox.org)  MuraCMS (http://getmura.com)  FarCry Core (http://farcrycore.org)  ColdBox (http://coldbox.org)  CFWheels (http://cfwheels.org)
  • 41.  Unicode Resources  http://unicode.org  Adobe Developer Center  http://www.adobe.com/devnet/coldfusion/localization_globalizatio n.html  Globalizing ColdFusionMX (Paul Hastings)  http://www.sustainablegis.com/blog/cfg11n/  RBMan  http://rbman.riaforge.org  ColdBox Wiki  http://wiki.coldbox.org/wiki/I18n.cfm  My blog  http://blog.demirkapi.net
  • 42. Questions & Answers ? Oğuz Demirkapı http://blog.demirkapi.net demirkapi+ColdBox@gmail.com