From 5565d59711c282c3d48f6ad8e04d209e3d6d6584 Mon Sep 17 00:00:00 2001 From: Vadim Dashevskiy Date: Thu, 17 Jan 2013 12:54:17 +0000 Subject: - lpgen.js: updated - langpacks/english: updated git-svn-id: http://svn.miranda-ng.org/main/trunk@3134 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- tools/lpgen/lpgen.js | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'tools') diff --git a/tools/lpgen/lpgen.js b/tools/lpgen/lpgen.js index b750926a30..35d13e5f44 100644 --- a/tools/lpgen/lpgen.js +++ b/tools/lpgen/lpgen.js @@ -427,13 +427,33 @@ function ParseSourceFile (SourceFile,array) { stringtolangpack=onestring.replace(/\\(['"])/g,"$1"); //if our string still exist, and length more than 2 symbol (nothing to translate if only two symbols, well, except No and OK, but they are in core. But dozens crap with variables are filtered) if (stringtolangpack.length>2) { + //brand new _T() crap filtering engine :) + clearstring=filter_T(stringtolangpack); //finally put string into array including cover [] - array.push("["+stringtolangpack+"]")}; + if (clearstring) {array.push("["+clearstring+"]")}}; } //close file, we've finish. sourcefile_stream.Close(); }; +//filter _T() function results +function filter_T(string) { +//filter not begin with symbols :.-[]"?;#~{!/_+$ +var filter1=/^[^\:\-\[\]\"\?\;\#\~\|\{\!\/\_\+\\$].+$/g; +//filter string starting from following words +var filter2=/^(?:(SOFTWARE\\|SYSTEM\\|http|ftp|UTF-|utf-|TEXT|EXE|exe|txt|css|html|dat|txt|MS\x20|CLVM|TM_|CLCB|CLSID|CLUI|d\x20|HKEY_|DWORD|WORD|BYTE|MButton|BUTTON|WindowClass|MHeader|RichEdit|RICHEDIT|STATIC|EDIT|CList|\d|listbox|LISTBOX|combobox|COMBOBOX|TitleB|std\w|iso-|windows-||\w\\\w|urn\:|<\?xml|<\!|h\d|%s[%\-\\]|\.!\.)).*$/g; +//filter string ending with following words +var filter3=/^.+(\.\w{2,4}|001|\/value|\*!\*|=)$/g; +test1=filter1.test(string); +test2=filter2.test(string); +test3=filter3.test(string); +//WScript.Echo(string+" 1: "+test1); +//WScript.Echo(string+" 2: "+test2); +if (test1 && !test2 && !test3) { + return string; + } else return; +}; + //Parse Version.h file to get one translated stirng from "Description" and make a pluging template header. function ParseVersion_h (VersionFile,array) { //If file zero size, return; -- cgit v1.2.3