Revert "Multi-language support"

This reverts commit 48600a1a36.
This commit is contained in:
bergware
2020-05-14 12:20:22 +02:00
parent 48600a1a36
commit 62055e9b17

View File

@@ -21,10 +21,10 @@ function _($text) {
return strpos($data,'*')===false ? $data : preg_replace(['/\*\*(.+?)\*\*/','/\*(.+?)\*/'],['<b>$1</b>','<i>$1</i>'],$data);
}
function parse_lang_file($file) {
return array_filter(parse_ini_string(preg_replace(['/^(null|yes|no|true|false|on|off|none)=/mi','/^([^>].*)=(.*)$/m','/^:(.+_(help|plug)):$/m','/^:end$/m'],['$1.=','$1="$2"','_$1_="','"'],str_replace('"','&#34;',file_get_contents($file))),false,INI_SCANNER_RAW),'secured',ARRAY_FILTER_USE_BOTH);
return array_filter(parse_ini_string(preg_replace(['/^(null|yes|no|true|false|on|off|none)=/mi','/^([^>].*)=(.*)$/m','/^:(.+_(help|plug)):$/m','/^:end$/m'],['$1.=','$1="$2"','_$1_="','"'],str_replace('"','&#34;',file_get_contents($file)))),'secured',ARRAY_FILTER_USE_BOTH);
}
function parse_help_file($file) {
return parse_ini_string(preg_replace(['/^([^:;].+)/m','/^:(.+_help):$/m','/^:end$/m'],['>$1','_$1_="','"'],str_replace('"','&#34;',file_get_contents($file))),false,INI_SCANNER_RAW);
return parse_ini_string(preg_replace(['/^([^:;].+)/m','/^:(.+_help):$/m','/^:end$/m'],['>$1','_$1_="','"'],str_replace('"','&#34;',file_get_contents($file))));
}
function parse_text($text) {
return preg_replace_callback('/_\((.+?)\)_/m',function($m){return _($m[1]);},preg_replace(["/^:(.+_help):$/m","/^:(.+_plug):$/m","/^:end$/m"],["<?translate(\"_$1_\");?>","<?if (translate(\"_$1_\")):?>","<?endif;?>"],$text));