Comments (9)
I can come up with two possibilities that could cause this failure:
- The dialog depends on the app being able to enumerate the supported file formats form the document translation service: https://docs.microsoft.com/en-us/azure/cognitive-services/translator/document-translation/reference/get-supported-document-formats. If that fails, the document picker doesn't show. Normally the configuration "Test" should have found that though.
- The dialog itself is a regular operating system call from .Net 5 libraries. Can you try reinstalling the .Net 5 runtime from https://dotnet.microsoft.com/download/dotnet/5.0? If you are running Visual Studio 2019, you get it with Visual Studio 16.11.0 and no need to install the runtime separately.
from documenttranslation.
If you are in a bind translating something right now, you can use the command line version to translate.
from documenttranslation.
@MarcMoeHx: Did any of this help? Note there is also a new version of the compiled binary out there, version 0.8.5.0. I don't think any of the changes affect the bug you observed, but worth a try.
Let me know what you find.
from documenttranslation.
Hello,
will updtae my visual studio to 2019 16.11
Had an older version installed, maybe this will solve the problem.
I will come back after testing.
Thank you very much for your fast reply
from documenttranslation.
Hi Marc,
can you let me know if the update had the desired effect?
The code in question is quite simple. It is in the DocumentBrowseButton_Click method in Mainwindow.xaml.cs:
private async void DocumentBrowseButton_Click(object sender, RoutedEventArgs e)
{
ResetUI();
ViewModel.FilesToTranslate.Clear();
OpenFileDialog openFileDialog = new() { RestoreDirectory = true, CheckFileExists = true, Multiselect = true };
if (ViewModel.UISettings.lastDocumentsFolder is not null) openFileDialog.InitialDirectory = ViewModel.UISettings.lastDocumentsFolder;
try
{
openFileDialog.Filter = await ViewModel.GetDocumentExtensionsFilter();
}
catch (Azure.RequestFailedException ex)
{
StatusBarText1.Text = Properties.Resources.msg_Error;
if (ex.Status == 401 || ex.Status == 403) StatusBarText2.Text = Properties.Resources.msg_S1OrHigherTierRequired;
else StatusBarText2.Text = ex.Message;
await Task.Delay(2000);
StatusBarText1.Text = string.Empty;
StatusBarText2.Text = string.Empty;
return;
}
openFileDialog.ShowDialog();
foreach (var filename in openFileDialog.FileNames)
ViewModel.FilesToTranslate.Add(filename);
FilesListBox.ItemsSource = ViewModel.FilesToTranslate;
if (ViewModel.FilesToTranslate.Count > 0)
{
if (string.IsNullOrEmpty(TargetTextBox.Text)) TargetTextBox.Text = Path.GetDirectoryName(ViewModel.FilesToTranslate[0]) + "." + toLanguageBoxDocuments.SelectedValue as string;
if (!string.IsNullOrEmpty(TargetTextBox.Text)) translateDocumentsButton.IsEnabled = true;
}
else translateDocumentsButton.IsEnabled = false;
return;
}
I suspect the failure happens in this line:
openFileDialog.Filter = await ViewModel.GetDocumentExtensionsFilter();
Can you step through it and see where it fails in your situation?
from documenttranslation.
Also, can you have a look at the output window? It should show something like this:
Note the GetFormats: Response: value. Are you getting this line?
GetFormats: Response: {"Value":[{"FormatVersions":[],"DefaultFormatVersion":null,"Format":"PlainText","FileExtensions":[".txt"],"ContentTypes":["text/plain"]},{"FormatVersions":[],"DefaultFormatVersion":null,"Format":"OpenXmlWord","FileExtensions":[".docx"],"ContentTypes":["application/vnd.openxmlformats-officedocument.wordprocessingml.document"]},{"FormatVersions":[],"DefaultFormatVersion":null,"Format":"OpenXmlPresentation","FileExtensions":[".pptx"],"ContentTypes":["application/vnd.openxmlformats-officedocument.presentationml.presentation"]},{"FormatVersions":[],"DefaultFormatVersion":null,"Format":"OpenXmlSpreadsheet","FileExtensions":[".xlsx"],"ContentTypes":["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"]},{"FormatVersions":[],"DefaultFormatVersion":null,"Format":"OutlookMailMessage","FileExtensions":[".msg"],"ContentTypes":["application/vnd.ms-outlook"]},{"FormatVersions":[],"DefaultFormatVersion":null,"Format":"HtmlFile","FileExtensions":[".html",".htm"],"ContentTypes":["text/html"]},{"FormatVersions":[],"DefaultFormatVersion":null,"Format":"PortableDocumentFormat","FileExtensions":[".pdf"],"ContentTypes":["application/pdf"]},{"FormatVersions":["1.0","1.1","1.2"],"DefaultFormatVersion":null,"Format":"XLIFF","FileExtensions":[".xlf"],"ContentTypes":["application/xliff\u002Bxml"]},{"FormatVersions":[],"DefaultFormatVersion":null,"Format":"TSV","FileExtensions":[".tsv",".tab"],"ContentTypes":["text/tab-separated-values"]},{"FormatVersions":[],"DefaultFormatVersion":null,"Format":"CSV","FileExtensions":[".csv"],"ContentTypes":["text/csv"]},{"FormatVersions":[],"DefaultFormatVersion":null,"Format":"RichTextFormat","FileExtensions":[".rtf"],"ContentTypes":["application/rtf"]},{"FormatVersions":[],"DefaultFormatVersion":null,"Format":"WordDocument","FileExtensions":[".doc"],"ContentTypes":["application/msword"]},{"FormatVersions":[],"DefaultFormatVersion":null,"Format":"PowerpointPresentation","FileExtensions":[".ppt"],"ContentTypes":["application/vnd.ms-powerpoint"]},{"FormatVersions":[],"DefaultFormatVersion":null,"Format":"ExcelSpreadsheet","FileExtensions":[".xls"],"ContentTypes":["application/vnd.ms-excel"]},{"FormatVersions":[],"DefaultFormatVersion":null,"Format":"OpenDocumentText","FileExtensions":[".odt"],"ContentTypes":["application/vnd.oasis.opendocument.text"]},{"FormatVersions":[],"DefaultFormatVersion":null,"Format":"OpenDocumentPresentation","FileExtensions":[".odp"],"ContentTypes":["application/vnd.oasis.opendocument.presentation"]},{"FormatVersions":[],"DefaultFormatVersion":null,"Format":"OpenDocumentSpreadsheet","FileExtensions":[".ods"],"ContentTypes":["application/vnd.oasis.opendocument.spreadsheet"]},{"FormatVersions":[],"DefaultFormatVersion":null,"Format":"Markdown","FileExtensions":[".markdown",".mdown",".mkdn",".md",".mkd",".mdwn",".mdtxt",".mdtext",".rmd"],"ContentTypes":["text/markdown","text/x-markdown","text/plain"]},{"FormatVersions":[],"DefaultFormatVersion":null,"Format":"Mhtml","FileExtensions":[".mhtml",".mht"],"ContentTypes":["message/rfc822","application/x-mimearchive","multipart/related"]}]}
from documenttranslation.
Hello,
thank you for your help and sorry about late response.
I have created a new Azure Ressource for translation, now it works with the DocumentTranslation.
Interesting part:
the old ressource which not work with this repo is working with the older translator...
So, problem is solved for me :-)
Thank you
from documenttranslation.
Thanks for letting me know.
Was the old resource a free one? Document translation does require paid, S1 or higher.
I thought I had tested with free resource though, and the app should have produced a warning.
from documenttranslation.
Added exception handlers around it, added checks into the "Test" function in the Settings page, bubbled up server error messages to the status bar and to the error log. In 0.8.7.5.
from documenttranslation.
Related Issues (20)
- Using incorrect language code for Kurdish dialects
- EndNote plugin and other Word fields are converted to plain text in Word document HOT 4
- GUI won't load after install (CLI OK) HOT 3
- Translate entire folder as source HOT 4
- Issue with CLI Usage HOT 9
- Translation of an empty folder causes an erroneous error message about invalid or missing credentials HOT 1
- Unable to translate OneDrive folder HOT 1
- Azure Translator Service Keys are not working within the tool HOT 26
- Issue with Microsoft Translator tool HOT 5
- Unable to test successfully HOT 6
- DITA XML format HOT 9
- Custom Translate does not work for document translation but text translation HOT 3
- Unable to use application behind corporate proxy HOT 3
- HttpRequestException InnerException can be null HOT 3
- Central deployment of appsettings.json in locked-down clients HOT 1
- Make the proxy settings settable via command line (CLI)
- json files compatibility HOT 2
- Unable to locate DocumentTranslation Privacy Policy HOT 4
- Set KeyVaultURI via command line switch at install? HOT 1
- Add a link to relevant privacy documentation HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from documenttranslation.