Skip to content

Commit

Permalink
Version 1.0.6
Browse files Browse the repository at this point in the history
  • Loading branch information
raj-squarebits authored Nov 25, 2022
1 parent 8861139 commit 2140362
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 27 deletions.
45 changes: 20 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Add the below dependency in your app build.gradle file:

...
implementation ('com.github.DevnagriAI:android-java-sdk:1.0.5@aar') { transitive(true) }
implementation ('com.github.DevnagriAI:android-java-sdk:1.0.6@aar') { transitive(true) }
}
Expand Down Expand Up @@ -94,7 +94,7 @@ And inside code:
# Change Language

In case you don't want to use the system language, you can set a different language in the updateAppLocale method. The language code (locale) needs to be present in a release from Devnagri.

updateAppLocale may take some time (for example: 3-4 seconds), we suggest you to add a loader before calling updateAppLocale and stop in callback.

Locale locale = new Locale("hi");
BaseApplication.devNagriTranslationSdk.updateAppLocale(activity, locale, new ResponseListener() {
Expand Down Expand Up @@ -135,7 +135,7 @@ You can use these methods anywhere in your project and these will provide transl
@Override
public void onCallback(String translation) {
// use translated text here
}          
}
});


Expand Down Expand Up @@ -173,26 +173,21 @@ You can use these methods anywhere in your project and these will provide transl

# Get Translations Of JSON Object

// This method is used to convert the entire JSON object to requested language
// ignoreKeys -> Send a list of strings that you want to ignore during the conversion process
// This method is used to convert the entire JSON object to requested language
// ignoreKeys -> Send a list of strings that you want to ignore during the conversion process

JSONObject json = new JSONObject();
json.put("Name", "DevNagri SDK");
json.put("Language", "Java");

devNagriTranslationSdk.getTranslationOfJSON(jsonObjectValue,
ignoreKeys,
new GenericCallback<JSONObject>() {
@Override
public void onCallback(JSONObject translatedJsonObject) {
//Here you find translated JSON Object
}
});

# For Modular Approach
- Please add DevNagriSDK dependency in each module level gradle file.
- If you have multiple modules in your application, then in each module's base activity override the below method.

public AppCompatDelegate getDelegate() {
return MainApplication.devNagriTranslationSdk.fetchAppDelegate(this, super.getDelegate());
}
JSONObject json = new JSONObject();
json.put("Name", "DevNagri SDK");
json.put("Language", "Java");
devNagriTranslationSdk.getTranslationOfJSON(jsonObjectValue,
ignoreKeys,
new GenericCallback<JSONObject>() {
@Override
public void onCallback(JSONObject translatedJsonObject) {
//Here you find translated JSON Object
}
});




Binary file modified android-java-sdk.aar
Binary file not shown.
2 changes: 1 addition & 1 deletion jitpack.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
install:
- FILE="-Dfile=android-java-sdk.aar"
- mvn install:install-file $FILE -DgroupId=com.github.DevnagriAI -DartifactId=android-java-sdk -Dversion=1.0.5 -Dpackaging=aar -DpomFile=pom.xml
- mvn install:install-file $FILE -DgroupId=com.github.DevnagriAI -DartifactId=android-java-sdk -Dversion=1.0.6 -Dpackaging=aar -DpomFile=pom.xml
jdk:
- openjdk11
before_install:
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.github.DevnagriAI</groupId>
<artifactId>android-java-sdk</artifactId>
<version>1.0.5</version>
<version>1.0.6</version>
<!-- <packaging>aar</packaging>-->
<dependencies>
<dependency>
Expand Down

0 comments on commit 2140362

Please sign in to comment.