salarcode / AutoResxTranslator

A tool to automatically translate Resx files to any language using Google Translator. No API key is required for the translator. This tool also provides a text translator out of the box.
92 stars 37 forks source link

Addition of Microsoft Cognitive Translation Service and a Tab to select the preferred Translations service #8

Closed SudarshanSMD closed 5 years ago

SudarshanSMD commented 5 years ago

Addition of Microsoft Cognitive Translations service

We have leveraged Microsoft's Cognitive Translations service for providing the translations. We already have free translations service provided by Google. However, the free service by Google has limited throughput. This is noticeable especially when translation resources file. Addition of Microsoft's Cognitive Translations service would enable people who have a subscription to the Azure Cognitive services to leverage it and get fast performance.

Addition of new tab for selecting the preferred Translations service

We have added a new tab for a selection of Preferred Translation service. By default, Google translation service is used. User can select the Microsoft radio button to change the preferred translation service to Microsoft Cognitive Translations service. frmMain has the PreferredService variable, depending on which respective service is invokes for translation.

salarcode commented 5 years ago

Thanks, I'll review it later on

SudarshanSMD commented 5 years ago

I've added a new commit to fix a bug in MSTranslationService.

We had a bug in MSTranslations service. If the translations were made wherein the source language was explicitly specified, we would get an exception. It was just a just matter of no null check for the detected language. We have removed the line for getting detected language, as it was just used for logging on the console.

salarcode commented 5 years ago

There is a lot of bad design decisions you have made. I'll merge this request and fix them in the next commit. Good learning point for you. Also i'll mention them as a comment here.

salarcode commented 5 years ago

I've fixed your merge, check it out here: https://github.com/salarcode/AutoResxTranslator/commit/8fdcad31ced167f53020c6aa5b3d4dae67537e0f

SudarshanSMD commented 5 years ago

@salarcode Thank you for the review and the suggestions on the better approach.

I should have spent some more time on the code.