Changeset 50095

Show
Ignore:
Timestamp:
11/17/06 11:54:21 (3 years ago)
Author:
madarche
Message:

- Fixed #1645 : alt attribute of icons img tags is not translated.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • CPS3/products/CPSPortlets/trunk/CHANGES

    r50032 r50095  
    77Bug fixes 
    88~~~~~~~~~ 
    9 - 
     9- Fixed #1645 : alt attribute of icons img tags is not translated. 
    1010New internal features 
    1111~~~~~~~~~~~~~~~~~~~~~ 
  • CPS3/products/CPSPortlets/trunk/PortletsTool.py

    r48411 r50095  
    11# -*- coding: ISO-8859-15 -*- 
    2 # Copyright (c) 2004 Nuxeo SARL <http://nuxeo.com> 
    3 # Copyright (c) 2004 Chalmers University of Technology <http://www.chalmers.se> 
     2# Copyright (c) 2004-2006 Nuxeo SAS <http://nuxeo.com> 
     3# Copyright (c) 2004-2006 Chalmers University of Technology <http://www.chalmers.se> 
    44# Authors : Julien Anguenot <ja@nuxeo.com> 
    55#           Jean-Marc Orliaguet <jmo@ita.chalmers.se> 
    6  
     6
    77# This program is free software; you can redistribute it and/or 
    88# modify it under the terms of the GNU General Public License 
    99# as published by the Free Software Foundation; either version 2 
    1010# of the License, or (at your option) any later version. 
    11  
     11
    1212# This program is distributed in the hope that it will be useful, 
    1313# but WITHOUT ANY WARRANTY; without even the implied warranty of 
    1414# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    1515# GNU General Public License for more details. 
    16  
     16
    1717# You should have received a copy of the GNU General Public License 
    1818# along with this program; if not, write to the Free Software 
    1919# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA. 
     20# 
    2021# $Id$ 
    2122 
     
    5152ICON_RAMCACHE_ID = 'icons' 
    5253ACTIONICON_RAMCACHE_ID = 'actioncons' 
    53 IMG_TAG = '<img src="%s" width="%s" height="%s" alt="%s" />' 
     54IMG_TAG = '<img src="%s" width="%s" height="%s" alt="%s" title="%s" />' 
    5455 
    5556# FTI 
     
    815816            if img is None: 
    816817                return None 
     818            trans = self.translation_service 
     819            language = trans.getSelectedLanguage() 
     820            alt_text = trans.translateDefault(alt, target_language=language) 
    817821            img_tag = IMG_TAG % (base_url + icon_path, 
    818822                                 getattr(img, 'width', 16), 
    819823                                 getattr(img, 'height', 16), 
    820                                  alt
     824                                 alt_text, alt_text
    821825            if cache is not None: 
    822826                cache.setEntry(index, img_tag) 
     
    868872            if img is None: 
    869873                return None 
     874            trans = self.translation_service 
     875            language = trans.getSelectedLanguage() 
     876            alt_text = trans.translateDefault(alt, target_language=language) 
    870877            img_tag = IMG_TAG % (base_url + icon_path, 
    871878                                 getattr(img, 'width', 0), 
    872879                                 getattr(img, 'height', 0), 
    873                                  alt
     880                                 alt_text, alt_text
    874881            if cache is not None: 
    875882                cache.setEntry(index, img_tag)