Sakai is now in use all over the world. Many institutions use Sakai in a language other then English. Sakai is very configurable and able to support localization in a variety of different locales. There are still challenges, however, if you try to support multiple locales in the same Sakai server at the same time.
This session will quickly introduce the topic of localization in Sakai to those who might not be familiar with how it is done. The session will then turn its focus on the problems that come up when you try to support multiple locales in the same Sakai system at the same time.
Some of the topics that will be covered:
Date / Time problems
Grading Scales
Non-property file localization (.xml, .html)
Roles
Site Types
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
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
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
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