title: How to change the language at runtime in python/gettext?
body: <p>This is my first use of gettext in Python (and gettext generally). I understood many things and my test application works well: one command line parameter changes the language of output messages.</p>
  
  <p>Now I'd like to let the user change the language at startup.</p>
  
  <p>I know I can load many translations and install one of them at run-time, however many strings are already translated with the old language and will not change again.</p>
  
  <p>Any simple solution?</p>
  
  <pre><code>import gettext
  
  language = "it"
  t_en = gettext.translation("messages", localedir="locale", languages=["en"], fallback=True)
  t_it = gettext.translation("messages", localedir="locale", languages=["it"], fallback=True)
  
  
  def language_install():
      if language == "it":
          t_it.install()
      else:
          t_en.install()
  
  language_install()
  main_menu = [_("First item"), _("Second item"), _("Switch language"), _("Exit")]
  
  while True:
      print("MAIN MENU")
      print("---------")
      for (n, item) in enumerate(main_menu):
          print("{:d}: ".format(n + 1) + item)
      print("")
      ans = input(_("Select an item") + ": ")
      if ans == "4":
          break
      elif ans == "3":
          if language == "en":
              language = "it"
          else:
              language = "en"
          language_install()
      else:
          print(_("You have selected item") + " " + ans)
  </code></pre>