diff --git a/composeApp/src/commonMain/kotlin/org/ooni/probe/shared/ResourceExt.kt b/composeApp/src/commonMain/kotlin/org/ooni/probe/shared/ResourceExt.kt index bd754537..acf5a869 100644 --- a/composeApp/src/commonMain/kotlin/org/ooni/probe/shared/ResourceExt.kt +++ b/composeApp/src/commonMain/kotlin/org/ooni/probe/shared/ResourceExt.kt @@ -42,31 +42,6 @@ import org.jetbrains.compose.resources.getString import org.jetbrains.compose.resources.pluralStringResource import org.jetbrains.compose.resources.stringResource -val stringMap = mapOf( - "@string/Common_Minutes_One" to Res.string.Common_Minutes_One, - "@string/Common_Minutes_Other" to Res.string.Common_Minutes_Other, - "@string/Common_Hour_One" to Res.string.Common_Hour_One, - "@string/Common_Hour_Other" to Res.string.Common_Hour_Other, - "@string/Dashboard_RunTests_RunButton_Label_One" to Res.string.Dashboard_RunTests_RunButton_Label_One, - "@string/Dashboard_RunTests_RunButton_Label_Other" to Res.string.Dashboard_RunTests_RunButton_Label_Other, - "@string/Measurements_Count_One" to Res.string.Measurements_Count_One, - "@string/Measurements_Count_Other" to Res.string.Measurements_Count_Other, - "@string/Measurements_Failed_One" to Res.string.Measurements_Failed_One, - "@string/Measurements_Failed_Other" to Res.string.Measurements_Failed_Other, - "@string/TestResults_Overview_Websites_Blocked_Singular" to Res.string.TestResults_Overview_Websites_Blocked_Singular, - "@string/TestResults_Overview_Websites_Blocked_Plural" to Res.string.TestResults_Overview_Websites_Blocked_Plural, - "@string/TestResults_Overview_Websites_Tested_Singular" to Res.string.TestResults_Overview_Websites_Tested_Singular, - "@string/TestResults_Overview_Websites_Tested_Plural" to Res.string.TestResults_Overview_Websites_Tested_Plural, - "@string/TestResults_Overview_InstantMessaging_Blocked_Singular" to Res.string.TestResults_Overview_InstantMessaging_Blocked_Singular, - "@string/TestResults_Overview_InstantMessaging_Blocked_Plural" to Res.string.TestResults_Overview_InstantMessaging_Blocked_Plural, - "@string/TestResults_Overview_InstantMessaging_Available_Singular" to Res.string.TestResults_Overview_InstantMessaging_Available_Singular, - "@string/TestResults_Overview_InstantMessaging_Available_Plural" to Res.string.TestResults_Overview_InstantMessaging_Available_Plural, - "@string/TestResults_Overview_Circumvention_Blocked_Singular" to Res.string.TestResults_Overview_Circumvention_Blocked_Singular, - "@string/TestResults_Overview_Circumvention_Blocked_Plural" to Res.string.TestResults_Overview_Circumvention_Blocked_Plural, - "@string/TestResults_Overview_Circumvention_Available_Singular" to Res.string.TestResults_Overview_Circumvention_Available_Singular, - "@string/TestResults_Overview_Circumvention_Available_Plural" to Res.string.TestResults_Overview_Circumvention_Available_Plural, -) - @Composable fun stringMonthArrayResource(): List = listOf( @@ -104,3 +79,50 @@ suspend fun getPluralStringResourceItem( return getString(it, *formatArgs) } ?: "" } + +private val stringMap = mapOf( + "@string/Common_Minutes_One" + to Res.string.Common_Minutes_One, + "@string/Common_Minutes_Other" + to Res.string.Common_Minutes_Other, + "@string/Common_Hour_One" + to Res.string.Common_Hour_One, + "@string/Common_Hour_Other" + to Res.string.Common_Hour_Other, + "@string/Dashboard_RunTests_RunButton_Label_One" + to Res.string.Dashboard_RunTests_RunButton_Label_One, + "@string/Dashboard_RunTests_RunButton_Label_Other" + to Res.string.Dashboard_RunTests_RunButton_Label_Other, + "@string/Measurements_Count_One" + to Res.string.Measurements_Count_One, + "@string/Measurements_Count_Other" + to Res.string.Measurements_Count_Other, + "@string/Measurements_Failed_One" + to Res.string.Measurements_Failed_One, + "@string/Measurements_Failed_Other" + to Res.string.Measurements_Failed_Other, + "@string/TestResults_Overview_Websites_Blocked_Singular" + to Res.string.TestResults_Overview_Websites_Blocked_Singular, + "@string/TestResults_Overview_Websites_Blocked_Plural" + to Res.string.TestResults_Overview_Websites_Blocked_Plural, + "@string/TestResults_Overview_Websites_Tested_Singular" + to Res.string.TestResults_Overview_Websites_Tested_Singular, + "@string/TestResults_Overview_Websites_Tested_Plural" + to Res.string.TestResults_Overview_Websites_Tested_Plural, + "@string/TestResults_Overview_InstantMessaging_Blocked_Singular" + to Res.string.TestResults_Overview_InstantMessaging_Blocked_Singular, + "@string/TestResults_Overview_InstantMessaging_Blocked_Plural" + to Res.string.TestResults_Overview_InstantMessaging_Blocked_Plural, + "@string/TestResults_Overview_InstantMessaging_Available_Singular" + to Res.string.TestResults_Overview_InstantMessaging_Available_Singular, + "@string/TestResults_Overview_InstantMessaging_Available_Plural" + to Res.string.TestResults_Overview_InstantMessaging_Available_Plural, + "@string/TestResults_Overview_Circumvention_Blocked_Singular" + to Res.string.TestResults_Overview_Circumvention_Blocked_Singular, + "@string/TestResults_Overview_Circumvention_Blocked_Plural" + to Res.string.TestResults_Overview_Circumvention_Blocked_Plural, + "@string/TestResults_Overview_Circumvention_Available_Singular" + to Res.string.TestResults_Overview_Circumvention_Available_Singular, + "@string/TestResults_Overview_Circumvention_Available_Plural" + to Res.string.TestResults_Overview_Circumvention_Available_Plural, +)