[Nuxeo-tickets] [Nuxeo Repository] #1645: alt attribute of icons img tags is not translated.

Nuxeo Repository trac at nuxeo.com
Fri May 12 16:06:53 CEST 2006


#1645: alt attribute of icons img tags is not translated.
--------------------------------------+-------------------------------------
 Reporter:  joseluis.rosa at iavante.es  |       Owner:  jmorliaguet
     Type:  enhancement               |      Status:  new        
 Priority:  P2                        |   Milestone:  CPS 3.4.1  
Component:  CPSPortlets               |     Version:  3.4.0      
 Severity:  normal                    |    Keywords:             
--------------------------------------+-------------------------------------
 In PortletsTool.py the methods renderIcon and renderActionIcon, return an
 img tag. The value of the alt attribute is not translated with Localizer
 which in case of actions icons can be very useful (in my use case I render
 actions without title).

 I propose to replace this line:

 {{{
 img_tag = IMG_TAG % (base_url + icon_path,
                      getattr(img, 'width', 0),
                      getattr(img, 'height', 0),
                      alt)
 }}}

 with these:

 {{{
 language = self.translation_service.getSelectedLanguage()
 alt_text = self.Localizer.default.gettext(alt, language)
 img_tag = IMG_TAG % (base_url + icon_path,
                      getattr(img, 'width', 0),
                      getattr(img, 'height', 0),
                      alt_text)
 }}}

 Please, let me know if there's a better solution for this.

 Thank you.

-- 
Ticket URL: <http://svn.nuxeo.org/trac/pub/ticket/1645>
Nuxeo Repository <http://www.cps-project.org/>
Nuxeo Repository


More information about the Nuxeo-tickets mailing list
More information about CPS: CPS project - CVS - API

Hosting: Nuxeo: Zope service provider


This list archive provided by Nuxeo, the leaders of open source ECM. Check out the Nuxeo 5 open source, standards-based ECM project.