File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # TranslateAPI
2+ Simple Java library to translate your text using Google Translate without using of API KEY
3+
4+ # Screenshot
5+ ![ alt text] ( https://raw.githubusercontent.com/iammannan/TranslateAPI/master/demo2.png )
6+
7+ # Download
8+
9+ * Step 1. Add it in your root build.gradle at the end of repositories:
10+ ``` java
11+ allprojects {
12+ repositories {
13+ ...
14+ maven { url ' https://jitpack.io' }
15+ }
16+ }
17+ ```
18+ * Step 2. Add the dependency
19+ ``` java
20+ dependencies {
21+ implementation ' com.github.iammannan:TranslateAPI:1.0'
22+ }
23+ ```
24+ * Full Code - Example
25+ ``` java
26+ TranslateAPI translateAPI = new TranslateAPI (
27+ Language . AUTO_DETECT , // Source Language
28+ Language . TAMIL , // Target Language
29+ " Your Text" ); // Query Text
30+
31+ translateAPI. setTranslateListener(new TranslateAPI .TranslateListener () {
32+ @Override
33+ public void onSuccess (String translatedText ) {
34+ Log . d(TAG , " onSuccess: " + translatedText);
35+ textView. setText(translatedText);
36+ }
37+
38+ @Override
39+ public void onFailure (String ErrorText ) {
40+ Log . d(TAG , " onFailure: " + ErrorText );
41+ }
42+ });
43+ ```
44+ ![ alt text] ( https://raw.githubusercontent.com/iammannan/TranslateAPI/master/demo1.png )
45+
You can’t perform that action at this time.
0 commit comments