Commit f190dd8d authored by Martin Matějek's avatar Martin Matějek

Refactor translation of actions to cleaner code

parent 81eee3aa
......@@ -52,15 +52,10 @@ class NotificationSkeleton:
def translate_actions(self, lang):
self._set_jinja_translation(lang)
actions = {}
parsed = yaml.safe_load(self.jinja_plugin_template.render())
for a in self.actions:
for pa in parsed['actions']:
if a == pa['name']:
actions[a] = pa['title']
return actions
return {
pa['name']: pa['title'] for pa in parsed['actions'] if pa['name'] in self.actions
}
def init_jinja_env(self):
"""
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment