From 0497f7ead3b0f37d2357b486ee05a40d22fa7a6d Mon Sep 17 00:00:00 2001 From: Marvin W Date: Tue, 25 Jan 2022 18:31:24 +0100 Subject: [PATCH] Make strings translatable --- .../gms/ui/DeviceRegistrationPreferencesFragment.kt | 10 +++++----- play-services-core/src/main/res/values/strings.xml | 6 ++++++ 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/play-services-core/src/main/kotlin/org/microg/gms/ui/DeviceRegistrationPreferencesFragment.kt b/play-services-core/src/main/kotlin/org/microg/gms/ui/DeviceRegistrationPreferencesFragment.kt index ced09539..316eecc6 100644 --- a/play-services-core/src/main/kotlin/org/microg/gms/ui/DeviceRegistrationPreferencesFragment.kt +++ b/play-services-core/src/main/kotlin/org/microg/gms/ui/DeviceRegistrationPreferencesFragment.kt @@ -91,20 +91,20 @@ class DeviceRegistrationPreferencesFragment : PreferenceFragmentCompat() { val configuredProfile = ProfileManager.getConfiguredProfile(context) val autoProfile = ProfileManager.getAutoProfile(context) val autoProfileName = when (autoProfile) { - PROFILE_NATIVE -> "Native" - PROFILE_REAL -> "Real" + PROFILE_NATIVE -> getString(R.string.profile_name_native) + PROFILE_REAL -> getString(R.string.profile_name_real) else -> ProfileManager.getProfileName(context, autoProfile) } val profiles = mutableListOf(PROFILE_AUTO, PROFILE_NATIVE, PROFILE_REAL) - val profileNames = mutableListOf("Automatic: $autoProfileName", "Native", "Real") + val profileNames = mutableListOf(getString(R.string.profile_name_auto, autoProfileName), getString(R.string.profile_name_native), getString(R.string.profile_name_real)) if (ProfileManager.hasProfile(context, PROFILE_SYSTEM)) { profiles.add(PROFILE_SYSTEM) - profileNames.add("System: ${ProfileManager.getProfileName(context, PROFILE_SYSTEM)}") + profileNames.add(getString(R.string.profile_name_system, ProfileManager.getProfileName(context, PROFILE_SYSTEM))) } if (ProfileManager.hasProfile(context, PROFILE_USER)) { profiles.add(PROFILE_USER) - profileNames.add("Custom: ${ProfileManager.getProfileName(context, PROFILE_USER)}") + profileNames.add(getString(R.string.profile_name_user, ProfileManager.getProfileName(context, PROFILE_USER))) } for (profile in R.xml::class.java.declaredFields.map { it.name } .filter { it.startsWith("profile_") } diff --git a/play-services-core/src/main/res/values/strings.xml b/play-services-core/src/main/res/values/strings.xml index 499d43fc..d02c4de3 100644 --- a/play-services-core/src/main/res/values/strings.xml +++ b/play-services-core/src/main/res/values/strings.xml @@ -181,4 +181,10 @@ This can take a couple of minutes." Running… Operation mode + Native + Real + Custom: %s + Automatic: %s + System: %s +