mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-10-05 11:18:24 +00:00
`tools:` attributes are an Android-lint construct. They arrived with strings moved out of amethyst/src/main/res/, whose <resources> root declares xmlns:tools -- composeResources roots do not, so the prefix was unbound and the XML malformed: 97 occurrences across 49 locale files, none of them declaring the namespace. Nothing was visibly broken, because Compose parses namespace-unaware and drops the unknown attribute (no .cvr contains it). But nothing should rely on that, and Android lint never runs on composeResources, so the attribute carried no meaning there either. migrate.py now strips tools: attributes as it moves each element, so the remaining migration waves cannot reintroduce them. Also fixes a hazard in fix_escapes.py found while doing this: quote-unwrapping is NOT idempotent. Android wraps a value in quotes to protect whitespace, but once \" has been converted to ", a legitimately quoted value is indistinguishable from a wrapped one, and a second pass strips the real quotes -- it silently damaged 10 `import_follows_tips` translations before this was caught. Unwrapping is now opt-out via --no-unwrap-quotes for repair runs over already-migrated files, and documented as run-exactly-once. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01V1CzYQvWyHfipSW7x3j4Yo
strings-migrate
Moves string keys from the Android app's res/ into commons Compose
resources (commons/src/commonMain/composeResources) across all
locales in one shot, preserving each element byte-for-byte so Crowdin
sees a pure move. Both trees are Crowdin-managed with the same android
layout (see crowdin.yml), so a migrated key keeps its translations.
tools/strings-migrate/migrate.py copy_to_clipboard relay_info
After migrating, repoint the code: R.string.key becomes Res.string.key
(com.vitorpamplona.amethyst.commons.resources), and the composable keeps
calling stringRes(...) via the commons bridge
(com.vitorpamplona.amethyst.commons.ui.stringRes).
The tool refuses keys whose value uses bare %s/%d: compose-resources
only formats positional %1$s args. Rewrite those keys (code and every
locale) first.