added I18n for new strings
This commit is contained in:
@@ -59,6 +59,8 @@ import androidx.compose.ui.semantics.stateDescription
|
|||||||
import androidx.compose.ui.text.font.FontWeight
|
import androidx.compose.ui.text.font.FontWeight
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import androidx.compose.ui.window.Dialog
|
import androidx.compose.ui.window.Dialog
|
||||||
|
import com.vitorpamplona.amethyst.R
|
||||||
|
import com.vitorpamplona.amethyst.ui.stringRes
|
||||||
import com.vitorpamplona.amethyst.ui.theme.DividerThickness
|
import com.vitorpamplona.amethyst.ui.theme.DividerThickness
|
||||||
import com.vitorpamplona.amethyst.ui.theme.Font14SP
|
import com.vitorpamplona.amethyst.ui.theme.Font14SP
|
||||||
import kotlinx.collections.immutable.ImmutableList
|
import kotlinx.collections.immutable.ImmutableList
|
||||||
@@ -125,6 +127,8 @@ private fun BaseTextSpinner(
|
|||||||
"Dropdown menu, $currentText selected"
|
"Dropdown menu, $currentText selected"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
val openDropdownLabel = stringRes(R.string.open_dropdown_menu)
|
||||||
|
|
||||||
Box(
|
Box(
|
||||||
modifier = modifier,
|
modifier = modifier,
|
||||||
contentAlignment = Alignment.Center,
|
contentAlignment = Alignment.Center,
|
||||||
@@ -146,7 +150,7 @@ private fun BaseTextSpinner(
|
|||||||
}.semantics {
|
}.semantics {
|
||||||
role = Role.DropdownList
|
role = Role.DropdownList
|
||||||
stateDescription = accessibilityDescription
|
stateDescription = accessibilityDescription
|
||||||
onClick(label = "Open dropdown menu") {
|
onClick(label = openDropdownLabel) {
|
||||||
optionsShowing = true
|
optionsShowing = true
|
||||||
focusRequester.requestFocus()
|
focusRequester.requestFocus()
|
||||||
return@onClick true
|
return@onClick true
|
||||||
@@ -227,6 +231,7 @@ fun <T> SpinnerSelectionDialog(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
itemsIndexed(options) { index, item ->
|
itemsIndexed(options) { index, item ->
|
||||||
|
val optionsOfLabel = stringRes(R.string.option_of, index + 1, options.size)
|
||||||
Row(
|
Row(
|
||||||
modifier =
|
modifier =
|
||||||
Modifier
|
Modifier
|
||||||
@@ -235,7 +240,7 @@ fun <T> SpinnerSelectionDialog(
|
|||||||
.padding(16.dp, 16.dp)
|
.padding(16.dp, 16.dp)
|
||||||
.semantics {
|
.semantics {
|
||||||
role = Role.Button
|
role = Role.Button
|
||||||
contentDescription = "Option ${index + 1} of ${options.size}"
|
contentDescription = optionsOfLabel
|
||||||
},
|
},
|
||||||
) {
|
) {
|
||||||
Column { onRenderItem(item) }
|
Column { onRenderItem(item) }
|
||||||
|
|||||||
+2
-2
@@ -120,9 +120,9 @@ fun FeedFilterSpinner(
|
|||||||
|
|
||||||
val accessibilityDescription =
|
val accessibilityDescription =
|
||||||
if (selected != null) {
|
if (selected != null) {
|
||||||
"Feed filter, $currentText selected"
|
stringRes(R.string.feed_filter_selected, currentText)
|
||||||
} else {
|
} else {
|
||||||
"Feed filter, $selectAnOption"
|
stringRes(R.string.feed_filter_select_an_option, selectAnOption)
|
||||||
}
|
}
|
||||||
|
|
||||||
Box(
|
Box(
|
||||||
|
|||||||
@@ -1231,4 +1231,8 @@
|
|||||||
<string name="dont_translate_from_description">Languages shown here will not be translated. Select a language to remove it and have it translated again.</string>
|
<string name="dont_translate_from_description">Languages shown here will not be translated. Select a language to remove it and have it translated again.</string>
|
||||||
<string name="pause">Pause</string>
|
<string name="pause">Pause</string>
|
||||||
<string name="play">Play</string>
|
<string name="play">Play</string>
|
||||||
|
<string name="open_dropdown_menu">Open dropdown menu</string>
|
||||||
|
<string name="option_of">Option %1$s of %2$s</string>
|
||||||
|
<string name="feed_filter_selected">Feed filter, %1$s selected</string>
|
||||||
|
<string name="feed_filter_select_an_option">Feed filter, %1$s</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
Reference in New Issue
Block a user