Forum .LRN Q&A: I18N of portlets

Collapse
Posted by Malte Sussdorff on
I'm wondering how I should go about when trying to I18N the headings of portlets like assessment-portlet or lorsm-portlet.

My assumption was that it would be enough to change the "get_pretty_name" function to return an I18N string. Sadly, this only holds true for the admin portlets but not for the user portlets.

Here is what I did:

Index: assessment-portlet-procs.tcl
===================================================================
RCS file: /cvsroot/openacs-4/packages/assessment-portlet/tcl/assessment-portlet-procs.tcl,v
retrieving revision 1.1
diff -r1.1 assessment-portlet-procs.tcl
35c35
< return "Assessment"
---

return "<span>#</span>assessment-portlet.pretty_name#"
111c111
< return "Assessment Administration"
---
return "<span>#</span>assessment-portlet.admin_pretty_name#"

As mentioned before, for admin portlets it works, for the user portlets it does not.

Collapse
2: Re: I18N of portlets (response to 1)
Posted by Rodrigo Proença on
Hi Malte,

I'm using dotlrn 2.1.1. For sample, to rename my Survey portlets

--------------------------------------------
/packages/survey-portlet/tcl/survey-portlet-procs.tcl

ad_proc -public get_pretty_name {
} {
-- return "Survey"
++ return "<span>#</span>survey.survey#"
}

/packages/survey-portlet/tcl/survey-admin-portlet-procs.tcl

ad_proc -public get_pretty_name {
} {
-- return "Survey Administration"
++ return "<span>#</span>survey.Survey_Administration#"
}

update portal_element_map set pretty_name ='<span>#</span>survey.survey#' where pretty_name = 'Survey'
update portal_element_map set pretty_name ='<span>#</span>survey.Survey_Administration#' where pretty_name = 'Survey Administration'

------------------------------------------------------------------------------

Collapse
3: Re: I18N of portlets (response to 1)
Posted by Rodrigo Proença on
I wrote a simple UI for class/groups administrators manage Portlets Names individuals instances, se the post

https://openacs.org/forums/message-view?message_id=213757
Collapse
4: Re: I18N of portlets (response to 1)
Posted by Malte Sussdorff on
I update a couple of portlets now on oacs-5-1, so I18N works with them. Thanks for the Tip!