So it's not perfect but it does come up with something:
Screen1 = Screen(AppName = "Vertalen")
TextBox1 = TextBox(Screen1, Text = "")
LanguageList = ListView(Screen1, ElementsFromString = "en,nl,fr,de,es,it")
TranslateButton = Button(Screen1, Text = "Translate")
Translator1 = Translator(Screen1)
when TranslateButton.Click():
call Translator1.RequestTranslation(lists_select_item(["en", "nl", "fr", "de", "es", "it"], LanguageList.Selection), TextBox1.Text)
when Translator1.GotTranslation(responseCode, translation):
set TextBox1.Text = translation
Importantly, it seems to still use the English "Translate" for the button text. There's also a logic bug in that Codex selects the Selection
property rather than SelectionIndex
to look up the entry in the list. Of course, that logic could be simplified to just LanguageList.Selection
rather than this weird lookup in the list, but I think that's partly because we don't have enough examples for Codex to recognize the relationship between the ElementsFromString
property and the Selection
property.