Make strings translatable
This commit is contained in:
parent
cbd4423428
commit
fb85b49798
@ -136,7 +136,7 @@ fun TypographySettingsScreen(themeId: UUID) {
|
||||
if (theme == null || previewTypography == null) return@PreferenceScreen
|
||||
|
||||
item {
|
||||
PreferenceCategory(title = "Fonts") {
|
||||
PreferenceCategory(title = stringResource(R.string.preference_typography_fonts)) {
|
||||
FontPreference(title = "Brand", theme!!.fonts["brand"], onValueChange = {
|
||||
viewModel.updateTypography(
|
||||
theme!!.copy(
|
||||
@ -692,7 +692,7 @@ private fun FontPreference(
|
||||
item {
|
||||
FontPickerCategory(
|
||||
preview.ExtraShort,
|
||||
"Device default",
|
||||
stringResource(R.string.font_category_device_default),
|
||||
fonts.deviceDefault,
|
||||
onFontClick = {
|
||||
scope.launch {
|
||||
@ -703,26 +703,11 @@ private fun FontPreference(
|
||||
})
|
||||
}
|
||||
}
|
||||
if (fonts.system.isNotEmpty()) {
|
||||
item {
|
||||
FontPickerCategory(
|
||||
preview.ExtraShort,
|
||||
"System",
|
||||
fonts.system,
|
||||
onFontClick = {
|
||||
scope.launch {
|
||||
sheetState.hide()
|
||||
onValueChange(it)
|
||||
showDialog = false
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
if (fonts.generic.isNotEmpty()) {
|
||||
item {
|
||||
FontPickerCategory(
|
||||
preview.ExtraShort,
|
||||
"Generic",
|
||||
stringResource(R.string.font_category_generic),
|
||||
fonts.generic,
|
||||
onFontClick = {
|
||||
scope.launch {
|
||||
@ -780,8 +765,8 @@ private fun FontPickerCategory(
|
||||
private fun getFontName(context: Context, fontFamily: ThemeFontFamily?): String {
|
||||
return when (fontFamily) {
|
||||
is ThemeFontFamily.LauncherDefault -> "Outfit"
|
||||
is ThemeFontFamily.DeviceHeadline -> "Default headline font"
|
||||
is ThemeFontFamily.DeviceBody -> "Default text font"
|
||||
is ThemeFontFamily.DeviceHeadline -> context.getString(R.string.font_name_device_headline)
|
||||
is ThemeFontFamily.DeviceBody -> context.getString(R.string.font_name_device_body)
|
||||
is ThemeFontFamily.System -> fontFamily.name
|
||||
is ThemeFontFamily.SansSerif -> "sans-serif"
|
||||
is ThemeFontFamily.Serif -> "serif"
|
||||
|
||||
@ -1043,4 +1043,9 @@
|
||||
<string name="theme_import_title">Import theme</string>
|
||||
<string name="theme_bundle_name">Name</string>
|
||||
<string name="theme_bundle_author">Author</string>
|
||||
<string name="preference_typography_fonts">Fonts</string>
|
||||
<string name="font_category_device_default">Device default</string>
|
||||
<string name="font_name_device_headline">Default headline font</string>
|
||||
<string name="font_name_device_body">Device text font</string>
|
||||
<string name="font_category_generic">Generic</string>
|
||||
</resources>
|
||||
Loading…
x
Reference in New Issue
Block a user