Skip to content

Commit c2d9267

Browse files
author
fantu
committed
- Improved merge in language: add remove of line how not exists in master language
1 parent fa5f913 commit c2d9267

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

TODO.txt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,3 @@ General tasks
8888

8989
- Add, extend or modify comments in PEAR syntax so that they can be read with phpdocumentor.
9090

91-
92-
Language editor
93-
--------------------------------------
94-
- Merge: remove the line how exists in language to merge but not in main (removed in main because not use or change for fix)
95-

interface/web/admin/language_complete.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,14 @@ function merge_langfile($langfile,$masterfile) {
112112
$n++;
113113
}
114114
}
115+
116+
$r = 0;
117+
foreach($wb as $key => $val) {
118+
if(!isset($wb_master[$key])) {
119+
unset($wb[$key]);
120+
$r++;
121+
}
122+
}
115123

116124
$file_content = "<?php\n";
117125
foreach($wb as $key => $val) {
@@ -122,6 +130,8 @@ function merge_langfile($langfile,$masterfile) {
122130
$file_content .= "?>\n";
123131

124132
$msg .= "Added $n lines to the file $langfile<br />";
133+
if($r!=0)
134+
$msg .= "Removed $r lines to the file $langfile<br />";
125135
file_put_contents($langfile ,$file_content);
126136
} else {
127137
$msg .= "File does not exist yet. Copied file $masterfile to $langfile<br />";

0 commit comments

Comments
 (0)