import en, it


deflang='it'

dictionary = { 'en': en,
               'it': it
             }

def en2it(word):
   if word in it.en_it.keys():
      return it.en_it[word]
   return word

def it2en(word):
   if word in en.it_en.keys():
      return en.it_en[word]
   return word

def en_key_exists(word):
   if word in en.it_en.keys():
      return True
   return False

def it_key_exists(word):
   if word in it.en_it.keys():
      return True
   return False

def webstring(word, lang):
   try:
      return dictionary[lang].web[word]
   except:
      try:
         return dictionary[deflang].web[word]
      except:
         return word
