Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class translang:
- __file = ""
- __trans = 1
- def __init__(self,lang,translate_n = 1):
- self.__file = lang
- self.__trans = translate_n
- def translate(self,stringa):
- rem = []
- stop = 0
- o = open(self.__file)
- for line in o:
- if line[0:7] == "_oldmsg" or line[0:7] == "_newmsg":
- line_mod = line.strip().replace("_oldmsg = ","").replace("_newmsg = ","").replace('"',"")
- if self.__trans == 1:
- if stop == 1:
- return line_mod
- elif stop == 0:
- if line_mod == stringa:
- stop = 1
- else:
- rem.append(line_mod)
- if line_mod == stringa:
- return rem[len(rem)-2]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement