Skip to content

Commit 0662a31

Browse files
committed
test: detect R.string duplicates of backend translations
A number of my recent code reviews were flagging that strings added to R.string already exist in `TR` (`GeneratedTranslations`). To fix this, iterate the English strings from both TR and R.string, and fail if there are duplicates not defined in one of two BASELINE_ variables and produce copy-pasteable BASELINE text when the backend is updated This test: * Automates my review comments * Produces copy-pasteable BASELINE text when the backend is updated * Allowing a fast fix of the test * Lists opportunities where we can remove duplicated strings * Reducing APK size * Including `.toSentenceCase()` fixes * Ensures the baseline list is updated when strings are fixed The format of BASELINE entries lists all the `R.string` and `TR` cases: In some cases, there can be a many:many mapping, and a developer needs to decide which to select: ``` * R.string.deck_conf_general | R.string.pref_cat_general * TR.preferencesGeneral() | TR.schedulingGeneral() ``` Assisted-by: Claude Opus 4.6 Code was written by Claude, with much re-prompting for comment formatting, abstractions and code changes Code/comments were manually refactored and made less verbose
1 parent 283ff6f commit 0662a31

File tree

2 files changed

+488
-0
lines changed

2 files changed

+488
-0
lines changed

0 commit comments

Comments
 (0)