From b1876aa71999a882054361c20c1d433ab0d435b9 Mon Sep 17 00:00:00 2001
From: EV-soft ';
+
+ while (false !== ($entry = $d->read())) {
+ $dir= $entry.'/';
+ if (is_dir($entry) ) {
+ $files = scandir($dir);
+ if ($files)
+ foreach ($files as $source) { $count= 0; $search= "lng('";
+ if (($source!=='.') and ($source!=='..')
+ and (!strpos($source,'.bak')) and (!strpos($source,'lngScann.php')) and (!strpos($source,'.csv'))
+ and ((strpos($source,'.php')) or (strpos($source,'.htm'))) )
+ { $lines = file($dir.$source);
+ foreach ($lines as $line_num => $line) {
+ $line= ' '.$line;
+ if ($a=strpos($line,$search)) {
+ if ((strpos($source,'.php')) or (strpos($source,'.htm'))) {
+ $str= $line;
+ while (strpos($str,$search)) {
+ $a= strpos($str,$search); $str= substr($str,$a+5); $b= strpos($str,"')");
+ $str= html_entity_decode($str);
+ $str= strip_tags($str);
+ $longest= max($longest,strlen(utf8_decode(substr($str,0,$b))));
+ $f= substr($str,0,$b);
+ $arrStrings[] = ['"'.$f.'"'];
+ }
+ } $count++; $total++;
+ }
+ }
+ $count= substr('000'.$count,-4);
+ if ($count>0) $buff[] = 'Total: '.$count.' found : "'.$search.'" i '.$dir.''.$source.' ';
+echo '
";
+ echo "
".'Scanning for prefix: "lng(\'" '." in .php/.htm files in current folder,";
+ echo "
and create a complete list of language texts that you can translate";
+ echo '
';
+ }
+ }
+ }
+ }
+ echo '
Total: '.$total. ' found: '.$search.' in the scanned files
';
+ $arrStrings= array_unique($arrStrings, SORT_REGULAR);
+ // sort($arrStrings, SORT_NATURAL | SORT_FLAG_CASE);
+ sort($arrStrings);
+ echo '
Sorted list without duplicates:';
+ echo '
+{
+ "appName": "Tiny File Manager",
+ "version": "2.4.6",
+ "language": [
+ {
+ "name": "Fill: English name for the language",
+ "code": "Fill: language ISO code",
+ "translation": {';
+ foreach ($arrStrings as $string)
+ {if (strlen($string[0])>3)
+ echo '
';
+ echo '
'.str_repeat(" ",8).$string[0].':'.
+ str_repeat(" ",$longest+3-strlen(utf8_decode(substr($string[0],0)))).
+ '"Missing_native_translated_string",';
+ };
+echo ' <- REMOVE THIS LAST COMMA !
+ }
+ },
+ {... Insert all other languages here ...}
+ ]
+}
+