def load(self,path): self.strings = {} tempstrings = [] self.language = xbmc.getLanguage().lower() if os.path.exists(path+self.language+".xml"): self.foundlang = self.language else: self.foundlang = "english" self.langdoc = path+self.foundlang+".xml" print "-Loading Language: " + self.foundlang try: f=open(self.langdoc,'r') tempstrings=f.read() f.close() except: print "Error: Languagefile "+self.langdoc+" cant be opened" self.exp='(.*?)' self.res=re.findall(self.exp,tempstrings) for stringdat in self.res: self.strings[int(stringdat[0])] = str(stringdat[1])