Translator is a cloud-based machine translation service you can use to translate text in near real-time through a simple REST API call. It can dynamically translate text between thousands of language pairs. It lets SubtitleNEXT programmatically integrate with the translation service. To set the preferences of the service for the translator, go to Options > Preferences > Translators.
SubtitleNEXT offers to integrate with three translator engines i.e. Google Translators, Microsoft Translators, and LibreTranslate Translators. The steps to integrate any/ all translators is as below;
Google Translator is offered in various Editions (Basic and Advanced) with their own pricing plans.
The basic edition i.e. V1 offers translation of plain text or HTML. Basic does not translate any HTML tags in the input, only text that appears between the tags. The output retains the (untranslated) HTML tags, with the translated text between the tags to the extent possible due to differences between the source and target languages. The order of HTML tags in the output may differ from the order in the input text due to word order changes in the translation. On the other hand, the advanced edition i.e. V3 introduces support for translating text using custom AutoML Translation models, and for creating glossaries to ensure that the Cloud Translation API translates a customer's domain-specific terminology correctly.
To sign up for the respective version of Goolge Translator, you need to sign up to get an API key. The API key is a unique identifier that is used to authenticate requests associated with your project for usage and billing purposes. To get an API key:
A. Go to the Google Cloud Console.
B. Click the project drop-down and select or create the project for which you want to add an API key.
C. Click the menu button and select APIs & Services ▶ Credentials.
D. On the Credentials page, click Create Credentials ▶ API key. The API key created dialog displays the newly created API key.
E. Click Close. The new API key is listed on the Credentials page under API Keys. Copy the API key, and paste in the SubtitleNEXT translator window.
Next, if you want to add Microsoft Azure Translator as well in SubtitleNEXT, select the respective option in preferences, and add API key, and token endpoint to configure the translator. To get an API key, and Token Endpoint, follow the below steps.
A. To get started, you'll need an active Azure account. If you don't have one, you can create a free 12-month subscription.
B. Once done, navigate to the Azure Portal home page.
C. Select +Create a resource from the Azure services menu.
D. In the Search the Marketplace search box, enter and select Translator (single-service resource)
E. Select Create and you will be taken to the project details page.
F. Complete your project and instance details
a. Subscription. Select one of your available Azure subscriptions.
b. Resource Group. The Azure resource group that you choose serve as a virtual container for your new resource. You can create a new resource group or add your resource to a pre-existing resource group that shares the same lifecycle, permissions, and policies.
c. Resource Region. Choose Global unless your business or application requires a specific region. Translator is a non-regional service—there is no dependency on a specific Azure region.
d. Name. Enter the name you have chosen for your resource. The name you choose must be unique within Azure. Note - If you are using a Translator feature that requires a custom domain endpoint, the value that you enter in the Name field will be the custom domain name parameter for the endpoint.
e. Pricing tier. Select a pricing tier that meets your needs:
· Each subscription has a free tier.
· The free tier has the same features and functionalities as paid plans and doesn't expire.
· Only have one free subscription per account is allowed.
f. Select Review + Create.
g. Review the service terms and select Create to deploy your resource.
h. After your resource has successfully deployed, select Go to resource.
G. Authentication keys and endpoint URL - All Cognitive Services API requests require an endpoint URL and a read-only key for authentication.
a. Authentication keys. Your key is a unique string that is passed on every request to the Translation service. You can pass your key through a query-string parameter or by specifying it in the HTTP request header.
b. Endpoint URL. Use the Global endpoint in your API request unless you need a specific Azure region. The Global endpoint URL is api.cognitive.microsofttranslator.com.
H. Get your authentication keys and endpoint
a. After your new resource deploys, select Go to resource or navigate directly to your resource page.
b. In the left rail, under Resource Management, select Keys and Endpoint.
c. Copy and paste your subscription keys and endpoint URL in a convenient location, such as Microsoft Notepad.
I. Paste the respective information in SubtitleNEXT window. Viola! The service is configured.
Finally, if you want to configure the LibreTranslate Translator, check the respective option, and enter the server URL. The public API on libretranslate.com should be used for testing, personal or infrequent use. If you're going to run an application in production, you need to host your own server or get in touch with LibreTranlsate Translator to obtain an API key.
Once you configure the translator engines, click ok to save the settings.