lances101 / Wox.Plugin.GoogleTranslate

10 stars 9 forks source link

The program does not translate the entire text. #10

Open it19862 opened 5 years ago

it19862 commented 5 years ago

I enter the text This latest version of GoogleTranslator utilizes Google Translate's AJAX APIs to translate text and retrieves the translation by parsing the returned JSON content. Thanks to CPians @Airstriker82, @member 9899010 and @bgsjust for pointing me to these APIs. The latest version of the code also includes the ability to speak the translation from the demo app. Because Google limits the speech to common words in a few languages, don't be surprised if the demo plays dumb when you try to speak your translated text!

The program translates text only. This latest version of GoogleTranslator utilizes Google Translate's AJAX APIs to translate text and retrieves the translation by parsing the returned JSON content. the rest does not translate

How to make proagramma translate the entire text?

using Wox.Plugin.GoogleTranslate;

namespace rsh
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            GoogleTranslatePlugin GgTransl = new GoogleTranslatePlugin();

            string input = textBox1.Text;
            string from = "en";
            string to = "ru";

            textBox2.Text = GgTransl.TranslateText(input, from, to);            
        }
    }
}

2018-10-15_10-59-43