From c2d9267b5a485585a108c0ba6d1dce6afc34982e Mon Sep 17 00:00:00 2001 From: fantu <fantu@ispconfig3> Date: Mon, 17 Nov 2008 12:01:53 -0500 Subject: [PATCH] - Improved merge in language: add remove of line how not exists in master language --- TODO.txt | 5 ----- interface/web/admin/language_complete.php | 10 ++++++++++ 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/TODO.txt b/TODO.txt index 00b84a3..a78d5aa 100644 --- a/TODO.txt +++ b/TODO.txt @@ -88,8 +88,3 @@ - Add, extend or modify comments in PEAR syntax so that they can be read with phpdocumentor. - -Language editor --------------------------------------- -- Merge: remove the line how exists in language to merge but not in main (removed in main because not use or change for fix) - diff --git a/interface/web/admin/language_complete.php b/interface/web/admin/language_complete.php index 4f45724..b0e36fe 100644 --- a/interface/web/admin/language_complete.php +++ b/interface/web/admin/language_complete.php @@ -112,6 +112,14 @@ $n++; } } + + $r = 0; + foreach($wb as $key => $val) { + if(!isset($wb_master[$key])) { + unset($wb[$key]); + $r++; + } + } $file_content = "<?php\n"; foreach($wb as $key => $val) { @@ -122,6 +130,8 @@ $file_content .= "?>\n"; $msg .= "Added $n lines to the file $langfile<br />"; + if($r!=0) + $msg .= "Removed $r lines to the file $langfile<br />"; file_put_contents($langfile ,$file_content); } else { $msg .= "File does not exist yet. Copied file $masterfile to $langfile<br />"; -- Gitblit v1.9.1