[PM-26293] tool: Add scripts to delete duplicate Localizable.strings entries#2412
[PM-26293] tool: Add scripts to delete duplicate Localizable.strings entries#2412KatherineInCode merged 17 commits intomainfrom
Conversation
|
Claude finished @KatherineInCode's task in 3m 8s —— View job Re-review: PM-26293 Add scripts to delete duplicate localizable.strings entries
Incremental Changes (commits d94fe47, 3d547b8, 43c2ae6, fdf096d)These four commits address all prior review feedback:
Prior Findings Status
VerdictNo new issues found. All prior feedback has been addressed cleanly. The PR is in good shape. |
|
Great job! No new security vulnerabilities introduced in this pull request |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2412 +/- ##
==========================================
- Coverage 87.08% 85.95% -1.13%
==========================================
Files 1862 2092 +230
Lines 165404 180212 +14808
==========================================
+ Hits 144040 154900 +10860
- Misses 21364 25312 +3948 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| #!/usr/bin/env bash | ||
| set -euo pipefail |
There was a problem hiding this comment.
🎨 Is it worth documenting at the top of the file here what this script does? I've found that to be helpful when looking at other scripts that we have.
There was a problem hiding this comment.
Good call. Updated.
| #!/usr/bin/env bash | ||
| set -euo pipefail |
There was a problem hiding this comment.
🎨 Same thing here, worth documenting what this does?
Bitwarden Claude Code ReviewOverall Assessment: APPROVE This PR adds a modular Python script for removing duplicate entries from Localizable.strings files, shell wrappers for execution and testing, and applies the deduplication to the English Localizable.strings file (removing 5 duplicates and correcting the Code Review DetailsNo findings. Prior review feedback has been fully addressed:
|

🎟️ Tracking
https://bitwarden.atlassian.net/browse/PM-26293
📔 Objective
This is inspired by, and solves, the issue brought up in #2004, in addition to making it easier to avoid that same sort of issue in the future.
This introduces a modular python script that can be used to "fix" our Localizable.strings files; long-term, it may make sense to run this as a pre-commit hook as well. Currently, the one module introduced handles duplicate entries in the strings files; I intend in a future PR to include a module for unused entries, and then potentially a module for alphabetization, among other things. These all live under the
Scripts/fix-localizable-stringsdirectory.As well, there is a
Scripts/fix-localizable-strings.shscript that invokes the Python script against the various localizable files. As the modules expand, it can also handle doing those. This would be what the pre-commit hook would run.Finally, there is a
Scripts/test-fix-localizable-strings.shthat is an easy invocation of running the tests for the fix-localizable-strings Python script (which currently just tests the duplication work. In the future, we may consider adding the running of these to CI.One last thing: one of the duplicated strings (
"SendUpdated") had two different strings for the key. I ended up choosing the one that matches what I could find in Figma.