Internationalizing Sakai Ral Mengod Universidad Politcnica de Valencia

  • Slides: 36
Download presentation
Internationalizing Sakai Raúl Mengod Universidad Politécnica de Valencia (Spain)

Internationalizing Sakai Raúl Mengod Universidad Politécnica de Valencia (Spain)

Overview • Introduction: Universidad Politécnica de Valencia (UPV) • A little bit of History.

Overview • Introduction: Universidad Politécnica de Valencia (UPV) • A little bit of History. • Internationalizing sakai. • Sakai i 18 n review. Best practices. • Localization. • I 18 n organization 2

Valencia, a place to visit 3

Valencia, a place to visit 3

CAMPUS DE VERA 4

CAMPUS DE VERA 4

Introduction • Universidad Politécnica Valencia (UPV) – Public academic institution since 1971 – Official

Introduction • Universidad Politécnica Valencia (UPV) – Public academic institution since 1971 – Official and non-official studies – Post – Graduate studies • The UPV in numbers – – – – 4 Campuses 15 Colleges 40 Research centers 40 Official Degrees 20 post graduate studies 40. 000 Students 2. 600 Teachers 1. 400 Staff 5

Sakai in the UPV • Pilot running during 2006 – Full capabilities – Selected

Sakai in the UPV • Pilot running during 2006 – Full capabilities – Selected group of users • Full production System in 2006/2007 – – – 4 servers Oracle Database Integrated with SSO Integrated with enrollment system 4. 000 sites 40. 000 students • Based on the 2. 1. 2 version – Customized to university requirements 6

Sakai in the UPV 7

Sakai in the UPV 7

A little bit of History • Sakai 2. 0 – Universidad de Lleida started

A little bit of History • Sakai 2. 0 – Universidad de Lleida started the job – Properties files for the strings – Catalan version • Sakai 2. 1 – Running on mono-lingual platforms – Spanish version not available • Sakai 2. 1. 1 – Multi-lingual version by Nagoya University – Resourcebundle. java class – Stored in the Personal Preference • Sakai 2. 1. 2 – First version available in Spanish – Multi-lingual capabilities • Sakai 2. 3 – More languages added – Still with problems 8

Sakai i 18 n Tasks • Allocate all language-dependent strings in the properties files.

Sakai i 18 n Tasks • Allocate all language-dependent strings in the properties files. • Translate strings to Spanish • Code search for texts not included in the bundles • Test multi-lingual platform • Find and implement a suitable solution for our requirements to the sakai i 18 n problems 9

Melete i 18 n. n. Foothill College 10

Melete i 18 n. n. Foothill College 10

Sakai I 18 n Standards http: //bugs. sakaiproject. org/confluence/display/I 18 N/Home WG: i 18

Sakai I 18 n Standards http: //bugs. sakaiproject. org/confluence/display/I 18 N/Home WG: i 18 n on the Collab Site http: //bugs. sakaiproject. org/confluence/display/I 18 N/How+to+write+Internationa lized+Tools+in+Sakai • Written by Beth Kirschner • Based on the Resource. Loader class – – – Wrapper for the Loadbundle class Looks for the sakai user preference Language Looks for the Browser Language Gets the server default language Should we add a session language? • • Easy change of navigation language Minimize accesses to the database 11

Sakai I 18 n Standards http: //bugs. sakaiproject. org/confluence/display/I 18 N/How+to+write+Inte rnationalized+Tools+in+Sakai • JSF

Sakai I 18 n Standards http: //bugs. sakaiproject. org/confluence/display/I 18 N/How+to+write+Inte rnationalized+Tools+in+Sakai • JSF based Tools – Create a backing bean for messages in the faces-config file or in the JSP page – Popularize with the properties files – Use it in the same way as Load. Bundle based bean • Velocity based Tools – Create an instance of the Resource. Loader class – Put it in the context – Reference it as any other variable 12

I 18 n Best Practices • Never forget the standard – All the tools

I 18 n Best Practices • Never forget the standard – All the tools will be implemented in the same way • Properties files are our friends – The implementation is language independent – Separate language dependent properties files from files with other resources • Separate codified values from displayed names 13

I 18 n Best Practices • None displayed text should be in. java or.

I 18 n Best Practices • None displayed text should be in. java or. jsp files – It is a hard work to develop but it is necessary – The code is more difficult to understand • Only user data must be stored in Database. – Avoid storing information needed in the logic of the application – Only the user inserts data in the database, not the application • Test programs in more than one language 14

Known Problems on i 18 n Sakai Confluence http: //bugs. sakaiproject. . org/confluence/pages/viewpage. action?

Known Problems on i 18 n Sakai Confluence http: //bugs. sakaiproject. . org/confluence/pages/viewpage. action? pageid=17162 • Resources Tool needs to respond better to user preference language locale (JIRA SAK-5043) • Worksites Tool needs to respond better to user preference language locale (JIRA SAK-5044) • Melete needs to be localized and/or use Resource. Loader for language preferences • Message. Center needs to be localized (JIRA SAK-4889) • Help text needs to be internationalzed (JIRA SAK-4256) • Localize hard-coded strings in Syllabus. Tool class (JIRA SAK-3853) • Basic. Content. Type. Image. Service class needs to support language/locales (JIRA SAK-3852) • sakai. properties file contains language dependent strings (JIRA SAK-3764) • Roster tool does not sort UTF-8 characters correctly (JIRA SAK-3930) • Time formats cannot be localized (JIRA SAK-3823, SAK-3824) • New internationalized date/time widget is needed (work in progress at UM) (SAK-3825) • Tool registration files should support xml: lang attribute (SAK-5296) Our goal: Fix all those problems for 2. 4 release 15

Main Problems on i 18 n • Database Stored Strings – Tool names /

Main Problems on i 18 n • Database Stored Strings – Tool names / Site names • Use of translated strings in logic decisions – Messagecenter (states) • Static pages • Date Formats 16

I 18 n Best Practices • Tools / Pages Names – Language at creation

I 18 n Best Practices • Tools / Pages Names – Language at creation time SAKAI_SITE_PAGE. TITLE SAKAI_SITE_TOOL. TITLE 17

I 18 n Best Practices • Our Solution – – – – Every tool/page

I 18 n Best Practices • Our Solution – – – – Every tool/page has a register name (sakai. site. info) New property file with tool register names as keys Translate the register key Store register key in database Get localized text for the data stored in database If key is not found in properties files show the text What should be shown when we edit the site? • Key or translated text? – Problems with multiple used tools? (sakai. iframe) • Other Solution (SAK-5296) – Tool registration files need to support xml: lang – Tool class would support retrieving the locale-specific text – How to handle tools that may be used one than more time? • General Solution – Databased tool for multilingual texts – Applicable to all needed places – Based on Tool/Table/Column/Language/Value 18

I 18 n Best Practices • Labels stored in the database – Gradebook GB_GRADABLE_OBJECT_T.

I 18 n Best Practices • Labels stored in the database – Gradebook GB_GRADABLE_OBJECT_T. EXTERNAL_APP_NAME 19

I 18 n Best Practices • Samigo: Tool data stored in the database SAM_TYPE_T.

I 18 n Best Practices • Samigo: Tool data stored in the database SAM_TYPE_T. KEYWORD 20

I 18 n Best Practices • Use of i 18 n in logic decisions

I 18 n Best Practices • Use of i 18 n in logic decisions • The topic name for these special folders are created in english and stored in the database 21

I 18 n Best Practices • Use of i 18 n in logic decisions

I 18 n Best Practices • Use of i 18 n in logic decisions • If the topic title is internationalized the messages dissapear • The name of the folder is used to recover the messages 22

I 18 n Best Practices • Solution: Translate only the output org. sakaiproject. tool.

I 18 n Best Practices • Solution: Translate only the output org. sakaiproject. tool. messageforums. ui. Private. Forum. Decorated. Bean; Topic topic = deco. Topic. get. Topic(); if (topic != null){ if (topic. get. Title(). equals. Ignore. Case("Received")) topic. set. Title(rb. get. String("state_received")); else if (topic. get. Title(). equals. Ignore. Case("Sent")) topic. set. Title(rb. get. String("state_sent")); else if (topic. get. Title(). equals. Ignore. Case("Deleted")) topic. set. Title(rb. get. String("state_deleted")); } new_topics. add(deco. Topic); Leave texts on the database in english Translate only the string displayed Compare with the values in english 23

I 18 n Best Practices • Use in duplicate name validation – Control name

I 18 n Best Practices • Use in duplicate name validation – Control name of special folder org. sakaiproject. tool. messageforums. Private. Messages. Tool /** portlet configuration parameter values**/ public static final String PVTMSG_MODE_RECEIVED = "Received"; public static final String PVTMSG_MODE_SENT = "Sent"; public static final String PVTMSG_MODE_DELETE = "Deleted"; public static final String PVTMSG_MODE_DRAFT = "Drafts"; public static final String PVTMSG_MODE_CASE = "Personal Folders"; //Create a folder within a forum public String process. Pvt. Msg. Fld. Create() { LOG. debug("process. Pvt. Msg. Fld. Create()"); String create. Folder=get. Add. Folder() ; if(create. Folder == null) { set. Error. Message(get. Resource. Bundle. String(ENTER_FOLDER_NAME)); return null ; } else { if(PVTMSG_MODE_RECEIVED. equals(create. Folder) || PVTMSG_MODE_SENT. equals(create. Folder)|| PVTMSG_MODE_DELETE. equals(create. Folder) || PVTMSG_MODE_DRAFT. equals(create. Folder)) { set. Error. Message(get. Resource. Bundle. String(CREATE_DIFF_FOLDER_NAME)); } else { prt. Msg. Manager. create. Topic. Folder. In. Forum(forum, create. Folder); //create a type. UUID in commons String new. Type. Uuid= type. Manager. get. Custom. Topic. Type(create. Folder); } return MAIN_PG ; } } 24

I 18 n Best Practices • Be careful using beans in comparations <h: command.

I 18 n Best Practices • Be careful using beans in comparations <h: command. Button value="#{msg. button_unique_save_and_publish}" type="submit" rendered="#{not assessment. Settings. has. Questions}" action="#{assessment. Settings. get. Outcome. Publish}" disabled="true"> <f: action. Listener type="org. sakaiproject. tool. assessment. ui. listener. author. Confirm. Publish. Assessment. Listener" /> </h: command. Button> public void process. Action(Action. Event ae) throws Abort. Processing. Exception { synchronized(repeated. Publish) { //Faces. Context context = Faces. Context. get. Current. Instance(); UIComponent event. Source = (UIComponent) ae. get. Source(); Value. Binding vb = event. Source. get. Value. Binding("value"); String button. Value = (String) vb. get. Expression. String(); if(button. Value. ends. With("#{msg. button_unique_save_and_publish}")) { repeated. Publish = Boolean. FALSE; return; } 25

I 18 n Best Practices • Separate values and displayed names in Options msgcntrmessageforums-appsrcjavaorgsakaiprojecttoolmessageforumsDiscussion.

I 18 n Best Practices • Separate values and displayed names in Options msgcntrmessageforums-appsrcjavaorgsakaiprojecttoolmessageforumsDiscussion. Forum. Tool. java public List get. Posting. Options() { List posting. Options = new Array. List(); posting. Options. add(new Select. Item(Permission. Bean. NONE, Permission. Bean. NONE)); posting. Options. add(new Select. Item(Permission. Bean. OWN, Permission. Bean. OWN)); posting. Options. add(new Select. Item(Permission. Bean. ALL, Permission. Bean. ALL)); return posting. Options; } 26

I 18 n Best Practices • Texts in Bitmap files • Solution: Use Anonymous

I 18 n Best Practices • Texts in Bitmap files • Solution: Use Anonymous picture 27

Help Tool • Special Tool • Only in English • Not based on property

Help Tool • Special Tool • Only in English • Not based on property files • A different structure 28

Help Tool • Include Procedure Guides Available in Different formats (HTML, Flash, VIDEO) •

Help Tool • Include Procedure Guides Available in Different formats (HTML, Flash, VIDEO) • Integrated with sakai help • Available in Spanish and English • Help tool was in plain html files • Duplicate the help structure • This solution is not good enough for multiple language. 29

Localization • Dates – 08/05/2006 can be either 8 of May or 5 of

Localization • Dates – 08/05/2006 can be either 8 of May or 5 of August depending on the country you are. – Changes should be done at presentation level. – SAK-3825 (in progress at UM) 30

Localization 31

Localization 31

Localization Order of the Days of Week In Spain Monday is day #1 and

Localization Order of the Days of Week In Spain Monday is day #1 and Sunday #7 ¿How are things in other countries? 32

Sakai i 18 n Coordination Translation Updates • We need a more flexible way

Sakai i 18 n Coordination Translation Updates • We need a more flexible way to update translated strings in newer versions • Use some tools or applications – Internationalization Dashboard (Mark Breuker) http: //qa 1 -nl. sakaiproject. org/codereview/international. html – Extend this tool to allow on-line translation? • It’s a hard work to test if the translations are properly finished 33

Sakai i 18 n Coordination Official tools • List of Languages supported by sakai

Sakai i 18 n Coordination Official tools • List of Languages supported by sakai • Should be all translated to the official languages • Only translated tools should be moved to official • I 18 n committee? 34

The future • Sakai 2. 4 i 18 n Plans – Now it is

The future • Sakai 2. 4 i 18 n Plans – Now it is empty in the confluence site • Finish i 18 n of all tools • Database stored strings (Tool Names) • Develop a Real multi-lingual help • Easy way of changing the language – Flags on the portal page – Duplicate the Gateway Site • Multi-lingual contents version – Needs strong changes on some tools 35

Thank You rmengod@upv. es

Thank You rmengod@upv. es