Skip to content

Commit 0f1171c

Browse files
committed
Replaced hardcoded string with string resource
1 parent 92bed77 commit 0f1171c

File tree

2 files changed

+3
-1
lines changed
  • composeApp/src/commonMain

2 files changed

+3
-1
lines changed

composeApp/src/commonMain/composeResources/values/string.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22
<resources>
33
<string name="error_occurred">Error occurred</string>
44
<string name="ok">OK</string>
5+
<string name="error_info_unavailable">Error information not available</string>
56
</resources>

composeApp/src/commonMain/kotlin/com/developersbreach/kotlindictionarymultiplatform/ui/components/UiStateHandler.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import androidx.compose.ui.Alignment
1111
import androidx.compose.ui.Modifier
1212
import androidx.compose.runtime.saveable.rememberSaveable
1313
import kotlindictionarymultiplatform.composeapp.generated.resources.Res
14+
import kotlindictionarymultiplatform.composeapp.generated.resources.error_info_unavailable
1415
import kotlindictionarymultiplatform.composeapp.generated.resources.error_occurred
1516
import org.jetbrains.compose.resources.stringResource
1617

@@ -42,7 +43,7 @@ fun <T> UiStateHandler(
4243
onButtonClick = { shouldDismissErrorDialog.value = true },
4344
modifier = Modifier,
4445
title = stringResource(Res.string.error_occurred),
45-
description = errorDetails.message ?: "Error information not available",
46+
description = errorDetails.message ?: stringResource(Res.string.error_info_unavailable),
4647
)
4748
}
4849
}

0 commit comments

Comments
 (0)