refactoring to use the new ApplicationContext

This commit is contained in:
Vinicius Moreira
2019-08-30 18:57:24 -03:00
parent bd17594723
commit a6422c6edc
3 changed files with 10 additions and 8 deletions

View File

@@ -23,7 +23,7 @@ def find_manager(member):
return manager_found
def load_managers(context: ApplicationContext) -> List[SoftwareManager]:
def load_managers(locale: str, context: ApplicationContext) -> List[SoftwareManager]:
managers = []
for m in pkgutil.iter_modules():
@@ -37,7 +37,7 @@ def load_managers(context: ApplicationContext) -> List[SoftwareManager]:
locale_path = '{}/resources/locale'.format(module.__path__[0])
if os.path.exists(locale_path):
context.i18n.update(util.get_locale_keys(context.args.locale, locale_path))
context.i18n.update(util.get_locale_keys(locale, locale_path))
managers.append(manager_class(context=context))