Changeset 5309


Ignore:
Timestamp:
Mar 24, 2010, 3:00:03 PM (14 years ago)
Author:
plg
Message:

improvement: clean output for lost language keys

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/translation_analysis.php

    r5301 r5309  
    6464      // strings not "really" translated?
    6565      $output_duplicated = '';
     66      $output_lost = '';
    6667      foreach (array_keys($metalang[$language][$file]) as $key)
    6768      {
     
    7879       
    7980        $local_value = $metalang[$language][$file][$key];
    80         $ref_value = $metalang[ $page['ref_default_values'] ][$file][$key];
    81         if ($local_value == $ref_value)
     81        if (!isset($metalang[ $page['ref_default_values'] ][$file][$key]))
    8282        {
    83           $output_duplicated.= get_line_to_translate($file, $key);
     83          $output_lost.= '#'.$key.'# does not exist in the reference language'."\n";
     84        }
     85        else
     86        {
     87          $ref_value = $metalang[ $page['ref_default_values'] ][$file][$key];
     88          if ($local_value == $ref_value)
     89          {
     90            $output_duplicated.= get_line_to_translate($file, $key);
     91          }
    8492        }
    8593      }
     
    98106        echo '<h3>'.$file.'.lang.php</h3>';
    99107        echo '<textarea style="width:100%;height:150px;">'.$output.'</textarea>';
     108      }
     109
     110      if ('' != $output_lost)
     111      {
     112        echo '<pre>'.$output_lost.'</pre>';
    100113      }
    101114    }
Note: See TracChangeset for help on using the changeset viewer.