public TranslationRequest(Text destination, TranslationType?t, string text, TranslationConsumer consumer) { Destination = destination; Type = t; Text = text; Consumer = consumer; }
private async void internalTranslate(Text destination, TranslationType type, string text, TranslationConsumer consumer) { try { string res = await _translators[type].Translate(text); consumer.TranslationCallback(destination, res, type); } catch (Exception e) { consumer.TranslationFailed(e, type); } }