Skip to content
Snippets Groups Projects
Commit c2d9267b authored by fantu's avatar fantu
Browse files

- Improved merge in language: add remove of line how not exists in master language

parent fa5f9135
No related branches found
No related tags found
No related merge requests found
......@@ -88,8 +88,3 @@ General tasks
- 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)
......@@ -112,6 +112,14 @@ function merge_langfile($langfile,$masterfile) {
$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 @@ function merge_langfile($langfile,$masterfile) {
$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 />";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment