SlideShare une entreprise Scribd logo
1  sur  68
Télécharger pour lire hors ligne
BP 208: Uno! Deux! Three!
Making Localization of XPages
Apps as Easy as 1-2-3

Brad Balassaitis, PSC Group
Kathy Brown, PSC Group

© 2014 IBM Corporation
¿quiénes somos (Who are we?)
▪ Brad Balassaitis
– PSC Group, LLC
– Blogger, Author, Wordfeud Addict
– IBM Champion for IBM Collaboration Solutions
– @Balassaitis
– xcellerant.net

!

▪ Kathy Brown
– PSC Group, LLC
– Blogger, Author, Runner, Geek, and Loud Laugher
– IBM Champion for IBM Collaboration Solutions
– @RunningKathy
– runningnotes.net

2
Perché Questa Sessione (Why This Session)
▪ The enterprise is global
▪ We will demonstrate:
– what is built-in
– what is NOT built-in
▪ How to do both
▪ Special considerations, tips, and gotchas

3
As Easy As 1-2-3
▪ 1. Enabling Localization
▪ 2. Using Built-In Localization
▪ 3. Improving Localization

4
1. Enabling Localization

5
Enabling Localization
▪ Enable Localization Support
▪ Generate Localized Resource Bundles
▪ Verify Localization Support

6
I. Enable Localization Support

▪ Application Properties > XPages > Localization Options
▪ Select Enable Localization
▪ Add languages (including native language)
▪ Set Source language (development)
▪ Set Default language (display)

7
I. Enable Localization Support


8
Google App Languages
▪ Klingon

!
▪ Hacker

!
▪ Pirate

!
▪ Elmer Fudd

!
▪ Bork, Bork, Bork

9
I. Enable Localization Support


8
Region Codes
▪ Allow for regionalized translations of the same language
▪ Example:
– en
– en_US
– en_GB

11
I. Enable Localization Support


!

12
I. Enable Localization Support


!

13
Region Codes
▪ Allow for regionalized translations of the same language
▪ Example:
– en
– en_US
– en_GB

14
II. Generate Localized Resource Bundles

▪ Clean and Build
▪ Verify via Package Explorer

9
II. Generate Localized Resource Bundles

▪ Optionally verify in Java source
– Package Explorer > [db] > local > xsp > pageName.java
▪ Java Source for a Label (Before)

!
private UIComponent createLabel1(FacesContext context, UIComponent
parent, PageExpressionEvaluator evaluator) {
XspOutputLabel result = new XspOutputLabel();
result.setValue("Front End ");
setId(result, "label1");
return result;
}
10
II. Generate Localized Resource Bundles

▪ Java Source for a Label (After)

!
private UIComponent createLabel1(FacesContext context, UIComponent
parent, PageExpressionEvaluator evaluator) {
XspOutputLabel result = new XspOutputLabel();
result.setValue(_currentLocale[55]);
setId(result, "label1");
return result;
}

11
III. Verify Localization Support

▪ Set the browser to different supported languages and look for default translations

12
2. Using Built-In Localization

13
Using Built-In Localization
▪ Built-In Features
▪ Resource Bundles
▪ Translating
– Export Resource Bundles
– Send Resource Bundles for Translation
– Import Translations
– Test Supported Languages
▪ Specifying the Browser Language

14
I. Built-In Features

▪ Sets up many properties for translation
– Static Text
• Field Labels, View Column Titles, Hard-Coded String Properties (Default Values)
– Hard-coded keyword lists
• Comboboxes, Listboxes, Radio Buttons, Checkboxes
– Hard-coded Text on Page
• Caveat: No component ID
• Properties file key is based on position and can change
– Hard-coded Validation Messages
▪ Automatically loads locale-specific resource bundles

Tip! Make IDs descriptive so translators know what they are translating

15
I. Built-In Features


!
▪ Demo!

16
I. Built-In Features

▪ Some localization is performed even without enabling localization application-wide
– Date and Number formats
– Currency symbols
– Standard component label strings
• File Download control headers, default error messages
– Dojo translations

17
I. Built-In Features

▪ Locale class
– getCountry()
– getDecimalSeparator()
– getDefault()
– getDisplayCountry()
– getDisplayLanguage()
▪ TimeZone class
– getDefault()
– getDisplayName()
– inDaylightTime()
▪ Create new Locale or TimeZone object from XSP context
– context.getLocale().getDecimalSeparator()
– context.getTimeZone().getDisplayName()

18
I. Built-In Features

▪ Programmatically Change Session Locale
– This overrides browser language setting for the current session

!

– context.setLocaleString(‘de’)
– context.reloadPage()

19
I. Built-In Features

▪ Property: Merge source file changes into property files
– Automatically updates properties files with additions, changes, or removals to XPage/CC
– Add: will be added to all resource bundles and will get the default translation (with the
language prefix)
– Remove: will remove it from the properties files
– Modify: get a default translation for it and the original translation will move to the top of the
file and be commented out
• If the default translation was still in place, it would be updated

22
I. Built-In Features

▪ In Notes9, you can specify the Character set for the properties file
– In 8.x you were limited to ASCII and Unicode escape sequences

23
II. Resource Bundles

▪ Plain text file with a .properties extension
▪ Filename format: filename_locale.properties
– Ex: MyProperties_fr.properties
▪ When localization is enabled, locale-specific copies of properties files are created for each
created for each XPage and custom control

20
II. Resource Bundles

▪ Consist of key-value pairs and comments
– key=value
• formRow1/@label=[de| Name ]
• label3/@value=[de| Status: ]
– Comment lines start with #
– Blank lines are ignored

21
III. Translation

▪ Translate files in DDE or export to send to translators
▪ Sending files for translation
– Export resource bundles
– Send for translation
– Import resource bundles
– Test

24
1. Export Resource Bundles

▪ Right-click on DB in Package Explorer and select Export
▪ General > File System

25
1. Export Resource Bundles

▪ Select Create directory structure for files
▪ Click Filter Types… and select *.properties

26
1. Export Resource Bundles

▪ Deselect Unnecessary Files
– Mastering XPages suggests deselecting the following files, since they don’t need to be
translated:
• <root>build.properties
• AppPropertiesdatabase.properties
• AppPropertiesxspdesign.properties
• WebContentWEB-INFxsp.properties
▪ Click Finish

27
1. Export Resource Bundles

▪ Check exported files
– Look for properties files for old/unused design elements

28
2. Send Resource Bundles for Translation

▪ Send files for each language to each translator

29
3. Import Translations

▪ Ensure that files are in same directory structure as exported
▪ Right click on application in Package Explorer and select Import
▪ Select General > File System
▪ Select directory with the app name
– Ex: Do not select C:My Translations
– Ex: Select C:My TranslationsLocalization_OneUI_Connect2014.nsf
▪ Click Select All button
▪ Click Finish
▪ Click Yes to All when prompted to overwrite existing files

30
4. Test Supported Languages

▪ Change browser language to test each supported language

31
IV. Specifying the Browser Language

▪ *Application display language is determined based on browser settings
– Setting the XSP locale directly will override the browser language setting

!

▪ Rules
– If the application supports the first browser language, then that’s what will display
– If not, then it checks the next browser language and so on until there’s a match
– If the application does not support any browser languages, it displays in the default
– If there is not a match for a specific regional setting, it will roll up to the local
• Ex: en_US and en_GB would both roll up to en if that’s what the language supports

32
IV. Specifying the Browser Language

▪ IE Language Settings
– Internet Options > General tab > Languages

33
IV. Specifying the Browser Language

▪ Firefox Language Settings
– Options > Content tab
– Languages section > “Choose…” button

34
IV. Specifying the Browser Language

▪ Chrome Language Settings
– Settings > Show advanced settings
– Languages > Language and Input Settings…
– Page display language can be different from browser configuration language!

35
IV. Specifying the Notes Browser Language

▪ File > Preferences > Regional Settings
– Select the language from Regional Profile
– Click OK
– A prompt will inform you to restart the program

35
3. Improving Localization

36
Improving Localization
▪ What XPages Localization Does Not Translate
▪ Approach
▪ Implementation

37
I. What XPages Localization Does Not Translate

▪ Computed values
– Labels, link/button titles, menu options, application layout tabs/module title
▪ Programmatic messages
– Form-level messages
– Popup help text
– E-mail text
– Field validation messages raised by code
▪ List Fields with computed values
– Comboboxes, Listboxes, Radio Buttons, Checkboxes

38
I. What XPages Localization Does Not Translate

▪ Demo!

39
I. What XPages Localization Does Not Translate


40
II. Approach

▪ Create another Resource Bundle (properties file) with all additional translations
▪ Manually create a copy of the Resource Bundle with each supported locale code suffix
▪ Create a script library with functions to use the Resource Bundle
1. Retrieve/cache the custom resource bundle
2. Retrieve a translated string value
3. Retrieve a translated keyword list (edit mode)
4. Retrieve a translated keyword value (read mode)

41
III. Retrieving a Custom Resource Bundle

▪ Logic
– Check for properties in a sessionScope variable
– If not found, retrieve properties and store in sessionScope
– Return a handle to the properties HashMap
▪ Full function available in Mastering XPages Book (pg 640-641)
▪ Example
getTranslations();

42
III. Retrieving a Custom Resource Bundle

▪ Magic!

!

43

var resource = new com.ibm.xsp.resource.BundleResource();
resource.src = "/MyTranslations.properties";
resource.component = view;
keys = resource.contents;
IV. Translating Computed Values 

▪ Computed labels, links, menu titles, etc must be localized
▪ Any code that returns a message to display to the user must be localized
▪ Call a function and pass it the name of a key and it will return the translated value

!

function getTranslatedString(key) {
return getTranslations()[key];
}
▪ Example

!

getTranslatedString(“ErrorMessage”)

Tip! Put the code in a try-catch block to prevent errors
44
Improving Localization

▪ Sample errors when a key is not found in the resource bundle
– Better to trap for this ahead of time

52
Improving Localization

▪ Sample errors when a key is not found in the resource bundle
– Better to trap for this ahead of time

53
IV. Translating Computed Values 

▪ Parameterized Messages
– Greeting that includes the user’s name
– Error message that includes error count
▪ I18n.format()
– Add placeholders to value in properties file
– Properties File:

!

ErrorMessage=Uh oh, {0}, there are {1} errors!

!

– SSJS:

!

45

var msg = getTranslations()[‘ErrorMessage’];
return I18n.format(msg, session.getCommonUserName(), numErrors);
V. Translating Keyword Lists

▪ Critically Important
– Documents are classified on predefined status or type values
– Views are generally filtered or categorized on keyword values
– Charts are based on keywords

47
V. Translating Keyword Lists

▪ Best Practice: Aliased Keyword Lists in Resource Bundle
– Store the alias in the field and display the translated value in the current language
– Aliasing allows for filtering and categorization in any language
▪ Resource Bundle Example
– # My Form Keywords
– Division=1_Division A|^|2_Division B|^|3_Division C|^|4_Division D
– Status=1_New|^|2_Current|^|3_Expiring|^|4_Late

!

▪ Tips!
– Consistent pattern for alias
– Don’t use comma (,) as a separator
– No spaces around equals sign (=) or between options

48
V. Translating Keyword Lists

▪ Create SSJS function to retrieve aliased keyword list:
– Retrieve the specified property value
– Parse the options, based on the alias and separator
– Return array of aliased keywords
▪ Example
getKeywordList(“Status”);
▪ Code snippet
…
var intPosition = thisOption.indexOf("_");
// Process each option to reformat as [DisplayOption]|[Alias]
var alias = thisOption.substring(0, intPosition);
var display = thisOption.substring(intPosition + 1);
listOptions[i+1] = display + "|" + alias;
…
49
VI. Displaying Selected Keyword in Read Mode

▪ Create SSJS function to display a keyword value in read mode
– Use string parsing to retrieve keyword list and get translated value based on alias
– Used for views, charts, etc.
getKeywordDisplay(key, alias);
▪ Example

!

getKeywordDisplay(“Status”, “1”);

50
IV. Translating Computed Values 

▪ Tip! Only define common sets of choices one time
– Examples:
• Yes, No, Maybe, N/A
• Strongly Disagree, Disagree, Neutral, Agree, Strongly Agree

46
Improving Localization

▪ Demo!

51
Additional Considerations

54
Additional Considerations

▪ What we’re not translating
– User-entered text
• We’re managing controlled sets of values
– Proper nouns
• Names, locations, etc

56
Additional Considerations

▪ Numeric default values in text fields
– A default of 0 would be translated
– Compute the value as: return ‘0’
▪ Text within pass-through HTML tags in page source
– Tags are untouched, but text within them is set up for translation
• Problematic with <script> tags – use Output Script controls instead

57
Additional Considerations

▪ Currency symbol will be automatically modified based on the locale
▪ Override by computing currency codes and symbols
– They can only be computed on page load – they cannot be refreshed dynamically
• Cannot work in a view display on a per-document basis
– If both are set, symbol overrides code

55
Additional Considerations

▪ Client-Side JavaScript
– Client JS within an <xp:> tag can use EL syntax

!

"#{javascript:return getKeywordDisplay('Status', '1');}“

!

– If you need a translated value outside of <xp:>, use SSJS to write out client-side JS vars
▪ Scheduled LotusScript agents
– Cannot read properties files

58
Additional Considerations

▪ Search
– Full-text search will not work as expected – keyword values are all stored as aliases
– Solution: Set up translated drop-down lists for filtering
• Programmatically build search string looking for the selected alias in the field
• Notify users that full-text search will work only on plain text fields
▪ Beyond Your Control
– “Browse” button in File Upload control from Extension Library
• Does not get automatically translated by browser and does not have a parameter to
programmatically translate
• Hacktastic

59
Additional Considerations

▪ Tip! Build the application with localization in mind, but do not send files for translation until
design is stable

59
▪ Access Connect Online to complete your session surveys using any:
– Web or mobile browser
– Connect Online kiosk onsite

!

68

Contenu connexe

Tendances

Connect2016 - 1172 Shipping domino
Connect2016 - 1172 Shipping dominoConnect2016 - 1172 Shipping domino
Connect2016 - 1172 Shipping dominoMatteo Bisi
 
Acquia Commons
Acquia CommonsAcquia Commons
Acquia Commonshernanibf
 
Java Web Start - How Zhara POS Works
Java Web Start - How Zhara POS WorksJava Web Start - How Zhara POS Works
Java Web Start - How Zhara POS WorksYohan Liyanage
 
What We Wish We Had Known: Becoming an IBM Connections Administrator
What We Wish We Had Known: Becoming an IBM Connections AdministratorWhat We Wish We Had Known: Becoming an IBM Connections Administrator
What We Wish We Had Known: Becoming an IBM Connections AdministratorGabriella Davis
 
JMP402 Master Class: Managed beans and XPages: Your Time Is Now
JMP402 Master Class: Managed beans and XPages: Your Time Is NowJMP402 Master Class: Managed beans and XPages: Your Time Is Now
JMP402 Master Class: Managed beans and XPages: Your Time Is NowRussell Maher
 
IBM Domino / IBM Notes Performance Tuning
IBM Domino / IBM Notes Performance Tuning IBM Domino / IBM Notes Performance Tuning
IBM Domino / IBM Notes Performance Tuning Vladislav Tatarincev
 
1050: TDI Solutions Best Practises with IBM Connections Deployments - IBM Con...
1050: TDI Solutions Best Practises with IBM Connections Deployments - IBM Con...1050: TDI Solutions Best Practises with IBM Connections Deployments - IBM Con...
1050: TDI Solutions Best Practises with IBM Connections Deployments - IBM Con...panagenda
 
Making DSpace XMLUI Your Own
Making DSpace XMLUI Your OwnMaking DSpace XMLUI Your Own
Making DSpace XMLUI Your OwnTim Donohue
 
Debugging IBM Connections for the Impatient Admin - Social Connections VII
Debugging IBM Connections for the Impatient Admin - Social Connections VIIDebugging IBM Connections for the Impatient Admin - Social Connections VII
Debugging IBM Connections for the Impatient Admin - Social Connections VIIMartin Leyrer
 
engage 2019 - 15 Domino v10 Admin features we LOVE
engage 2019 - 15 Domino v10 Admin features we LOVEengage 2019 - 15 Domino v10 Admin features we LOVE
engage 2019 - 15 Domino v10 Admin features we LOVEChristoph Adler
 
Practical solutions for connections administrators lite
Practical solutions for connections administrators litePractical solutions for connections administrators lite
Practical solutions for connections administrators liteSharon James
 
Connect 2014 JMP101: Java for XPages Development
Connect 2014 JMP101: Java for XPages DevelopmentConnect 2014 JMP101: Java for XPages Development
Connect 2014 JMP101: Java for XPages Developmentpanagenda
 
Connections install in 45 mins
Connections install in 45 minsConnections install in 45 mins
Connections install in 45 minsSharon James
 
You don't want to do it like that
You don't want to do it like thatYou don't want to do it like that
You don't want to do it like thatSharon James
 
IAmLUG presentation: Domino Admin Best Practices - Hunting the Gremlins
IAmLUG presentation: Domino Admin Best Practices - Hunting the GremlinsIAmLUG presentation: Domino Admin Best Practices - Hunting the Gremlins
IAmLUG presentation: Domino Admin Best Practices - Hunting the GremlinsDavid Hablewitz
 
Domino Tech School - Upgrading to Notes/Domino V10: Best Practices
Domino Tech School - Upgrading to Notes/Domino V10: Best PracticesDomino Tech School - Upgrading to Notes/Domino V10: Best Practices
Domino Tech School - Upgrading to Notes/Domino V10: Best PracticesChristoph Adler
 
Weblogic Console Customization labs
Weblogic Console Customization labsWeblogic Console Customization labs
Weblogic Console Customization labsPeter van Nes
 
Weblogic Console Customization
Weblogic Console CustomizationWeblogic Console Customization
Weblogic Console CustomizationPeter van Nes
 
Practical solutions for connections administrators
Practical solutions for connections administratorsPractical solutions for connections administrators
Practical solutions for connections administratorsSharon James
 

Tendances (20)

Connect2016 - 1172 Shipping domino
Connect2016 - 1172 Shipping dominoConnect2016 - 1172 Shipping domino
Connect2016 - 1172 Shipping domino
 
Acquia Commons
Acquia CommonsAcquia Commons
Acquia Commons
 
Java Web Start - How Zhara POS Works
Java Web Start - How Zhara POS WorksJava Web Start - How Zhara POS Works
Java Web Start - How Zhara POS Works
 
What We Wish We Had Known: Becoming an IBM Connections Administrator
What We Wish We Had Known: Becoming an IBM Connections AdministratorWhat We Wish We Had Known: Becoming an IBM Connections Administrator
What We Wish We Had Known: Becoming an IBM Connections Administrator
 
JMP402 Master Class: Managed beans and XPages: Your Time Is Now
JMP402 Master Class: Managed beans and XPages: Your Time Is NowJMP402 Master Class: Managed beans and XPages: Your Time Is Now
JMP402 Master Class: Managed beans and XPages: Your Time Is Now
 
IBM Domino / IBM Notes Performance Tuning
IBM Domino / IBM Notes Performance Tuning IBM Domino / IBM Notes Performance Tuning
IBM Domino / IBM Notes Performance Tuning
 
1050: TDI Solutions Best Practises with IBM Connections Deployments - IBM Con...
1050: TDI Solutions Best Practises with IBM Connections Deployments - IBM Con...1050: TDI Solutions Best Practises with IBM Connections Deployments - IBM Con...
1050: TDI Solutions Best Practises with IBM Connections Deployments - IBM Con...
 
IBM Connections adoption seminar
IBM Connections adoption seminarIBM Connections adoption seminar
IBM Connections adoption seminar
 
Making DSpace XMLUI Your Own
Making DSpace XMLUI Your OwnMaking DSpace XMLUI Your Own
Making DSpace XMLUI Your Own
 
Debugging IBM Connections for the Impatient Admin - Social Connections VII
Debugging IBM Connections for the Impatient Admin - Social Connections VIIDebugging IBM Connections for the Impatient Admin - Social Connections VII
Debugging IBM Connections for the Impatient Admin - Social Connections VII
 
engage 2019 - 15 Domino v10 Admin features we LOVE
engage 2019 - 15 Domino v10 Admin features we LOVEengage 2019 - 15 Domino v10 Admin features we LOVE
engage 2019 - 15 Domino v10 Admin features we LOVE
 
Practical solutions for connections administrators lite
Practical solutions for connections administrators litePractical solutions for connections administrators lite
Practical solutions for connections administrators lite
 
Connect 2014 JMP101: Java for XPages Development
Connect 2014 JMP101: Java for XPages DevelopmentConnect 2014 JMP101: Java for XPages Development
Connect 2014 JMP101: Java for XPages Development
 
Connections install in 45 mins
Connections install in 45 minsConnections install in 45 mins
Connections install in 45 mins
 
You don't want to do it like that
You don't want to do it like thatYou don't want to do it like that
You don't want to do it like that
 
IAmLUG presentation: Domino Admin Best Practices - Hunting the Gremlins
IAmLUG presentation: Domino Admin Best Practices - Hunting the GremlinsIAmLUG presentation: Domino Admin Best Practices - Hunting the Gremlins
IAmLUG presentation: Domino Admin Best Practices - Hunting the Gremlins
 
Domino Tech School - Upgrading to Notes/Domino V10: Best Practices
Domino Tech School - Upgrading to Notes/Domino V10: Best PracticesDomino Tech School - Upgrading to Notes/Domino V10: Best Practices
Domino Tech School - Upgrading to Notes/Domino V10: Best Practices
 
Weblogic Console Customization labs
Weblogic Console Customization labsWeblogic Console Customization labs
Weblogic Console Customization labs
 
Weblogic Console Customization
Weblogic Console CustomizationWeblogic Console Customization
Weblogic Console Customization
 
Practical solutions for connections administrators
Practical solutions for connections administratorsPractical solutions for connections administrators
Practical solutions for connections administrators
 

Similaire à Uno! Deux! Three! Making Localization of XPages as Easy as 1-2-3

Introduction to Python Programming
Introduction to Python ProgrammingIntroduction to Python Programming
Introduction to Python ProgrammingAkhil Kaushik
 
Getting Started with the Cortana Skills Kit
Getting Started with the Cortana Skills KitGetting Started with the Cortana Skills Kit
Getting Started with the Cortana Skills KitRick Wargo
 
SharePoint 2014: Where to save my data, for devs!
SharePoint 2014: Where to save my data, for devs!SharePoint 2014: Where to save my data, for devs!
SharePoint 2014: Where to save my data, for devs!Ben Steinhauser
 
Your Tower of Babel Reaches the Cloud: Languages and Office 365
Your Tower of Babel Reaches the Cloud: Languages and Office 365Your Tower of Babel Reaches the Cloud: Languages and Office 365
Your Tower of Babel Reaches the Cloud: Languages and Office 365Martin Laplante
 
computer-science_engineering_principles-of-programming-languages_introduction...
computer-science_engineering_principles-of-programming-languages_introduction...computer-science_engineering_principles-of-programming-languages_introduction...
computer-science_engineering_principles-of-programming-languages_introduction...AshutoshSharma874829
 
Don't Get Lost in Translation: Multilingual Site Building with Drupal 7 at Dr...
Don't Get Lost in Translation: Multilingual Site Building with Drupal 7 at Dr...Don't Get Lost in Translation: Multilingual Site Building with Drupal 7 at Dr...
Don't Get Lost in Translation: Multilingual Site Building with Drupal 7 at Dr...Suzanne Dergacheva
 
Software Localization: What You Need to Know to Effectively Go Global
Software Localization: What You Need to Know to Effectively Go GlobalSoftware Localization: What You Need to Know to Effectively Go Global
Software Localization: What You Need to Know to Effectively Go GlobalLionbridge
 
Internationalizing and localizing wordpress theme
Internationalizing and localizing  wordpress themeInternationalizing and localizing  wordpress theme
Internationalizing and localizing wordpress themeSanjip Shah
 
Sanjip Shah: Internationalizing and Localizing WordPress Themes
Sanjip Shah: Internationalizing and Localizing  WordPress ThemesSanjip Shah: Internationalizing and Localizing  WordPress Themes
Sanjip Shah: Internationalizing and Localizing WordPress Themeswpnepal
 
Embedded c c++ programming fundamentals master
Embedded c c++ programming fundamentals masterEmbedded c c++ programming fundamentals master
Embedded c c++ programming fundamentals masterHossam Hassan
 
Expanding XPages with Bootstrap Plugins for Ultimate Usability
Expanding XPages with Bootstrap Plugins for Ultimate UsabilityExpanding XPages with Bootstrap Plugins for Ultimate Usability
Expanding XPages with Bootstrap Plugins for Ultimate UsabilityTeamstudio
 
Compiler Construction | Lecture 17 | Beyond Compiler Construction
Compiler Construction | Lecture 17 | Beyond Compiler ConstructionCompiler Construction | Lecture 17 | Beyond Compiler Construction
Compiler Construction | Lecture 17 | Beyond Compiler ConstructionEelco Visser
 
UKLUG 2012 - XPages, Beyond the basics
UKLUG 2012 - XPages, Beyond the basicsUKLUG 2012 - XPages, Beyond the basics
UKLUG 2012 - XPages, Beyond the basicsUlrich Krause
 
SharePoint 2013 Sandbox Solutions for On Premise or Office 365
SharePoint 2013 Sandbox Solutions for On Premise or Office 365SharePoint 2013 Sandbox Solutions for On Premise or Office 365
SharePoint 2013 Sandbox Solutions for On Premise or Office 365Ed Musters
 
Yocto: Training in English
Yocto: Training in EnglishYocto: Training in English
Yocto: Training in EnglishOtavio Salvador
 
A Notes Developer's Journey into Java
A Notes Developer's Journey into JavaA Notes Developer's Journey into Java
A Notes Developer's Journey into JavaTeamstudio
 
BIWUG 30/11/2011 Intro to MUI and Variations in SharePoint 2010
BIWUG 30/11/2011 Intro to MUI and Variations in SharePoint 2010BIWUG 30/11/2011 Intro to MUI and Variations in SharePoint 2010
BIWUG 30/11/2011 Intro to MUI and Variations in SharePoint 2010BIWUG
 

Similaire à Uno! Deux! Three! Making Localization of XPages as Easy as 1-2-3 (20)

Introduction to Python Programming
Introduction to Python ProgrammingIntroduction to Python Programming
Introduction to Python Programming
 
Getting Started with the Cortana Skills Kit
Getting Started with the Cortana Skills KitGetting Started with the Cortana Skills Kit
Getting Started with the Cortana Skills Kit
 
SharePoint 2014: Where to save my data, for devs!
SharePoint 2014: Where to save my data, for devs!SharePoint 2014: Where to save my data, for devs!
SharePoint 2014: Where to save my data, for devs!
 
Your Tower of Babel Reaches the Cloud: Languages and Office 365
Your Tower of Babel Reaches the Cloud: Languages and Office 365Your Tower of Babel Reaches the Cloud: Languages and Office 365
Your Tower of Babel Reaches the Cloud: Languages and Office 365
 
computer-science_engineering_principles-of-programming-languages_introduction...
computer-science_engineering_principles-of-programming-languages_introduction...computer-science_engineering_principles-of-programming-languages_introduction...
computer-science_engineering_principles-of-programming-languages_introduction...
 
Don't Get Lost in Translation: Multilingual Site Building with Drupal 7 at Dr...
Don't Get Lost in Translation: Multilingual Site Building with Drupal 7 at Dr...Don't Get Lost in Translation: Multilingual Site Building with Drupal 7 at Dr...
Don't Get Lost in Translation: Multilingual Site Building with Drupal 7 at Dr...
 
Software Localization: What You Need to Know to Effectively Go Global
Software Localization: What You Need to Know to Effectively Go GlobalSoftware Localization: What You Need to Know to Effectively Go Global
Software Localization: What You Need to Know to Effectively Go Global
 
Asp folders and web configurations
Asp folders and web configurationsAsp folders and web configurations
Asp folders and web configurations
 
Asp .net folders and web.config
Asp .net folders and web.configAsp .net folders and web.config
Asp .net folders and web.config
 
Internationalizing and localizing wordpress theme
Internationalizing and localizing  wordpress themeInternationalizing and localizing  wordpress theme
Internationalizing and localizing wordpress theme
 
Sanjip Shah: Internationalizing and Localizing WordPress Themes
Sanjip Shah: Internationalizing and Localizing  WordPress ThemesSanjip Shah: Internationalizing and Localizing  WordPress Themes
Sanjip Shah: Internationalizing and Localizing WordPress Themes
 
Asp .net folders and web.config
Asp .net folders and web.configAsp .net folders and web.config
Asp .net folders and web.config
 
Embedded c c++ programming fundamentals master
Embedded c c++ programming fundamentals masterEmbedded c c++ programming fundamentals master
Embedded c c++ programming fundamentals master
 
Expanding XPages with Bootstrap Plugins for Ultimate Usability
Expanding XPages with Bootstrap Plugins for Ultimate UsabilityExpanding XPages with Bootstrap Plugins for Ultimate Usability
Expanding XPages with Bootstrap Plugins for Ultimate Usability
 
Compiler Construction | Lecture 17 | Beyond Compiler Construction
Compiler Construction | Lecture 17 | Beyond Compiler ConstructionCompiler Construction | Lecture 17 | Beyond Compiler Construction
Compiler Construction | Lecture 17 | Beyond Compiler Construction
 
UKLUG 2012 - XPages, Beyond the basics
UKLUG 2012 - XPages, Beyond the basicsUKLUG 2012 - XPages, Beyond the basics
UKLUG 2012 - XPages, Beyond the basics
 
SharePoint 2013 Sandbox Solutions for On Premise or Office 365
SharePoint 2013 Sandbox Solutions for On Premise or Office 365SharePoint 2013 Sandbox Solutions for On Premise or Office 365
SharePoint 2013 Sandbox Solutions for On Premise or Office 365
 
Yocto: Training in English
Yocto: Training in EnglishYocto: Training in English
Yocto: Training in English
 
A Notes Developer's Journey into Java
A Notes Developer's Journey into JavaA Notes Developer's Journey into Java
A Notes Developer's Journey into Java
 
BIWUG 30/11/2011 Intro to MUI and Variations in SharePoint 2010
BIWUG 30/11/2011 Intro to MUI and Variations in SharePoint 2010BIWUG 30/11/2011 Intro to MUI and Variations in SharePoint 2010
BIWUG 30/11/2011 Intro to MUI and Variations in SharePoint 2010
 

Plus de Kathy Brown

2 Minutes to Learn, A Lifetime to Master - Agile Scrum for Collaboration
2 Minutes to Learn, A Lifetime to Master - Agile Scrum for Collaboration2 Minutes to Learn, A Lifetime to Master - Agile Scrum for Collaboration
2 Minutes to Learn, A Lifetime to Master - Agile Scrum for CollaborationKathy Brown
 
Using Dashboards to Transform Application Data Visualization
Using Dashboards to Transform Application Data VisualizationUsing Dashboards to Transform Application Data Visualization
Using Dashboards to Transform Application Data VisualizationKathy Brown
 
10 Lines or Less; Interesting Things You Can Do In Java With Minimal Code
10 Lines or Less; Interesting Things You Can Do In Java With Minimal Code10 Lines or Less; Interesting Things You Can Do In Java With Minimal Code
10 Lines or Less; Interesting Things You Can Do In Java With Minimal CodeKathy Brown
 
Don't Roll Your Own, Integrate
Don't Roll Your Own, IntegrateDon't Roll Your Own, Integrate
Don't Roll Your Own, IntegrateKathy Brown
 
Twitter Bootstrap
Twitter BootstrapTwitter Bootstrap
Twitter BootstrapKathy Brown
 
Tools for the Domino Developer - BLUG presentation version
Tools for the Domino Developer - BLUG presentation versionTools for the Domino Developer - BLUG presentation version
Tools for the Domino Developer - BLUG presentation versionKathy Brown
 
Learning To Run - XPages for Lotus Notes Client Developers
Learning To Run - XPages for Lotus Notes Client DevelopersLearning To Run - XPages for Lotus Notes Client Developers
Learning To Run - XPages for Lotus Notes Client DevelopersKathy Brown
 
Top Tips Every Notes Developer Needs To Know
Top Tips Every Notes Developer Needs To KnowTop Tips Every Notes Developer Needs To Know
Top Tips Every Notes Developer Needs To KnowKathy Brown
 
Collaboration Party of One
Collaboration Party of OneCollaboration Party of One
Collaboration Party of OneKathy Brown
 
UKLUG - Open The Toolbox - Tools for the Domino Developer
UKLUG - Open The Toolbox - Tools for the Domino DeveloperUKLUG - Open The Toolbox - Tools for the Domino Developer
UKLUG - Open The Toolbox - Tools for the Domino DeveloperKathy Brown
 
BP208 Fabulous Feats with @Formula
BP208 Fabulous Feats with @FormulaBP208 Fabulous Feats with @Formula
BP208 Fabulous Feats with @FormulaKathy Brown
 

Plus de Kathy Brown (11)

2 Minutes to Learn, A Lifetime to Master - Agile Scrum for Collaboration
2 Minutes to Learn, A Lifetime to Master - Agile Scrum for Collaboration2 Minutes to Learn, A Lifetime to Master - Agile Scrum for Collaboration
2 Minutes to Learn, A Lifetime to Master - Agile Scrum for Collaboration
 
Using Dashboards to Transform Application Data Visualization
Using Dashboards to Transform Application Data VisualizationUsing Dashboards to Transform Application Data Visualization
Using Dashboards to Transform Application Data Visualization
 
10 Lines or Less; Interesting Things You Can Do In Java With Minimal Code
10 Lines or Less; Interesting Things You Can Do In Java With Minimal Code10 Lines or Less; Interesting Things You Can Do In Java With Minimal Code
10 Lines or Less; Interesting Things You Can Do In Java With Minimal Code
 
Don't Roll Your Own, Integrate
Don't Roll Your Own, IntegrateDon't Roll Your Own, Integrate
Don't Roll Your Own, Integrate
 
Twitter Bootstrap
Twitter BootstrapTwitter Bootstrap
Twitter Bootstrap
 
Tools for the Domino Developer - BLUG presentation version
Tools for the Domino Developer - BLUG presentation versionTools for the Domino Developer - BLUG presentation version
Tools for the Domino Developer - BLUG presentation version
 
Learning To Run - XPages for Lotus Notes Client Developers
Learning To Run - XPages for Lotus Notes Client DevelopersLearning To Run - XPages for Lotus Notes Client Developers
Learning To Run - XPages for Lotus Notes Client Developers
 
Top Tips Every Notes Developer Needs To Know
Top Tips Every Notes Developer Needs To KnowTop Tips Every Notes Developer Needs To Know
Top Tips Every Notes Developer Needs To Know
 
Collaboration Party of One
Collaboration Party of OneCollaboration Party of One
Collaboration Party of One
 
UKLUG - Open The Toolbox - Tools for the Domino Developer
UKLUG - Open The Toolbox - Tools for the Domino DeveloperUKLUG - Open The Toolbox - Tools for the Domino Developer
UKLUG - Open The Toolbox - Tools for the Domino Developer
 
BP208 Fabulous Feats with @Formula
BP208 Fabulous Feats with @FormulaBP208 Fabulous Feats with @Formula
BP208 Fabulous Feats with @Formula
 

Dernier

Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 

Dernier (20)

Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 

Uno! Deux! Three! Making Localization of XPages as Easy as 1-2-3

  • 1. BP 208: Uno! Deux! Three! Making Localization of XPages Apps as Easy as 1-2-3
 Brad Balassaitis, PSC Group Kathy Brown, PSC Group © 2014 IBM Corporation
  • 2. ¿quiénes somos (Who are we?) ▪ Brad Balassaitis – PSC Group, LLC – Blogger, Author, Wordfeud Addict – IBM Champion for IBM Collaboration Solutions – @Balassaitis – xcellerant.net ! ▪ Kathy Brown – PSC Group, LLC – Blogger, Author, Runner, Geek, and Loud Laugher – IBM Champion for IBM Collaboration Solutions – @RunningKathy – runningnotes.net 2
  • 3. Perché Questa Sessione (Why This Session) ▪ The enterprise is global ▪ We will demonstrate: – what is built-in – what is NOT built-in ▪ How to do both ▪ Special considerations, tips, and gotchas 3
  • 4. As Easy As 1-2-3 ▪ 1. Enabling Localization ▪ 2. Using Built-In Localization ▪ 3. Improving Localization 4
  • 6. Enabling Localization ▪ Enable Localization Support ▪ Generate Localized Resource Bundles ▪ Verify Localization Support 6
  • 7. I. Enable Localization Support
 ▪ Application Properties > XPages > Localization Options ▪ Select Enable Localization ▪ Add languages (including native language) ▪ Set Source language (development) ▪ Set Default language (display) 7
  • 8. I. Enable Localization Support
 8
  • 9. Google App Languages ▪ Klingon ! ▪ Hacker ! ▪ Pirate ! ▪ Elmer Fudd ! ▪ Bork, Bork, Bork 9
  • 10. I. Enable Localization Support
 8
  • 11. Region Codes ▪ Allow for regionalized translations of the same language ▪ Example: – en – en_US – en_GB 11
  • 12. I. Enable Localization Support
 ! 12
  • 13. I. Enable Localization Support
 ! 13
  • 14. Region Codes ▪ Allow for regionalized translations of the same language ▪ Example: – en – en_US – en_GB 14
  • 15. II. Generate Localized Resource Bundles
 ▪ Clean and Build ▪ Verify via Package Explorer 9
  • 16. II. Generate Localized Resource Bundles
 ▪ Optionally verify in Java source – Package Explorer > [db] > local > xsp > pageName.java ▪ Java Source for a Label (Before) ! private UIComponent createLabel1(FacesContext context, UIComponent parent, PageExpressionEvaluator evaluator) { XspOutputLabel result = new XspOutputLabel(); result.setValue("Front End "); setId(result, "label1"); return result; } 10
  • 17. II. Generate Localized Resource Bundles
 ▪ Java Source for a Label (After) ! private UIComponent createLabel1(FacesContext context, UIComponent parent, PageExpressionEvaluator evaluator) { XspOutputLabel result = new XspOutputLabel(); result.setValue(_currentLocale[55]); setId(result, "label1"); return result; } 11
  • 18. III. Verify Localization Support
 ▪ Set the browser to different supported languages and look for default translations 12
  • 19. 2. Using Built-In Localization 13
  • 20. Using Built-In Localization ▪ Built-In Features ▪ Resource Bundles ▪ Translating – Export Resource Bundles – Send Resource Bundles for Translation – Import Translations – Test Supported Languages ▪ Specifying the Browser Language 14
  • 21. I. Built-In Features
 ▪ Sets up many properties for translation – Static Text • Field Labels, View Column Titles, Hard-Coded String Properties (Default Values) – Hard-coded keyword lists • Comboboxes, Listboxes, Radio Buttons, Checkboxes – Hard-coded Text on Page • Caveat: No component ID • Properties file key is based on position and can change – Hard-coded Validation Messages ▪ Automatically loads locale-specific resource bundles Tip! Make IDs descriptive so translators know what they are translating 15
  • 23. I. Built-In Features
 ▪ Some localization is performed even without enabling localization application-wide – Date and Number formats – Currency symbols – Standard component label strings • File Download control headers, default error messages – Dojo translations 17
  • 24. I. Built-In Features
 ▪ Locale class – getCountry() – getDecimalSeparator() – getDefault() – getDisplayCountry() – getDisplayLanguage() ▪ TimeZone class – getDefault() – getDisplayName() – inDaylightTime() ▪ Create new Locale or TimeZone object from XSP context – context.getLocale().getDecimalSeparator() – context.getTimeZone().getDisplayName() 18
  • 25. I. Built-In Features
 ▪ Programmatically Change Session Locale – This overrides browser language setting for the current session ! – context.setLocaleString(‘de’) – context.reloadPage() 19
  • 26. I. Built-In Features
 ▪ Property: Merge source file changes into property files – Automatically updates properties files with additions, changes, or removals to XPage/CC – Add: will be added to all resource bundles and will get the default translation (with the language prefix) – Remove: will remove it from the properties files – Modify: get a default translation for it and the original translation will move to the top of the file and be commented out • If the default translation was still in place, it would be updated 22
  • 27. I. Built-In Features
 ▪ In Notes9, you can specify the Character set for the properties file – In 8.x you were limited to ASCII and Unicode escape sequences 23
  • 28. II. Resource Bundles
 ▪ Plain text file with a .properties extension ▪ Filename format: filename_locale.properties – Ex: MyProperties_fr.properties ▪ When localization is enabled, locale-specific copies of properties files are created for each created for each XPage and custom control 20
  • 29. II. Resource Bundles
 ▪ Consist of key-value pairs and comments – key=value • formRow1/@label=[de| Name ] • label3/@value=[de| Status: ] – Comment lines start with # – Blank lines are ignored 21
  • 30. III. Translation
 ▪ Translate files in DDE or export to send to translators ▪ Sending files for translation – Export resource bundles – Send for translation – Import resource bundles – Test 24
  • 31. 1. Export Resource Bundles
 ▪ Right-click on DB in Package Explorer and select Export ▪ General > File System 25
  • 32. 1. Export Resource Bundles
 ▪ Select Create directory structure for files ▪ Click Filter Types… and select *.properties 26
  • 33. 1. Export Resource Bundles
 ▪ Deselect Unnecessary Files – Mastering XPages suggests deselecting the following files, since they don’t need to be translated: • <root>build.properties • AppPropertiesdatabase.properties • AppPropertiesxspdesign.properties • WebContentWEB-INFxsp.properties ▪ Click Finish 27
  • 34. 1. Export Resource Bundles
 ▪ Check exported files – Look for properties files for old/unused design elements 28
  • 35. 2. Send Resource Bundles for Translation
 ▪ Send files for each language to each translator 29
  • 36. 3. Import Translations
 ▪ Ensure that files are in same directory structure as exported ▪ Right click on application in Package Explorer and select Import ▪ Select General > File System ▪ Select directory with the app name – Ex: Do not select C:My Translations – Ex: Select C:My TranslationsLocalization_OneUI_Connect2014.nsf ▪ Click Select All button ▪ Click Finish ▪ Click Yes to All when prompted to overwrite existing files 30
  • 37. 4. Test Supported Languages
 ▪ Change browser language to test each supported language 31
  • 38. IV. Specifying the Browser Language
 ▪ *Application display language is determined based on browser settings – Setting the XSP locale directly will override the browser language setting ! ▪ Rules – If the application supports the first browser language, then that’s what will display – If not, then it checks the next browser language and so on until there’s a match – If the application does not support any browser languages, it displays in the default – If there is not a match for a specific regional setting, it will roll up to the local • Ex: en_US and en_GB would both roll up to en if that’s what the language supports 32
  • 39. IV. Specifying the Browser Language
 ▪ IE Language Settings – Internet Options > General tab > Languages 33
  • 40. IV. Specifying the Browser Language
 ▪ Firefox Language Settings – Options > Content tab – Languages section > “Choose…” button 34
  • 41. IV. Specifying the Browser Language
 ▪ Chrome Language Settings – Settings > Show advanced settings – Languages > Language and Input Settings… – Page display language can be different from browser configuration language! 35
  • 42. IV. Specifying the Notes Browser Language
 ▪ File > Preferences > Regional Settings – Select the language from Regional Profile – Click OK – A prompt will inform you to restart the program 35
  • 44. Improving Localization ▪ What XPages Localization Does Not Translate ▪ Approach ▪ Implementation 37
  • 45. I. What XPages Localization Does Not Translate
 ▪ Computed values – Labels, link/button titles, menu options, application layout tabs/module title ▪ Programmatic messages – Form-level messages – Popup help text – E-mail text – Field validation messages raised by code ▪ List Fields with computed values – Comboboxes, Listboxes, Radio Buttons, Checkboxes 38
  • 46. I. What XPages Localization Does Not Translate
 ▪ Demo! 39
  • 47. I. What XPages Localization Does Not Translate
 40
  • 48. II. Approach
 ▪ Create another Resource Bundle (properties file) with all additional translations ▪ Manually create a copy of the Resource Bundle with each supported locale code suffix ▪ Create a script library with functions to use the Resource Bundle 1. Retrieve/cache the custom resource bundle 2. Retrieve a translated string value 3. Retrieve a translated keyword list (edit mode) 4. Retrieve a translated keyword value (read mode) 41
  • 49. III. Retrieving a Custom Resource Bundle
 ▪ Logic – Check for properties in a sessionScope variable – If not found, retrieve properties and store in sessionScope – Return a handle to the properties HashMap ▪ Full function available in Mastering XPages Book (pg 640-641) ▪ Example getTranslations(); 42
  • 50. III. Retrieving a Custom Resource Bundle
 ▪ Magic! ! 43 var resource = new com.ibm.xsp.resource.BundleResource(); resource.src = "/MyTranslations.properties"; resource.component = view; keys = resource.contents;
  • 51. IV. Translating Computed Values 
 ▪ Computed labels, links, menu titles, etc must be localized ▪ Any code that returns a message to display to the user must be localized ▪ Call a function and pass it the name of a key and it will return the translated value ! function getTranslatedString(key) { return getTranslations()[key]; } ▪ Example ! getTranslatedString(“ErrorMessage”) Tip! Put the code in a try-catch block to prevent errors 44
  • 52. Improving Localization
 ▪ Sample errors when a key is not found in the resource bundle – Better to trap for this ahead of time 52
  • 53. Improving Localization
 ▪ Sample errors when a key is not found in the resource bundle – Better to trap for this ahead of time 53
  • 54. IV. Translating Computed Values 
 ▪ Parameterized Messages – Greeting that includes the user’s name – Error message that includes error count ▪ I18n.format() – Add placeholders to value in properties file – Properties File: ! ErrorMessage=Uh oh, {0}, there are {1} errors! ! – SSJS: ! 45 var msg = getTranslations()[‘ErrorMessage’]; return I18n.format(msg, session.getCommonUserName(), numErrors);
  • 55. V. Translating Keyword Lists
 ▪ Critically Important – Documents are classified on predefined status or type values – Views are generally filtered or categorized on keyword values – Charts are based on keywords 47
  • 56. V. Translating Keyword Lists
 ▪ Best Practice: Aliased Keyword Lists in Resource Bundle – Store the alias in the field and display the translated value in the current language – Aliasing allows for filtering and categorization in any language ▪ Resource Bundle Example – # My Form Keywords – Division=1_Division A|^|2_Division B|^|3_Division C|^|4_Division D – Status=1_New|^|2_Current|^|3_Expiring|^|4_Late ! ▪ Tips! – Consistent pattern for alias – Don’t use comma (,) as a separator – No spaces around equals sign (=) or between options 48
  • 57. V. Translating Keyword Lists
 ▪ Create SSJS function to retrieve aliased keyword list: – Retrieve the specified property value – Parse the options, based on the alias and separator – Return array of aliased keywords ▪ Example getKeywordList(“Status”); ▪ Code snippet … var intPosition = thisOption.indexOf("_"); // Process each option to reformat as [DisplayOption]|[Alias] var alias = thisOption.substring(0, intPosition); var display = thisOption.substring(intPosition + 1); listOptions[i+1] = display + "|" + alias; … 49
  • 58. VI. Displaying Selected Keyword in Read Mode
 ▪ Create SSJS function to display a keyword value in read mode – Use string parsing to retrieve keyword list and get translated value based on alias – Used for views, charts, etc. getKeywordDisplay(key, alias); ▪ Example ! getKeywordDisplay(“Status”, “1”); 50
  • 59. IV. Translating Computed Values 
 ▪ Tip! Only define common sets of choices one time – Examples: • Yes, No, Maybe, N/A • Strongly Disagree, Disagree, Neutral, Agree, Strongly Agree 46
  • 62. Additional Considerations
 ▪ What we’re not translating – User-entered text • We’re managing controlled sets of values – Proper nouns • Names, locations, etc 56
  • 63. Additional Considerations
 ▪ Numeric default values in text fields – A default of 0 would be translated – Compute the value as: return ‘0’ ▪ Text within pass-through HTML tags in page source – Tags are untouched, but text within them is set up for translation • Problematic with <script> tags – use Output Script controls instead 57
  • 64. Additional Considerations
 ▪ Currency symbol will be automatically modified based on the locale ▪ Override by computing currency codes and symbols – They can only be computed on page load – they cannot be refreshed dynamically • Cannot work in a view display on a per-document basis – If both are set, symbol overrides code 55
  • 65. Additional Considerations
 ▪ Client-Side JavaScript – Client JS within an <xp:> tag can use EL syntax ! "#{javascript:return getKeywordDisplay('Status', '1');}“ ! – If you need a translated value outside of <xp:>, use SSJS to write out client-side JS vars ▪ Scheduled LotusScript agents – Cannot read properties files 58
  • 66. Additional Considerations
 ▪ Search – Full-text search will not work as expected – keyword values are all stored as aliases – Solution: Set up translated drop-down lists for filtering • Programmatically build search string looking for the selected alias in the field • Notify users that full-text search will work only on plain text fields ▪ Beyond Your Control – “Browse” button in File Upload control from Extension Library • Does not get automatically translated by browser and does not have a parameter to programmatically translate • Hacktastic 59
  • 67. Additional Considerations
 ▪ Tip! Build the application with localization in mind, but do not send files for translation until design is stable 59
  • 68. ▪ Access Connect Online to complete your session surveys using any: – Web or mobile browser – Connect Online kiosk onsite ! 68