From 08310c7ccd637f2ba085545115504154c397f3b2 Mon Sep 17 00:00:00 2001 From: Kuljeet1998 Date: Tue, 17 Sep 2024 16:32:24 -0400 Subject: [PATCH 1/2] translate myLife tabs --- .../myplanet/ui/mylife/AdapterMyLife.kt | 9 ++++++++- .../planet/myplanet/utilities/Utilities.kt | 20 +++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/ole/planet/myplanet/ui/mylife/AdapterMyLife.kt b/app/src/main/java/org/ole/planet/myplanet/ui/mylife/AdapterMyLife.kt index cf2e98d106..39342ba4e4 100644 --- a/app/src/main/java/org/ole/planet/myplanet/ui/mylife/AdapterMyLife.kt +++ b/app/src/main/java/org/ole/planet/myplanet/ui/mylife/AdapterMyLife.kt @@ -50,7 +50,14 @@ class AdapterMyLife(private val context: Context, private val myLifeList: List Date: Wed, 18 Sep 2024 14:54:21 -0400 Subject: [PATCH 2/2] translate mylife tabs --- .../ui/dashboard/BaseDashboardFragmentPlugin.kt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/org/ole/planet/myplanet/ui/dashboard/BaseDashboardFragmentPlugin.kt b/app/src/main/java/org/ole/planet/myplanet/ui/dashboard/BaseDashboardFragmentPlugin.kt index 742f6f5ed9..d5b0c4e1e3 100644 --- a/app/src/main/java/org/ole/planet/myplanet/ui/dashboard/BaseDashboardFragmentPlugin.kt +++ b/app/src/main/java/org/ole/planet/myplanet/ui/dashboard/BaseDashboardFragmentPlugin.kt @@ -131,8 +131,14 @@ open class BaseDashboardFragmentPlugin : BaseContainerFragment() { val itemMyLifeBinding = ItemMyLifeBinding.inflate(LayoutInflater.from(activity)) val v = itemMyLifeBinding.root setBackgroundColor(v, itemCnt) - - val title = (obj as RealmMyLife).title + var translatedText = (obj as RealmMyLife).title + try { + var resId = Utilities.getStringIdentifier(translatedText?.lowercase()) + translatedText = context?.getString(resId) + } catch (e: Exception) { + translatedText = (obj as RealmMyLife).title + } + val title = translatedText val user = UserProfileDbHandler(requireContext()).userModel itemMyLifeBinding.img.setImageResource(resources.getIdentifier(obj.imageId, "drawable", requireActivity().packageName)) itemMyLifeBinding.tvName.text = title