72 lines
2 KiB
Python
72 lines
2 KiB
Python
langs = {
|
|
"NULL": {},
|
|
"en_EN": {
|
|
"game": "Game",
|
|
"objs": "Objects",
|
|
"scriptserv": "Scripts",
|
|
"soundserv": "Sounds",
|
|
"folder": "Folder",
|
|
"object": "Object",
|
|
"script": "Script",
|
|
"sound": "Sound",
|
|
"del": "Delete",
|
|
"file": "File",
|
|
"exit": "Exit",
|
|
"open": "Open",
|
|
"save": "Save",
|
|
"clear": "Clear",
|
|
"create": "Create",
|
|
"cut": "Cut",
|
|
"paste": "Paste",
|
|
"error": "Error",
|
|
"sysdel": "Critical game objects can not be deleted.",
|
|
"nameale": "Name is already being used.",
|
|
"rentitle": "Rename",
|
|
"rename": "Enter new name for: ",
|
|
"starttest": "Start test",
|
|
"stoptest": "Stop test",
|
|
"testmen": "Testing",
|
|
"xcamlabe": "X-Position of camera: ",
|
|
"ycamlabe": "Y-Position of camera: ",
|
|
"attribute": "Attribute",
|
|
"val": "Value",
|
|
"code": "Code",
|
|
"DCTE": "Double-click to expand",
|
|
"set-val": "Enter new value",
|
|
"done": "Done",
|
|
"c-attr": "Change attribute",
|
|
"suc": "Success!",
|
|
"id-clip": "ID successfully copied to clipboard!",
|
|
"im-img": "Import image",
|
|
"op-cmd": "Open console",
|
|
"im-img-nor": "Import image without rescaling",
|
|
"sav-q": "Save?",
|
|
"igc3img": "Ignore color at image importation",
|
|
"settings": "Settings",
|
|
"mov-fold": "Move folder",
|
|
},
|
|
}
|
|
class langhandler:
|
|
def __init__(self, LANGNOTFOUND="LANGNULL", TEXTNOTFOUND="NULL"):
|
|
self._langnf = LANGNOTFOUND
|
|
self._textnf = TEXTNOTFOUND
|
|
self._langs = {}
|
|
for i in langs:
|
|
self._langs[i] = langs[i]
|
|
if len(self._langs) <= 0:
|
|
print("NO languages found!")
|
|
self._langs["NULL"] = {
|
|
"NULL": "NULL",
|
|
}
|
|
self._lang = list(self._langs.keys())[0]
|
|
|
|
def setlang(self, new):
|
|
self._lang = new
|
|
|
|
def string(self, x):
|
|
if not self._lang in self._langs: return self._langnf
|
|
if not x in self._langs[self._lang]: return x
|
|
return self._langs[self._lang][x]
|
|
|
|
def getlangs(self):
|
|
return list(self._langs.keys()) |