private void UpdateTargetList() { TranslationSession?.Cancel(); SelectedItems.Clear(); if (_sourceCulture == null) { Items = new TranslationItem[0]; return; } Items = GetItemsToTranslate(_resourceViewModel.ResourceTableEntries, _sourceCulture, _configuration.EffectiveTranslationPrefix, _selectedTargetCultures); ApplyExistingTranslations(_resourceViewModel.ResourceTableEntries, Items, _sourceCulture); TranslationSession = new TranslationSession(_sourceCulture.Culture, _configuration.NeutralResourcesLanguage, Items.Cast <ITranslationItem>().ToArray()); _translatorHost.Translate(TranslationSession); }
private void UpdateTargetList() { TranslationSession?.Cancel(); SelectedItems.Clear(); var sourceCulture = SourceCulture; if (sourceCulture == null) { Items = new TranslationItem[0]; return; } var itemsToTranslate = GetItemsToTranslate(_resourceViewModel.ResourceTableEntries, sourceCulture, SelectedTargetCultures, Configuration.EffectiveTranslationPrefix); Items = new ObservableCollection <ITranslationItem>(itemsToTranslate); TranslationSession = new TranslationSession(sourceCulture.Culture, Configuration.NeutralResourcesLanguage, itemsToTranslate); _translatorHost.Translate(TranslationSession); }
private void Stop() { TranslationSession?.Cancel(); }