#require 'rubygems'
require "rtranslate"

Shoes.app :width => 600, :height => 350 do
  background rgb(250, 250, 108)	

	@eBox = edit_box :margin => 20, :width => -1
		
  stack :margin => 10 do
    @myLang = list_box :items => ["To Spanish", "To English"], :choose => "To Spanish"
  end
	stack :margin => 10 do
	  @mButton = button "Translate" do
	    if @myLang.text == "To English" 
	      @newText = Translate.t(@eBox.text, Language::SPANISH, Language::ENGLISH)
	    else
	      @newText = Translate.t(@eBox.text, Language::ENGLISH, Language::SPANISH)
	    end
      @myText.replace "You entered:\n" + @eBox.text
      @eBox.text = @newText
    end
  end
  stack :margin => 10 do
		@myText = para "Enter the words you want to translate into the box at the top, then select the language to translate to.  Then press the 'Translate' key.  The text you entered will be replaced with the translated text.  You can copy this text to the clipboard for use in other applications."
	end
end