mirror of
https://github.com/unraid/webgui.git
synced 2026-01-25 11:09:03 -06:00
Multi-language support
This commit is contained in:
@@ -21,7 +21,7 @@ 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('"','"',file_get_contents($file)))),'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(['"',"=\n"],[""","=\"\"\n"],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('"','"',file_get_contents($file))));
|
||||
|
||||
Reference in New Issue
Block a user