Hello,
if a key / attribute is missing in the localeinfo in normally crashes and dont let you ingame - I added a "small" workaround for it (it's easy to implement):
Add these class into system.py
class LocaleInfoWrapper(object):
def __init__(self, wrapped):
self.wrapped = wrapped
def __getattr__(self, name):
# Perform custom logic here
try:
return getattr(self.wrapped, name)
except AttributeError:
dbg.TraceError("Locale attribute not found: {0}".format(name))
return "Locale not found: {0}".format(name)
Search for that:
# in this if case: 'pack.Exist(filename)'
return newmodule
Add this above:
if filename.lower() == "localeinfo.py":
sys.modules[name] = LocaleInfoWrapper(newmodule)
return sys.modules[name]
done, now you can start the game with missing locales and it will print in out to the TraceError
NOTE: This is just something I did because one of my clients work with locales and sometimes crashes my client, you need to adjust for e.g. supporting calling etc / formating strings.. blabla
For python3 you can define the __getattr__ function inside localeinfo.py which is way easier to implement:
Check here
best regards