From eca1b87551e52a7b54592def549310f17171dd87 Mon Sep 17 00:00:00 2001 From: plegall Date: Wed, 24 Mar 2010 14:00:03 +0000 Subject: improvement: clean output for lost language keys git-svn-id: http://piwigo.org/svn/trunk@5309 68402e56-0260-453c-a942-63ccdbb3a9ee --- tools/translation_analysis.php | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/tools/translation_analysis.php b/tools/translation_analysis.php index f4cfd1f3a..eab896cc8 100644 --- a/tools/translation_analysis.php +++ b/tools/translation_analysis.php @@ -63,6 +63,7 @@ foreach ($languages as $language) // strings not "really" translated? $output_duplicated = ''; + $output_lost = ''; foreach (array_keys($metalang[$language][$file]) as $key) { $exceptions = array('Level 0'); @@ -77,10 +78,17 @@ foreach ($languages as $language) } $local_value = $metalang[$language][$file][$key]; - $ref_value = $metalang[ $page['ref_default_values'] ][$file][$key]; - if ($local_value == $ref_value) + if (!isset($metalang[ $page['ref_default_values'] ][$file][$key])) { - $output_duplicated.= get_line_to_translate($file, $key); + $output_lost.= '#'.$key.'# does not exist in the reference language'."\n"; + } + else + { + $ref_value = $metalang[ $page['ref_default_values'] ][$file][$key]; + if ($local_value == $ref_value) + { + $output_duplicated.= get_line_to_translate($file, $key); + } } } @@ -98,6 +106,11 @@ foreach ($languages as $language) echo '

'.$file.'.lang.php

'; echo ''; } + + if ('' != $output_lost) + { + echo '
'.$output_lost.'
'; + } } else { -- cgit v1.2.3