public DetectLanguagePage() { this.Title = "Detect"; InitializeComponent(); this.BindingContext = this; this.translator = TranslatorFactory.CreateTranslator(); }
public SpeakPage() { this.Title = "Dr. Sbaitso"; InitializeComponent(); this.translator = TranslatorFactory.CreateTranslator(); this.pickerLang.SelectedIndex = 1; }
public void TranslateWithUnsupportedCharactersTest() { TranslationInput translateInput = new TranslationInput("Chciałbym!", TranslatorType.L33tSp34k); ITranslator translator = TranslatorFactory.CreateTranslator(translateInput); TranslationResult result = translator.Translate(translateInput); Assert.IsTrue(string.Equals(@"[#[14Ł8j|v|!", result.Translated)); }
public void TranslateTest() { TranslationInput translateInput = new TranslationInput("Advanced Field Solutions", TranslatorType.L33tSp34k); ITranslator translator = TranslatorFactory.CreateTranslator(translateInput); TranslationResult result = translator.Translate(translateInput); Assert.IsTrue(string.Equals(@"4)\/4^/[3) |""131) 501(_)710^/5", result.Translated)); }
public ActionResult Translate(string textToTranslate) { TranslationInput translationInput = new TranslationInput(textToTranslate, TranslatorType.L33tSp34k); ITranslator translator = TranslatorFactory.CreateTranslator(translationInput); TranslationResult translationResult = translator.Translate(translationInput); return(Json(translationResult)); }
public TranslatePage() { this.Title = "Translate"; InitializeComponent(); this.BindingContext = this; this.translator = TranslatorFactory.CreateTranslator(); pickerFrom.SelectedIndex = 1; pickerTo.SelectedIndex = 0; var connectivityService = DependencyService.Get <IConnectivityService> (); if (connectivityService != null) { var indicator = this.FindByName <ConnectivityView> ("connectivityIndicator"); connectivityService.CreateConnectivityWatchDog(connected => indicator.HasConnectivity = connected); } }