ProgressTest: read a string with attributes (progress_line is translatable="false")
CI / check (push) Canceled after 0s

CI run 41 failed: the test's pattern missed the line template once
gen-strings marked it untranslatable, so every line lost its clock.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
HomerandClaude Opus 5.5 committed 2026-11-10 10:42:42 +00:00
1 parent a4116b11a8
commit 14da5ba2b3
1 file changed
+1 -1
@@ -32,7 +32,7 @@ class ProgressTest {
/** The app's English, read from the generated resources, formatted as Android formats it. */
private val english: ProgressWords by lazy {
val xml = File("src/main/res/values/strings.xml").readText()
val strings = Regex("""<string name="progress_([a-z_]+)">(.*?)</string>""").findAll(xml)
val strings = Regex("""<string name="progress_([a-z_]+)"[^>]*>(.*?)</string>""").findAll(xml)
.associate { it.groupValues[1] to it.groupValues[2].replace("\\'", "'").replace("&amp;", "&") }
val keys = mapOf("stopped_reason_person" to "stopped_person", "stopped_reason_steps" to "stopped_steps", "stopped_reason_budget" to "stopped_budget")
ProgressWords { key, args -> strings[keys[key] ?: key]?.let { String.format(Locale.ROOT, it, *args) } }