SlideShare a Scribd company logo
Localizing Sakai for Multiple Locales
Apereo Conference June 2013
Cris J. Holdorph | holdorph@unicon.net
Phillip Ball | pball@unicon.net
Localizing Sakai
Sakai Community Process
How to Translate Sakai - Confluence Page
https://confluence.sakaiproject.org/x/HYDbAQ
Locale Leads
https://source.sakaiproject.org/svn/reference/trunk/docs/readme_i18n.txt
Sakai I18N mailing list
http://collab.sakaiproject.org/mailman/listinfo/i18n
Property Files
key = value based text file
over 140 different files in Sakai 2.9.x-all
Most in different directories
No consistent location for the files
Property Files
Example Files
announcement/announcement-impl/impl/src/bundle/annc-access.properties
announcement/announcement-impl/impl/src/bundle/siteemaanc.properties
announcement/announcement-tool/tool/src/bundle/announcement.properties
announcement/announcement-tool/tool/src/bundle/announcement_fr_FR.properties
polls/tool/src/bundle/org/sakaiproject/poll/bundle/Messages.properties
polls/tool/src/java/poll.properties
polls/tool/src/java/poll-option.properties
Property Files
Example Properties
English
custom.number = Number of days in the past
French
custom.number = Nombre de jours dans le passu00e9
Property Files
!! DEVELOPERS
Please do not CHANGE the meaning of a property
CREATE a new property and remove the old one
Help Files
HTML based files, with an XML table of contents file
Over 35 help DIRECTORIES in Sakai 2.9.x-all
Directories will have between 1 (resetpass) to 30 (samigo)
files to translate
Example files
announcement/announcement-help/src/sakai_announcements/
help.xml
aqyk.html
aqyk_pt_BR.html
aqzq.html
aqzq_pt_BR.html
Email Service
XML based file
All translations within that file
Loaded into database, with some support for reloading
Email Template Administration Tool available in Administration
Workspace
Supports Macros
Not all tools use this
Example File
site-manage/site-manage-impl/impl/src/bundle/notifyNewuser.xml
Areas Not Multi-Localizable
Areas that do not support multi-locale localization
Grading Scales
Site Types
Roles
Date Formats
Many fields in Sakai serve as both a display and input field, this is
common when editing data in forms
Displaying dates is typically locale specific
If you vary the display / entry of a form field, you must process it differently
ie: MM-DD-YYYY versus DD-MM-YYYY
Parsing MMM-DD-YYY in multiple locales can also be tricky if you have
not correctly localized your datepicker (and/or you allow users to type in
their own month)
Passing Timestamp (number of milliseconds from epoch) can simplify
server to client communication, however, be careful of time zones (more
on this later)
Localizing Date Formats
The SSP Date Bug
https://wiki.jasig.org/x/8JFuAw
java.util.Date - represents the number of milliseconds from epoch
java.sql.Date - represents a java.util.Date where the hours, minutes, seconds and
milliseconds are set to 0 in the particular instance time zone
java.sql.Timestamp - represents a java.util.Date with additional support for
nanoseconds
If you pass a Timestamp (number of milliseconds/nanoseconds from epoch) to the
browser and let javascript interpret the value, it will do it using the browser's Time zone
If the server and browser do not share a time zone, then dates that have no time
component (i.e., java.sql.Date) can shift
Midnight (0:00, 12:00am) on 2013 June 5 in the Eastern time zone is the same as
9:00pm (21:00) on 2013 June 4 in the Pacific time zone
Date Picker
https://jira.sakaiproject.org/
browse/SAK-23662
The purpose of this new
datepicker implementation
in our project was to
maintain full control over
language generation and
create constancy
throughout various tool's
date and time selection
mechanisms.
Javascript Localization
Methods for localization
Dirty DOM Methods
Render translated text into a hidden HTML element.
Render translated text as javascript on the page
within script tags
Clean DOM, Preferred
Load pre-generated external language files
Pulling text from HTML
Strings are rendered inside an HTML element, which is
then hidden with CSS.
<div class="hide" id="selectall">
<h:outputText value="#{msgs.selectAll}"/>
</div>
Use Javascript to grab the text rendered in the
element.
$('#selectall').text();
Grab JS off the page
Translated strings are rendered into JavaScript on the page.
<script>
var lang = {
! nodata: "<h:outputText value="#{msgs.selectAll}"/>",
! numbererror: "<h:outputText value="#{msgs.numTypeError}"/>"
};
</script>
Since language strings are already a JavaScript object,
properties can be called directly.
$(‘#message’).text( lang.numbererror );
External JavaScript File
Most JavaScript code-sets implement this method of
language translation
Language files are pre-generated ahead of time, not
during page load
Benefit of native JS translations, without a dirty DOM,
but at the cost of an HTTP request (but with the added
benefit of browser caching)
The Datepicker Setup
Maven plugin
generates JavaScript
language files
Datepicker detects
language, loads lang
file:
js/lang-datepicker/
datepicker_de.js
datepicker_fr_FR.js
datepicker_ja.js
...
Localization Odds and Ends
First Time Login
The Non-Logged in experience in Sakai is in one
Locale
There is no "Locale" picker
Can work around this problem using external login
systems like CAS
Site Language vs. My Workspace
Locale specific Skin or Logo
Integration with Other
Systems
What language/locale should the user receive in the
other system?
What language/locale should the user receive when
they first come to Sakai?
Basic LTI with non-ASCII characters
SSO
CK Editor
Work by Noah to support Localized CK editor
Not all CK Editor plugins are localized
No external way to add localizations to CK editor
plugins that are missing them
Questions and Answers
Thanks!
Apereo Conference June 2013
Cris J. Holdorph | holdorph@unicon.net
Phillip Ball | pball@unicon.net

More Related Content

PDF
How to connect AngularJS to servers
PDF
Angularjs & REST
PDF
AppBuilder Tour
PPT
Using RESTFUL APIs in ANGULARJS
PPTX
Sinatra
PPTX
REST Easy with AngularJS - ng-grid CRUD EXAMPLE
PDF
Rapid API Development ArangoDB Foxx
PPT
Web Services with Objective-C
How to connect AngularJS to servers
Angularjs & REST
AppBuilder Tour
Using RESTFUL APIs in ANGULARJS
Sinatra
REST Easy with AngularJS - ng-grid CRUD EXAMPLE
Rapid API Development ArangoDB Foxx
Web Services with Objective-C

What's hot (20)

PDF
mobile in the cloud with diamonds. improved.
PDF
RESTful Web Services with Spring MVC
PDF
Building RESTful applications using Spring MVC
PDF
DevOps in the era of serverless computing - Alessandro Vozza - Codemotion Ams...
PDF
Infrastructure as code terraformujeme cloud
PDF
AWS KSS
PPTX
Andrii Dembitskyi "Events in our applications Event bus and distributed systems"
PDF
Taste of RxJS
ODP
AngularJS and REST - #omrs15 tutorial
KEY
REST Easy - Building RESTful Services in Zend Framework
PDF
Javantura v3 - ELK – Big Data for DevOps – Maarten Mulders
PPTX
Web application apis
PPTX
Building Your First App with MongoDB
PPTX
Designing REST services with Spring MVC
DOCX
Jquery Ajax
PDF
Live Streaming & Server Sent Events
PPTX
Ch7(publishing my sql data on the web)
PPTX
L18 REST API Design
PDF
REST Web API with MongoDB
mobile in the cloud with diamonds. improved.
RESTful Web Services with Spring MVC
Building RESTful applications using Spring MVC
DevOps in the era of serverless computing - Alessandro Vozza - Codemotion Ams...
Infrastructure as code terraformujeme cloud
AWS KSS
Andrii Dembitskyi "Events in our applications Event bus and distributed systems"
Taste of RxJS
AngularJS and REST - #omrs15 tutorial
REST Easy - Building RESTful Services in Zend Framework
Javantura v3 - ELK – Big Data for DevOps – Maarten Mulders
Web application apis
Building Your First App with MongoDB
Designing REST services with Spring MVC
Jquery Ajax
Live Streaming & Server Sent Events
Ch7(publishing my sql data on the web)
L18 REST API Design
REST Web API with MongoDB
Ad

Viewers also liked (6)

PDF
Benchmarking APIs - LNUG February 2014
PDF
The problem with passwords on the web and what to do about it
PDF
Chocolate, LEGO and Scrum Jambalaya at SGNOLA2014
ODP
Beyond PHP - It's not (just) about the code
KEY
All out in the Cloud - CloudEast 2012
PDF
Instant LAMP Stack with Vagrant and Puppet
Benchmarking APIs - LNUG February 2014
The problem with passwords on the web and what to do about it
Chocolate, LEGO and Scrum Jambalaya at SGNOLA2014
Beyond PHP - It's not (just) about the code
All out in the Cloud - CloudEast 2012
Instant LAMP Stack with Vagrant and Puppet
Ad

Recently uploaded (20)

PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Approach and Philosophy of On baking technology
PDF
Electronic commerce courselecture one. Pdf
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
cuic standard and advanced reporting.pdf
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Dropbox Q2 2025 Financial Results & Investor Presentation
Approach and Philosophy of On baking technology
Electronic commerce courselecture one. Pdf
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
sap open course for s4hana steps from ECC to s4
Per capita expenditure prediction using model stacking based on satellite ima...
Network Security Unit 5.pdf for BCA BBA.
Diabetes mellitus diagnosis method based random forest with bat algorithm
20250228 LYD VKU AI Blended-Learning.pptx
The Rise and Fall of 3GPP – Time for a Sabbatical?
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
cuic standard and advanced reporting.pdf
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Programs and apps: productivity, graphics, security and other tools
Encapsulation_ Review paper, used for researhc scholars
Advanced methodologies resolving dimensionality complications for autism neur...
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Agricultural_Statistics_at_a_Glance_2022_0.pdf

Using Sakai with Multiple Locales

  • 1. Localizing Sakai for Multiple Locales Apereo Conference June 2013 Cris J. Holdorph | holdorph@unicon.net Phillip Ball | pball@unicon.net
  • 3. Sakai Community Process How to Translate Sakai - Confluence Page https://confluence.sakaiproject.org/x/HYDbAQ Locale Leads https://source.sakaiproject.org/svn/reference/trunk/docs/readme_i18n.txt Sakai I18N mailing list http://collab.sakaiproject.org/mailman/listinfo/i18n
  • 4. Property Files key = value based text file over 140 different files in Sakai 2.9.x-all Most in different directories No consistent location for the files
  • 6. Property Files Example Properties English custom.number = Number of days in the past French custom.number = Nombre de jours dans le passu00e9
  • 7. Property Files !! DEVELOPERS Please do not CHANGE the meaning of a property CREATE a new property and remove the old one
  • 8. Help Files HTML based files, with an XML table of contents file Over 35 help DIRECTORIES in Sakai 2.9.x-all Directories will have between 1 (resetpass) to 30 (samigo) files to translate Example files announcement/announcement-help/src/sakai_announcements/ help.xml aqyk.html aqyk_pt_BR.html aqzq.html aqzq_pt_BR.html
  • 9. Email Service XML based file All translations within that file Loaded into database, with some support for reloading Email Template Administration Tool available in Administration Workspace Supports Macros Not all tools use this Example File site-manage/site-manage-impl/impl/src/bundle/notifyNewuser.xml
  • 10. Areas Not Multi-Localizable Areas that do not support multi-locale localization Grading Scales Site Types Roles
  • 12. Many fields in Sakai serve as both a display and input field, this is common when editing data in forms Displaying dates is typically locale specific If you vary the display / entry of a form field, you must process it differently ie: MM-DD-YYYY versus DD-MM-YYYY Parsing MMM-DD-YYY in multiple locales can also be tricky if you have not correctly localized your datepicker (and/or you allow users to type in their own month) Passing Timestamp (number of milliseconds from epoch) can simplify server to client communication, however, be careful of time zones (more on this later) Localizing Date Formats
  • 13. The SSP Date Bug https://wiki.jasig.org/x/8JFuAw java.util.Date - represents the number of milliseconds from epoch java.sql.Date - represents a java.util.Date where the hours, minutes, seconds and milliseconds are set to 0 in the particular instance time zone java.sql.Timestamp - represents a java.util.Date with additional support for nanoseconds If you pass a Timestamp (number of milliseconds/nanoseconds from epoch) to the browser and let javascript interpret the value, it will do it using the browser's Time zone If the server and browser do not share a time zone, then dates that have no time component (i.e., java.sql.Date) can shift Midnight (0:00, 12:00am) on 2013 June 5 in the Eastern time zone is the same as 9:00pm (21:00) on 2013 June 4 in the Pacific time zone
  • 14. Date Picker https://jira.sakaiproject.org/ browse/SAK-23662 The purpose of this new datepicker implementation in our project was to maintain full control over language generation and create constancy throughout various tool's date and time selection mechanisms.
  • 16. Methods for localization Dirty DOM Methods Render translated text into a hidden HTML element. Render translated text as javascript on the page within script tags Clean DOM, Preferred Load pre-generated external language files
  • 17. Pulling text from HTML Strings are rendered inside an HTML element, which is then hidden with CSS. <div class="hide" id="selectall"> <h:outputText value="#{msgs.selectAll}"/> </div> Use Javascript to grab the text rendered in the element. $('#selectall').text();
  • 18. Grab JS off the page Translated strings are rendered into JavaScript on the page. <script> var lang = { ! nodata: "<h:outputText value="#{msgs.selectAll}"/>", ! numbererror: "<h:outputText value="#{msgs.numTypeError}"/>" }; </script> Since language strings are already a JavaScript object, properties can be called directly. $(‘#message’).text( lang.numbererror );
  • 19. External JavaScript File Most JavaScript code-sets implement this method of language translation Language files are pre-generated ahead of time, not during page load Benefit of native JS translations, without a dirty DOM, but at the cost of an HTTP request (but with the added benefit of browser caching)
  • 20. The Datepicker Setup Maven plugin generates JavaScript language files Datepicker detects language, loads lang file: js/lang-datepicker/ datepicker_de.js datepicker_fr_FR.js datepicker_ja.js ...
  • 22. First Time Login The Non-Logged in experience in Sakai is in one Locale There is no "Locale" picker Can work around this problem using external login systems like CAS Site Language vs. My Workspace Locale specific Skin or Logo
  • 23. Integration with Other Systems What language/locale should the user receive in the other system? What language/locale should the user receive when they first come to Sakai? Basic LTI with non-ASCII characters SSO
  • 24. CK Editor Work by Noah to support Localized CK editor Not all CK Editor plugins are localized No external way to add localizations to CK editor plugins that are missing them
  • 26. Thanks! Apereo Conference June 2013 Cris J. Holdorph | holdorph@unicon.net Phillip Ball | pball@unicon.net