microsoft-translator-java-api

A Java wrapper for the Microsoft Translator API

License

License

Categories

Categories

Java Languages reMap General Purpose Libraries Bean Mapping
GroupId

GroupId

io.github.firemaples
ArtifactId

ArtifactId

microsoft-translator-java-api
Last Version

Last Version

0.8.8.1
Release Date

Release Date

Type

Type

jar
Description

Description

microsoft-translator-java-api
A Java wrapper for the Microsoft Translator API
Project URL

Project URL

https://github.com/firemaples/microsoft-translator-java-api
Source Code Management

Source Code Management

https://github.com/firemaples/microsoft-translator-java-api

Download microsoft-translator-java-api

How to add to project

<!-- https://jarcasting.com/artifacts/io.github.firemaples/microsoft-translator-java-api/ -->
<dependency>
    <groupId>io.github.firemaples</groupId>
    <artifactId>microsoft-translator-java-api</artifactId>
    <version>0.8.8.1</version>
</dependency>
// https://jarcasting.com/artifacts/io.github.firemaples/microsoft-translator-java-api/
implementation 'io.github.firemaples:microsoft-translator-java-api:0.8.8.1'
// https://jarcasting.com/artifacts/io.github.firemaples/microsoft-translator-java-api/
implementation ("io.github.firemaples:microsoft-translator-java-api:0.8.8.1")
'io.github.firemaples:microsoft-translator-java-api:jar:0.8.8.1'
<dependency org="io.github.firemaples" name="microsoft-translator-java-api" rev="0.8.8.1">
  <artifact name="microsoft-translator-java-api" type="jar" />
</dependency>
@Grapes(
@Grab(group='io.github.firemaples', module='microsoft-translator-java-api', version='0.8.8.1')
)
libraryDependencies += "io.github.firemaples" % "microsoft-translator-java-api" % "0.8.8.1"
[io.github.firemaples/microsoft-translator-java-api "0.8.8.1"]

Dependencies

compile (2)

Group / Artifact Type Version
com.googlecode.json-simple : json-simple jar 1.1
com.google.code.gson : gson jar 2.8.5

test (1)

Group / Artifact Type Version
junit : junit jar 4.12

Project Modules

There are no modules declared in this project.

microsoft-translator-java-api

GitHub version Maven Central Bintray

Provides a Java wrapper around the Microsoft Translator API aka Bing Translator.

Created in an attempt to fill the void left by the deprecation of the Google Translate API announced on May 26, 2011 and scheduled for permanent shutdown on December 1, 2011.

In an effort to lessen the impact on Java developers that have previously integrated the Google Translate API into their applications, it is my goal to mimic the code structure, naming conventions, functionality, and usage patterns of the excellent and widely used google-api-translate-java by Rich Midwinter.

Requires

  • Java 1.5 or greater
  • A Windows Azure Portal Subscription Key (See the picture below, just use one of key 1 or key 2) - Documentation

Please note: If you signed up for a Bing Developer Key after March 31, 2012, you will not be able to use your App Id with this API. Please visit the aforementioned documentation link

Quickstart

Use Maven, Gradle or Download the latest JAR with dependencies

import io.github.firemaples.language.Language;
import io.github.firemaples.translate.Translate;

public class Main {
  public static void main(String[] args) throws Exception {
    // Set your Azure Portal Subscription Key - See https://www.microsoft.com/cognitive-services/en-us/translator-api/documentation/TranslatorInfo/overview
    Translate.setSubscriptionKey(/* Enter your Windows Azure Subscription Key here */);

    String translatedText = Translate.execute("Bonjour le monde", Language.FRENCH, Language.ENGLISH);

    System.out.println(translatedText);
  }
}

More Examples

I've posted some examples to the SVN repository on Google Code. The examples include:

Maven

<dependency>
  <groupId>io.github.firemaples</groupId>
  <artifactId>microsoft-translator-java-api</artifactId>
  <version>0.8.8.1</version>
  <type>pom</type>
</dependency>

Gradle

dependencies {
    compile 'io.github.firemaples:microsoft-translator-java-api:0.8.8.1'
}

Build JAR

There is a ready jar file you can just download (https://github.com/firemaples/microsoft-translator-java-api/blob/master/microsoft-translator-java-api-with-dependencies-0.8.8.1.jar) , or you can build it by yourself:

Download this project

Run following command in the project folder

./gradlew microsoft-translator-java-api:fatJar

After the command running finished, yur will found the output jar file in the path:

./microsoft-translator-java-api/microsoft-translator-java-api/build/libs/microsoft-translator-java-api-with-dependencies-x.x.x.jar

License

The microsoft-translator-java-api is licensed under the Apache License, Version 2.0

/*
 * Copyright 2011-2015 Jonathan Griggs.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

Please note that while this license does not distinguish between personal, internal or commercial use, the Microsoft Translator API itself does in fact make this distinction.

If you intend to use the Microsoft Translator API for commercial or high volume purposes, you would need to sign a commercial license agreement and provide your appID to the Microsoft Translator team. For more details contact [email protected]. This allows the Microsoft Translator team to better tune the service to the needs of our many partners, and avoid abuse.

Versions

Version
0.8.8.1
0.8.7
0.8.6
0.8.5
0.8.4.1
0.8.4
0.8.3