#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
Hosting: Nuxeo: Zope service provider