Skip to content

Commit

Permalink
Version 1.1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
ganeshgaur committed Dec 6, 2022
1 parent 0ddaff4 commit f988957
Show file tree
Hide file tree
Showing 27 changed files with 94 additions and 85 deletions.
Binary file modified Sample/.gradle/7.0.2/executionHistory/executionHistory.bin
Binary file not shown.
Binary file modified Sample/.gradle/7.0.2/executionHistory/executionHistory.lock
Binary file not shown.
Binary file modified Sample/.gradle/7.0.2/fileHashes/fileHashes.bin
Binary file not shown.
Binary file modified Sample/.gradle/7.0.2/fileHashes/fileHashes.lock
Binary file not shown.
Binary file modified Sample/.gradle/7.0.2/fileHashes/resourceHashesCache.bin
Binary file not shown.
Binary file modified Sample/.gradle/7.0.2/javaCompile/classAnalysis.bin
Binary file not shown.
Binary file modified Sample/.gradle/7.0.2/javaCompile/jarAnalysis.bin
Binary file not shown.
Binary file modified Sample/.gradle/7.0.2/javaCompile/javaCompile.lock
Binary file not shown.
Binary file modified Sample/.gradle/7.0.2/javaCompile/taskHistory.bin
Binary file not shown.
Binary file modified Sample/.gradle/buildOutputCleanup/buildOutputCleanup.lock
Binary file not shown.
Binary file modified Sample/.gradle/buildOutputCleanup/outputFiles.bin
Binary file not shown.

This file was deleted.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

This file was deleted.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

This file was deleted.

This file was deleted.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

This file was deleted.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Sample/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 11 additions & 7 deletions Sample/.idea/modules/app/TranslationSDK.app.iml

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions Sample/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ android {

defaultConfig {

applicationId "com.test"
applicationId "com.java.test"
minSdk 19
targetSdk 31
versionCode 1
Expand Down Expand Up @@ -43,7 +43,7 @@ dependencies {
implementation 'androidx.navigation:navigation-fragment-ktx:2.4.1'
implementation 'androidx.navigation:navigation-ui-ktx:2.4.1'

implementation ('com.github.DevnagriAI:android-sdk:1.0@aar') {
implementation ('com.github.DevnagriAI:android-sdk:1.1.3@aar') {
transitive(true)
}

Expand Down
18 changes: 8 additions & 10 deletions Sample/app/src/main/java/com/translationsdk/BaseApplication.kt
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
package com.translationsdk

import android.app.Application
import android.util.Log
import com.devnagritranslationsdk.DevNagriTranslationSdk


class BaseApplication : Application() {

override fun onCreate() {
super.onCreate()

val strings=R.string::class.java.fields.map { it.name }
val arrays=R.array::class.java.fields.map { it.name }


val API_KEY="devnagri_9b3a4902cd4111ecbb6002bf838402f8"
DevNagriTranslationSdk.init(applicationContext,API_KEY,strings,arrays)


val strings=R.string::class.java.fields
val arrays=R.array::class.java.fields
val API_KEY="<Enter Your API Key Here>"
Log.d("DevNagriSDK_TAG", "Start init process")
DevNagriTranslationSdk.init(applicationContext,API_KEY,10,strings,arrays, null, initListener = {isInitialized, error ->
Log.d("DevNagriSDK_TAG", "Complete init process")
} )
}

}
11 changes: 9 additions & 2 deletions Sample/app/src/main/java/com/translationsdk/FirstFragment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package com.translationsdk

import android.app.AlertDialog
import android.os.Bundle
import android.util.Log
import androidx.fragment.app.Fragment
import android.view.LayoutInflater
import android.view.View
Expand Down Expand Up @@ -50,13 +51,19 @@ private var _binding: FragmentFirstBinding? = null
val listOfKeys=supportableLanguages.keys.toTypedArray()


var locale= Locale(supportableLanguages[listOfKeys[userSelectedIndex]])
var locale = Locale("en")
if (!supportableLanguages.isNullOrEmpty()) {
locale= Locale(supportableLanguages[listOfKeys[userSelectedIndex]])
}

AlertDialog.Builder(requireContext())
.setTitle(getString(R.string.change_app_language))
.setPositiveButton(getString(R.string.change)) { dialog, _ ->
dialog.dismiss()
DevNagriTranslationSdk.updateAppLocale(activity as MainActivity,locale)
Log.d("DevNagriSDK_TAG", "Start update App Locale")
DevNagriTranslationSdk.updateAppLocale(activity as MainActivity,locale, completionHandler = {isCompleted, error ->
Log.d("DevNagriSDK_TAG", "Complete update App Locale")
})
}
.setSingleChoiceItems(
listOfKeys,
Expand Down
4 changes: 2 additions & 2 deletions Sample/local.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
# Location of the SDK. This is only used by Gradle.
# For customization when using a Version Control System, please read the
# header note.
#Mon Apr 18 15:01:16 IST 2022
sdk.dir=/Users/gourav/Library/Android/sdk
#Mon Dec 05 17:39:53 IST 2022
sdk.dir=/home/ganeshgaur/Android/Sdk

0 comments on commit f988957

Please sign in to comment.