Changeset 6956 for modules/branches

Show
Ignore:
Timestamp:
10/12/08 09:11:50 (5 years ago)
Author:
mickecarlsson
Message:

Fixes localization issues, added -pot file, added Swedish laguage for printextensions

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/branches/2.5/printextensions/page.printextensions.php

    r6912 r6956  
    2222<?php 
    2323if (!$quietmode) { 
    24   echo "<br /><a href=\"config.php?type=tool&display=printextensions&quietmode=on\" target=\"_blank\"><b>"._("Printer Friendly")."</b></a>\n"; 
     24  echo "<br /><a href=\"config.php?type=tool&display=printextensions&quietmode=on\" target=\"_blank\"><b>"._("Printer Friendly Page")."</b></a>\n"; 
    2525} 
    26  
    27  
    2826if (!$extdisplay) { 
    2927  echo '<br><h2>'._("PBX Extension Layout").'</h2><table border="0" width="95%">'; 
     
    3735foreach ($full_list as $key => $value) { 
    3836  $txtdom = $active_modules[$key]['rawname']; 
    39   if ($txtdom == 'core') textdomain('amp')
    40   echo "<tr colspan=\"2\" width='100%'><td><br /><strong>".dgettext($txtdom,sprintf("%s",$active_modules[$key]['name']))."</strong></td></tr>"; 
     37  if ($txtdom == 'core') $txtdom = 'amp'
     38  echo "<tr colspan=\"2\" width='100%'><td><br /><strong>".sprintf("%s",dgettext($txtdom,$active_modules[$key]['name']))."</strong></td></tr>"; 
    4139  foreach ($value as $exten => $item) { 
    4240    $description = explode(":",$item['description'],2); 
     
    5048// Now, get all featurecodes. Code gracefully 'borrowed' from featurecodeadmin 
    5149foreach($featurecodes as $item) { 
     50 $bind_domains = array(); 
     51  if (isset($bind_domains[$item['modulename']]) || (extension_loaded('gettext') && is_dir("modules/".$item['modulename']."/i18n"))) { 
     52   if (!isset($bind_domains[$item['modulename']])) { 
     53    $bind_domains[$item['modulename']] = true; 
     54    bindtextdomain($item['modulename'],"modules/".$item['modulename']."/i18n"); 
     55    bind_textdomain_codeset($item['modulename'], 'utf8'); 
     56   } 
     57} 
    5258    $moduleena = ($item['moduleenabled'] == 1 ? true : false); 
    5359    $featureena = ($item['featureenabled'] == 1 ? true : false); 
     
    5763    $thismodena = ($moduleena != '') ? $featurecodecustom : $featurecodedefault; 
    5864    $txtdom = $item['modulename']; 
    59     // if it is from core, we get translations from amp 
    60     if ($txtdom == 'core') textdomain('amp'); 
     65    // if core then get translations from amp 
     66    if ($txtdom == 'core') $txtdom = 'amp'; 
     67    textdomain($txtdom); 
    6168    if ($featureena == true && $moduleena == true)  
    62    echo "<tr width=\"90%\"><td>".sprintf("%s",dgettext($item['modulename'],$item['featuredescription']))."</td><td width=\"10%\" align=\"right\">".$thiscode."</td></tr>"; 
     69   echo "<tr width=\"90%\"><td>".sprintf(dgettext($txtdom,$item['featuredescription']))."</td><td width=\"10%\" align=\"right\">".$thiscode."</td></tr>"; 
    6370}; 
    6471?>