Table of Contents
Welcome to the Wiki for DeepJ.
Usage/Setup
Gradle
Gradle
Go to your build.gradle file and type:
repositories {
maven {
url "https://git.nevets.tech/api/packages/5gi/maven"
}
}
and
dependencies {
implementation group: 'com.the5gi.deepj', name: 'DeepJ', version: 'VERSION'
}
Maven
Maven
Go to your pom.xml file and type:
<repositories>
<repository>
<id>gitea</id>
<url>https://git.nevets.tech/api/packages/5gi/maven</url>
</repository>
</repositories>
and
<dependencies>
<dependency>
<groupId>com.the5gi.deepj</groupId>
<artifactId>DeepJ</artifactId>
<version>VERSION</version>
</dependency>
</dependencies>
Create a new Translator:
Translator translator = new Translator(apiKey);
System.out.println(translator.translate(Translator.Language.Spanish, "Message to translate"));
this:
translator.translate(Translator.Language.Spanish, "Message to translate");
should return:
Mensaje para traducir
or use a Builder:
Translator.newBuilder().setAuthKey(String authKey).setSilent(boolean bool).build();
Use like a normal Translator. Learn how to set up global api keys.
Global API Keys
Follow the instuctions on this page to add DeepJ to your project.
Sometimes reusing your auth key many times can be repetative and annoying
This sets the default auth key
Translator.setGlobalAPIKey(apiKey)
Create a new Translator:
Translator translator = new Translator();
System.out.println(translator.translate(Translator.Language.Spanish, "Message to translate"));
this:
translator.translate(Translator.Language.Spanish, "Message to translate");
should return:
Mensaje para traducir
or use a Builder:
Translator.newBuilder().setGAK(boolean bool).setSilent(boolean bool).build();