mirror of
https://github.com/unraid/webgui.git
synced 2026-05-08 05:12:14 -05:00
Multi-language support
This commit is contained in:
@@ -27,7 +27,7 @@ function parse_help_file($file) {
|
||||
return preg_replace(['/^$/m','/^([^:;].+)$/m','/^:(.+_help):$/m','/^:end$/m'],['>','>$1','_$1_="','"'],str_replace(["\"\n",'"'],["\" \n",'\"'],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));
|
||||
return parse_ini_string(preg_replace_callback('/_\((.+?)\)_/m',function($m){return _($m[1]);},preg_replace(["/^:(.+_help):$/m","/^:(.+_plug):$/m","/^:end$/m"],["<?translate(\"_$1_\");?>","<?if (translate(\"_$1_\")):?>","<?endif;?>"],$text)));
|
||||
}
|
||||
function parse_file($file,$markdown=true) {
|
||||
return $markdown ? Markdown(parse_text(file_get_contents($file))) : parse_text(file_get_contents($file));
|
||||
|
||||
Reference in New Issue
Block a user