From 4d3c2cfbd74057666899d830f4d5195b10ecb4fe Mon Sep 17 00:00:00 2001 From: Max Date: Fri, 10 May 2019 08:19:22 +0200 Subject: [PATCH] Improved code --- Calendar/Translator.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Calendar/Translator.py b/Calendar/Translator.py index 9d27774..0a523de 100644 --- a/Calendar/Translator.py +++ b/Calendar/Translator.py @@ -5,7 +5,7 @@ from settings import language and returns the translated phrase''' def translate(phrase, target_lang = language, dictionary_collection = dictionary_collection) : - dictionary = find_dictionary(dictionary_collection, phrase) + dictionary = find_dictionary(phrase, dictionary_collection) if dictionary == None: return phrase @@ -17,8 +17,7 @@ def translate(phrase, target_lang = language, dictionary_collection = dictionary else: return dictionary[default_language] - -def find_dictionary(dictionary_collection, phrase): +def find_dictionary(phrase, dictionary_collection = dictionary_collection): for dictionary in dictionary_collection: if phrase in dictionary.values(): return dictionary