diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-02-15 04:48:44 +0200 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-02-15 04:48:44 +0200 |
commit | 8d8ff5ec76e8b38aecdc295765215c37d1c4acd7 (patch) | |
tree | 65e104be4295f7a8f0b7c4d84eec5f62865505c6 /lang | |
parent | dc21419ffd767b6c59fbed0d25469101db1c26e8 (diff) | |
download | evol-tools-8d8ff5ec76e8b38aecdc295765215c37d1c4acd7.tar.gz evol-tools-8d8ff5ec76e8b38aecdc295765215c37d1c4acd7.tar.bz2 evol-tools-8d8ff5ec76e8b38aecdc295765215c37d1c4acd7.tar.xz evol-tools-8d8ff5ec76e8b38aecdc295765215c37d1c4acd7.zip |
lang: fix some bugs and add support for formatted l script command.
Diffstat (limited to 'lang')
-rwxr-xr-x | lang/updatelang.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/lang/updatelang.py b/lang/updatelang.py index 518e403..3cd9a7c 100755 --- a/lang/updatelang.py +++ b/lang/updatelang.py @@ -11,7 +11,8 @@ defaultLang = "en" filt = re.compile(".+[.]txt", re.IGNORECASE) allStrings = set() -strre1 = re.compile("[\t +(]l[(][\"](?P<str>[^\"]+)[\"][)]") +strre1 = re.compile("[\t +(]l[(][\"](?P<str>[^\"]+)[\"]") +#strre3 = re.compile("[\t +(]getitemlink[(][\"](?P<str>[^\"]+)[\"][)]") strre2 = re.compile("^[^/](.+)[.]gat([^\t]+)[\t](script|shop)[\t](?P<str>[\w ]+)[\t]([\d]+),") langFiles = dict() @@ -76,7 +77,8 @@ def addMissingLines(): oldFile = oldLangFiles[trans] for str in newFile: if str not in allStrings: - oldFile[str] = newFile[str] + if newFile[str] != "": + oldFile[str] = newFile[str] for str in oldFile: if str in newFile: del newFile[str] @@ -123,8 +125,9 @@ def writeFile(dir, texts): f.write (line[1] + "\n\n") -collectStrings("../../serverdata/npc") -loadFiles("../../serverdata/langs") +collectStrings("../../privserverdata/npc") +#here need collect names from item_db.txt +loadFiles("../../privserverdata/langs") addMissingLines() sorting() -saveFiles("../../serverdata/langs") +saveFiles("../../privserverdata/langs") |