Changeset 11904

Show
Ignore:
Timestamp:
03/22/11 21:13:09 (2 years ago)
Author:
p_lindheimer
Message:

really closes #4995 I hope, flaw in previous logic plus make sure friendly name is translated within tooltip depending on mode

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/branches/2.9/core/page.advancedsettings.php

    r11903 r11904  
    8484    } 
    8585 
    86     if ($display_friendly_name) { 
    87       $name_label_raw = $c['name']; 
    88       $description_raw = $c['description']; 
    89       if ($c['module'] && extension_loaded('gettext') && is_dir("modules/".$c['module']."/i18n")) { 
    90         bindtextdomain($c['module'],"modules/".$c['module']."/i18n"); 
    91         bind_textdomain_codeset($c['module'], 'utf8'); 
    92         $name_label = dgettext($c['module'],$name_label_raw); 
    93         $tt_description = dgettext($c['module'],$description_raw); 
    94         if ($name_label == $name_label_raw) { 
    95           $name_label = _($name_label_raw); 
    96         } 
    97         if ($tt_description == $description_raw) { 
    98           $tt_description = _($description_raw); 
    99         } 
    100       } else { 
     86    $name_label_raw = $c['name']; 
     87    $description_raw = $c['description']; 
     88    if ($c['module'] && extension_loaded('gettext') && is_dir("modules/".$c['module']."/i18n")) { 
     89      bindtextdomain($c['module'],"modules/".$c['module']."/i18n"); 
     90      bind_textdomain_codeset($c['module'], 'utf8'); 
     91      $name_label = dgettext($c['module'],$name_label_raw); 
     92      $tt_description = dgettext($c['module'],$description_raw); 
     93      if ($name_label == $name_label_raw) { 
    10194        $name_label = _($name_label_raw); 
     95      } 
     96      if ($tt_description == $description_raw) { 
    10297        $tt_description = _($description_raw); 
    10398      } 
    10499    } else { 
     100      $name_label = _($name_label_raw); 
     101      $tt_description = _($description_raw); 
     102    } 
     103    if (!$display_friendly_name) { 
     104      $tr_friendly_name = $name_label; 
    105105      $name_label = $c['keyword']; 
    106       $tt_description = $c['description']; 
    107106    } 
    108107 
     
    120119      $default_val .= '<br />'.sprintf(_("Internal Name: %s"),$c['keyword']); 
    121120    } else { 
    122       $default_val .= '<br />'.sprintf(_("Friendly Name: %s"),$c['name']); 
     121      $default_val .= '<br />'.sprintf(_("Friendly Name: %s"),$tr_friendly_name); 
    123122    } 
    124123    echo '<tr><td><a href="javascript:void(null)" class="info">'.$name_label.'<span>'.$tt_description.'<br /><br >'.$default_val.'</span></a></td>';