File tree Expand file tree Collapse file tree 5 files changed +7
-2
lines changed
app/src/main/java/com/kharagedition/tibetankeyboard Expand file tree Collapse file tree 5 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -464,6 +464,9 @@ class AIKeyboardView @JvmOverloads constructor(
464464 aiReplaceBtn.text = context.getString(R .string.use_translation)
465465 aiInrBtn.visibility = View .VISIBLE
466466 aiInrBtn.text = context.getString(R .string.translate);
467+ if (result.error!= null ){
468+ showError(" Translation error: ${result.error} " )
469+ }
467470 }
468471
469472 private fun showRephraseResult (result : RephraseResult ) {
Original file line number Diff line number Diff line change @@ -70,6 +70,7 @@ class AIService {
7070 println (" Translation error: ${e.message} " )
7171 e.printStackTrace()
7272 TranslationResult (
73+ error = e.message,
7374 translatedText = text,
7475 sourceLanguage = getLanguageName(sourceLang),
7576 targetLanguage = getLanguageName(targetLang),
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ data class TranslationResult(
1919 val translatedText : String ,
2020 val sourceLanguage : String ,
2121 val targetLanguage : String ,
22+ val error : String? = null
2223)
2324
2425// Translation API Request/Response data classes
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import androidx.lifecycle.LiveData
66import androidx.lifecycle.MutableLiveData
77import com.google.firebase.auth.FirebaseAuth
88import com.google.firebase.firestore.FirebaseFirestore
9+ import com.kharagedition.tibetankeyboard.BuildConfig
910import com.revenuecat.purchases.*
1011import com.revenuecat.purchases.interfaces.*
1112import com.revenuecat.purchases.models.StoreTransaction
@@ -205,7 +206,7 @@ class RevenueCatManager private constructor() {
205206 */
206207 private fun updatePremiumStatus (customerInfo : CustomerInfo ) {
207208 val isPremium = customerInfo.entitlements[PREMIUM_ENTITLEMENT_ID ]?.isActive == true
208- _isPremiumUser .value = isPremium
209+ _isPremiumUser .value = BuildConfig . DEBUG || isPremium
209210
210211 println (" RevenueCat: Premium status - $isPremium " )
211212
You can’t perform that action at this time.
0 commit comments