moved the logic to languagechooser