summaryrefslogtreecommitdiff
path: root/lang
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-01-18 02:00:12 +0300
committerAndrei Karas <akaras@inbox.ru>2013-01-18 02:00:12 +0300
commit0b733c351967485bebc78f4d6801ab1b498d3f26 (patch)
tree666f9eb0e71c3c02af60178abd18eacb0547d098 /lang
parent5f58de0a3989067f6c06c75b2002fd1b919bbdb0 (diff)
downloadevol-tools-0b733c351967485bebc78f4d6801ab1b498d3f26.tar.gz
evol-tools-0b733c351967485bebc78f4d6801ab1b498d3f26.tar.bz2
evol-tools-0b733c351967485bebc78f4d6801ab1b498d3f26.tar.xz
evol-tools-0b733c351967485bebc78f4d6801ab1b498d3f26.zip
updatelang: add support for npc in new format.
Add old string translation restore from old files.
Diffstat (limited to 'lang')
-rwxr-xr-xlang/updatelang.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/lang/updatelang.py b/lang/updatelang.py
index d1e9bc6..7758ef4 100755
--- a/lang/updatelang.py
+++ b/lang/updatelang.py
@@ -1,7 +1,7 @@
#! /usr/bin/env python2.6
# -*- coding: utf8 -*-
#
-# Copyright (C) 2010-2011 Evol Online
+# Copyright (C) 2010-2013 Evol Online
# Author: Andrei Karas (4144)
import os
@@ -14,7 +14,7 @@ filt = re.compile(".+[.]txt", re.IGNORECASE)
allStrings = set()
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]+),")
+strre2 = re.compile("^[^/](.+)[.]gat([^\t]+)[\t](script|shop)[\t](?P<str>[\w ]+)[\t]([\d]+)(,|;)")
strre4 = re.compile("[\t +(]lg[(][\"](?P<str>[^\"]+)[\"]")
strre5 = re.compile("[\t +(]getitemname[(][\"](?P<str>[^\"]+)[\"][)]")
strre6 = re.compile("[\t ]mesn[ ][\"](?P<str>[^\"]+)[\"]")
@@ -165,9 +165,12 @@ def addMissingLines():
for str in allStrings:
for trans in langFiles:
newFile = langFiles[trans][0]
+ oldFile = oldLangFiles[trans][0]
if str not in newFile:
if trans == defaultLang:
newFile[str] = str
+ elif str in oldFile:
+ newFile[str] = oldFile[str]
else:
newFile[str] = ""
print trans + ":new string: " + str