commit aeaef6f440ce5a1fb1533596bde985efed2a50cd
parent 477b13d3eb9767cc53d67f2be87b8427ba7fbf5e
Author: rhunk <101876869+rhunk@users.noreply.github.com>
Date: Fri, 5 Jan 2024 00:25:36 +0100
fix: date_range_input_title
Diffstat:
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/common/src/main/assets/lang/en_US.json b/common/src/main/assets/lang/en_US.json
@@ -1082,7 +1082,6 @@
"switch_text": "Suspend Location Updates"
},
"material3_strings": {
- "date_range_input_title": "",
"date_range_picker_start_headline": "From",
"date_range_picker_end_headline": "To",
"date_range_picker_title": "Select date range",
diff --git a/core/src/main/kotlin/me/rhunk/snapenhance/core/SnapEnhance.kt b/core/src/main/kotlin/me/rhunk/snapenhance/core/SnapEnhance.kt
@@ -286,6 +286,11 @@ class SnapEnhance {
Resources::class.java.getMethod("getString", Int::class.javaPrimitiveType).hook(HookStage.BEFORE) { param ->
val key = param.arg<Int>(0)
val name = stringResources[key] ?: return@hook
+ // FIXME: prevent blank string in translations
+ if (name == "date_range_input_title") {
+ param.setResult("")
+ return@hook
+ }
param.setResult(appContext.translation.getOrNull("material3_strings.$name") ?: return@hook)
}
}