Skip to content

Commit 8abe7f1

Browse files
committed
Fixing locale issues
1 parent 3fe7395 commit 8abe7f1

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

  • TestingCodelab/app/src/main/java/com/example/compose/rally/ui/overview

NavigationCodelab/app/src/main/java/com/example/compose/rally/ui/components/RallyTabRow.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ import androidx.compose.ui.unit.Dp
4747
import androidx.compose.ui.unit.dp
4848
import com.example.compose.rally.RallyDestination
4949
import java.util.Locale
50+
import androidx.compose.ui.platform.LocalLocale
5051

5152
@Composable
5253
fun RallyTabRow(
@@ -113,7 +114,7 @@ private fun RallyTab(
113114
Icon(imageVector = icon, contentDescription = text, tint = tabTintColor)
114115
if (selected) {
115116
Spacer(Modifier.width(12.dp))
116-
Text(text.uppercase(Locale.getDefault()), color = tabTintColor)
117+
Text(text.uppercase(LocalLocale.current.platformLocale), color = tabTintColor)
117118
}
118119
}
119120
}

TestingCodelab/app/src/main/java/com/example/compose/rally/ui/overview/OverviewBody.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ import com.example.compose.rally.ui.components.RallyDivider
6161
import com.example.compose.rally.ui.components.formatAmount
6262
import com.example.compose.rally.ui.theme.RallyTheme
6363
import java.util.Locale
64+
import androidx.compose.ui.platform.LocalLocale
6465

6566
@Composable
6667
fun OverviewBody(onScreenChange: (RallyScreen) -> Unit = {}) {
@@ -91,7 +92,7 @@ private fun AlertCard() {
9192
showDialog = false
9293
},
9394
bodyText = alertMessage,
94-
buttonText = "Dismiss".uppercase(Locale.getDefault())
95+
buttonText = "Dismiss".uppercase(LocalLocale.current.platformLocale)
9596
)
9697
}
9798

0 commit comments

Comments
 (0)