public void Translate_HellowWorld() { ITranslator translator = new MsAzureTranslator(SUBS_KEY); var sourceText = "Hello world"; var sourceLngCode = "en"; var targetLngCode = "ru"; var result = translator.TranslateString(sourceText, sourceLngCode, targetLngCode); Assert.NotNull(result); Assert.Equal("Всем привет".ToLower(), result.ToLower()); }
public MainWindow() { InitializeComponent(); dialogService = new DefaultDialogService(); jsonFileService = new JsonFileService(); var msAzureTraslator = new MsAzureTranslator(SUBS_KEY); var escapeTextProcessor = new EscapeTextWrapper(); translator = new LocalizationJsonTranslator(msAzureTraslator, escapeTextProcessor, escapeTextProcessor); _lngs = msAzureTraslator.AvailableLanguages; cbSourceLng.ItemsSource = _lngs; cbSourceLng.DisplayMemberPath = "Value"; cbSourceLng.SelectedValuePath = "Key"; cbTargetLng.ItemsSource = _lngs; cbTargetLng.DisplayMemberPath = "Value"; cbTargetLng.SelectedValuePath = "Key"; }