@@ -36,6 +36,7 @@ import androidx.compose.material.MaterialTheme
3636import androidx.compose.material.Surface
3737import androidx.compose.material.Text
3838import androidx.compose.runtime.Composable
39+ import androidx.compose.samples.crane.R
3940import androidx.compose.samples.crane.calendar.model.CalendarDay
4041import androidx.compose.samples.crane.calendar.model.CalendarMonth
4142import androidx.compose.samples.crane.calendar.model.DayOfWeek
@@ -48,6 +49,7 @@ import androidx.compose.samples.crane.util.SemiRect
4849import androidx.compose.ui.Alignment
4950import androidx.compose.ui.Modifier
5051import androidx.compose.ui.graphics.Color
52+ import androidx.compose.ui.res.stringResource
5153import androidx.compose.ui.semantics.SemanticsPropertyKey
5254import androidx.compose.ui.semantics.SemanticsPropertyReceiver
5355import androidx.compose.ui.semantics.clearAndSetSemantics
@@ -150,7 +152,7 @@ private fun Day(
150152 onClick = { onDayClicked(day) },
151153 onClickEnabled = enabled,
152154 backgroundColor = day.status.color(MaterialTheme .colors),
153- onClickLabel = " select "
155+ onClickLabel = stringResource(id = R .string.click_label_select)
154156 ) {
155157 DayStatusContainer (status = day.status) {
156158 Text (
@@ -189,13 +191,16 @@ private fun DayContainer(
189191 content : @Composable () -> Unit
190192) {
191193 // What if this doesn't fit the screen? - LayoutFlexible(1f) + LayoutAspectRatio(1f)
194+ val stateDescriptionLabel = stringResource(
195+ if (selected) R .string.state_descr_selected else R .string.state_descr_not_selected
196+ )
192197 Surface (
193198 modifier = modifier
194199 .size(width = CELL_SIZE , height = CELL_SIZE )
195200 .then(
196201 if (onClickEnabled) {
197202 modifier.semantics {
198- stateDescription = if (selected) " Selected " else " Not selected "
203+ stateDescription = stateDescriptionLabel
199204 }
200205 } else {
201206 modifier.clearAndSetSemantics { }
0 commit comments