Download presentation
Presentation is loading. Please wait.
Published byAubrey Harvey Modified over 9 years ago
1
Sakai: Localization & Internationalization Beth Kirschner University of Michigan beth.kirschner@umich.edu
2
Localization (l10n) versus Internationalization (i18n) Localization of a web interface is usually limited to isolating the language dependencies such that they can be easily translated. Internationalization of a web interface takes into account many aspects beyond strict translation of the text, such as cultural differences, space allocation and formatting. Sakai needs to consider both.
3
Enabling Sakai Localization Velocity templates Java Server Faces templates Java code Static HTML (e.g. help text) Database information
4
Java Server Faces in JSP Java Tool Logic Java Beans Sakai Application Services Sakai JSF Widget Set The Sakai Tool Environment Velocity Templates Sakai Legacy Tools Sakai Legacy Services Sakai Velocity Support Layer The Sakai Legacy Environment Sakai Portal Sakai Presentation Environments Sakai Framework APIs
5
Localizing Velocity Templates (before) View: #foreach ($view in ["Calendar by day", "Calendar by week", "Calendar by month", "Calendar by year", "List of events"])
6
Localizing Velocity Templates (after) $tlang.getString(“view.view”) #foreach ($view in ["$tlang.getString('java.byday')", "$tlang.getString('java.byweek')", "$tlang.getString('java.bymonth')", "$tlang.getString('java.byyear')", "$tlang.getString('java.listeve')"])
7
Localizing JSF Templates <sakai:tool_bar_item action="#{AnnouncementTool.processActionListNew}" value="#{msgs.annc_list_new}" />
8
Localizing Java Code (before) private static final String STATE_SELECTED_VIEW = "state_selected_view"; private static final String VIEW_BY_DAY = "Calendar by day"; private static final String VIEW_BY_WEEK = "Calendar by week"; private static final String VIEW_BY_MONTH = "Calendar by month"; private static final String VIEW_BY_YEAR = "Calendar by year"; … context.put("selectedView", VIEW_BY_DAY);
9
Localizing Java Code (after) private static ResourceBundle rb = ResourceBundle.getBundle("calendar") private static final String STATE_SELECTED_VIEW = "state_selected_view"; private static final String VIEW_BY_DAY = rb.getString("java.byday"); private static final String VIEW_BY_WEEK = rb.getString("java.byweek"); private static final String VIEW_BY_MONTH = rb.getString("java.bymonth"); private static final String VIEW_BY_YEAR = rb.getString("java.byyear"); … context.put("selectedView", VIEW_BY_DAY);
10
Localization Status Thanks to the developers at University of Lleida, almost every English phrase has been localized into Resource Bundles (almost 4000 separate phrases) Translation mostly completed in Japanese, Korean and Chinese Interest has been expressed in Slovokian, Portugese, Catalonia, Spanish, Armenian, Hebrew, …
11
Asian Translations for NEESgrid portal Chinese Japanese Korean
12
How to Translate… in 5 easy steps 1)Ingest properties files into MS Excel Spreadsheet 2)Translate English Text in spreadsheet 3)Export into Unicode UTF-16 representation 4)Convert from UTF-16 into UTF-8 5)Ascii-encode UTF-8 representation and save as property file for target language locale (see “I18N and L10N” worksite at http://collab.sakaiproject.org/portal for tips and conversion utilities)
13
Dynamic Language Detection What about portals that need to support multiple language locales? Requirements: Minimum change to existing code and tools Use existing ResourceBundle properties files Simple for users to use Tatsuki Sugiura at Nagoya University has developed an elegant solution
14
New ResourceLoader class New ResourceLoader class replaces java.util.ResourceBundle ResourceLoader works as a ManagedBean for Java Server Faces (JSF) ResourceLoader works as a wrapper for ResourceBundle for java and Velocity templates Language Locale retrieved from HTTP request
15
Users define language preference in browser (IE, Netscape, Safari, Firefox, …)
16
ResourceLoader Implementation
17
Enabling Sakai Internationalization Page Layout and design Sentence construction (subject/verb/object) Timezone differences Date & Time construction Definition of a Week Numbers & Currency Language dependent sorting Other culturally dependent data
18
Page Layouts (skins) Page layouts can differ for application specific reasons or cultural reasons (e.g. right-to-left languages) Layout is completely configurable using CSS (Cascading Style Sheets) Different skins can affect: Color & Fonts Icons & Background Images Layout & Format Navigation
19
Skin Directory Structure /library/skin/ /default/ /tool.css /portal.css /images/ tool_base.css banner_inst.gif info.gif title.1.gif topleft-tab.gif check.gif linkoff.gif title22.gif topleft-tab_hov.gif headback.gif linkover.gif titleback.gif topright-p-title.gif headmid.gif linksel.gif titleleft.gif warn.gif headright.gif logo_inst.gif titleright.gif help.gif reload.gif topleft-curtab.gif help_h.gif reload_h.gif topleft-p-title.gif /new-skin/ Define your skin here
20
Sakai Stylesheet Definitions
21
Right-justified Skins (thanks to Gonzalo Silverio for screenshots)
22
Page Layout: Space Allocation
23
What’s not done yet Problem: Subject/Verb/Object, Subject/Object/Verb, Verb,Subject,Object constructions Solution: Need to rewrite to use MessageFormat for these compositions Problem: Timezone differences Solution: Add timezone option to user preferences and modify affected tools (e.g. Calendar, Chat) Problem: Date & Time construction Solution: Java provides date/time constructions specific to language locale -- code needs to be audited for consistent usage
24
What’s not done yet (continued) Problem: Definition of a week Solution: Configuration option needs to be built into Schedule tool Numbers & Currency Solution: Java provides number/currency constructions specific to regional locales -- code needs to be audited for consistent usage Language independent sorting Solution: Java provides correct unicode string comparisons -- code needs to be audited for consistent usage
25
Questions?
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.