From fb85b49798ac589f443c6b6fd4976a1741702b7c Mon Sep 17 00:00:00 2001 From: MM20 <15646950+MM2-0@users.noreply.github.com> Date: Wed, 18 Jun 2025 22:33:02 +0200 Subject: [PATCH] Make strings translatable --- .../typography/TypographySettingsScreen.kt | 25 ++++--------------- core/i18n/src/main/res/values/strings.xml | 5 ++++ 2 files changed, 10 insertions(+), 20 deletions(-) diff --git a/app/ui/src/main/java/de/mm20/launcher2/ui/settings/typography/TypographySettingsScreen.kt b/app/ui/src/main/java/de/mm20/launcher2/ui/settings/typography/TypographySettingsScreen.kt index 711e63a0..fc1915ab 100644 --- a/app/ui/src/main/java/de/mm20/launcher2/ui/settings/typography/TypographySettingsScreen.kt +++ b/app/ui/src/main/java/de/mm20/launcher2/ui/settings/typography/TypographySettingsScreen.kt @@ -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" diff --git a/core/i18n/src/main/res/values/strings.xml b/core/i18n/src/main/res/values/strings.xml index 77729e3c..4c424c6a 100644 --- a/core/i18n/src/main/res/values/strings.xml +++ b/core/i18n/src/main/res/values/strings.xml @@ -1043,4 +1043,9 @@ Import theme Name Author + Fonts + Device default + Default headline font + Device text font + Generic \ No newline at end of file