TranslateBing() public method

Uses the Bing API service to perform translation Bing can translate up to 1000 characters. Requires that you provide a CLientId and ClientSecret or set the configuration values for these two. More info on setup: http://weblog.west-wind.com/posts/2013/Jun/06/Setting-up-and-using-Bing-Translate-API-Service-for-Machine-Translation
public TranslateBing ( string text, string fromCulture, string toCulture, string accessToken = null ) : string
text string Text to translate
fromCulture string Two letter culture name
toCulture string Two letter culture name
accessToken string Pass an access token retrieved with GetBingAuthToken. /// If not passed the default keys from .config file are used if any
return string
        public string Translate(string Text, string From, string To, string Service)
        {
            Service = Service.ToLower();

            var translate = new TranslationServices();
            translate.TimeoutSeconds = 10;

            string result = null;
            if (Service == "google")
                result = translate.TranslateGoogle(Text, From, To);
            else if (Service == "bing")
            {
                if (string.IsNullOrEmpty(DbResourceConfiguration.Current.BingClientId))
                    result = ""; // don't do anything -  just return blank 
                else
                    result = translate.TranslateBing(Text, From, To);
            }

            if (result == null)
                result = translate.ErrorMessage;

            return result;
        }