diff options
author | Basil <basil@miranda-ng.org> | 2013-02-19 06:56:12 +0000 |
---|---|---|
committer | Basil <basil@miranda-ng.org> | 2013-02-19 06:56:12 +0000 |
commit | be6491e9b6793e302eb9dd1859404ef29ea28e54 (patch) | |
tree | e33b9ef8cb40dc079a614ea04ff456a7ee4310d9 /tools/lpgen/lpgen.js | |
parent | bcf8c9367e7abf397acad64257f3c7e2ae2d29c8 (diff) |
additional filter for resource (*.rc) files.
If result does not have any letter, it's a crap. Dozen crap removed from many plugins.
git-svn-id: http://svn.miranda-ng.org/main/trunk@3638 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'tools/lpgen/lpgen.js')
-rw-r--r-- | tools/lpgen/lpgen.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/lpgen/lpgen.js b/tools/lpgen/lpgen.js index dc6edfdc97..b9bb283ee0 100644 --- a/tools/lpgen/lpgen.js +++ b/tools/lpgen/lpgen.js @@ -418,8 +418,8 @@ function ParseRCFile(RC_File,array) { rcline=RC_File_stream.ReadLine();
//find string to translate in rcline by regexp
rc_regexp=rcline.match(/\s*(?:CONTROL|(?:DEF)?PUSHBUTTON|[LRC]TEXT|AUTORADIOBUTTON|GROUPBOX|(?:AUTO)?CHECKBOX|CAPTION|MENUITEM|POPUP)\s*"((?:(?:""[^"]+?"")*[^"]*?)*)"\s*?(,|$|\\)/);
- // if exist rc_regexp, and our string length longer, than one symbol (indeed, translate only one simbol?) do checks, double "" removal and add strings into array
- if (rc_regexp && rc_regexp[1].length>1) {
+ // if exist rc_regexp, and our string length at least one symbol do checks, double "" removal and add strings into array
+ if (rc_regexp && rc_regexp[1].length>0) {
// check for some garbage like "List1","Tab1" etc. in *.rc files, we do not need this.
switch (rc_regexp[1]) {
case "List1": {break};
@@ -438,6 +438,8 @@ function ParseRCFile(RC_File,array) { case "Slider2": {break};
//default action is to wrote text inside quoted into array
default:
+ //check result. If it does not match [a-z] (no any letter in results, such as "..." or "->" it's a crap, break further actions.
+ if (!rc_regexp[1].match(/[a-z]/gi)) {break};
//if there is double "", replace with single one
stringtolangpack=rc_regexp[1].replace(/\"{2}/g,"\"");
//add string to array
|