Esempio n. 1
0
    public string Translate(string Text, string From, string To, string Service)
    {
        Service = Service.ToLower();

        TranslationServices Translate = new TranslationServices();
        Translate.TimeoutSeconds = 10;

        string Result = null;
        if (Service == "google")
            Result = Translate.TranslateGoogle(Text, From, To);
        else if (Service == "babelfish")
            Result = Translate.TranslateBabelFish(Text, From, To);

        if (Result == null)
            Result = Translate.ErrorMessage;

        return Result;
    }