-
Notifications
You must be signed in to change notification settings - Fork 81
[PM-27098] Add plurals for items #2089
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| <key>BitwardenCouldNotDecryptXVaultItemsDescriptionLong</key> | ||
| <dict> | ||
| <key>NSStringLocalizedFormatKey</key> | ||
| <string>%#@vaultitems@. Copy and share this error report with customer success to avoid additional data loss.</string> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ℹ️ I pulled the entire "Bitwarden could not decrypt X vault items" sentence into a plural-rule string because some languages inflect verbs based on the number of the object.
|
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 #2089 +/- ##
==========================================
- Coverage 85.28% 82.92% -2.37%
==========================================
Files 1695 1975 +280
Lines 144592 160845 +16253
==========================================
+ Hits 123319 133375 +10056
- Misses 21273 27470 +6197 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Claude finished @KatherineInCode's task —— View job Code Review CompleteTasks
Summary of ChangesThis PR migrates three item-related localization strings from
The changes update corresponding Swift code and tests to use the new pluralized string keys. Critical IssuesNone found. The implementation is solid and follows best practices. Suggested Improvements1. Consistency in Localization Key NamingThe PR uses Current: // ImportCXFState.swift:68
Localizations.xItemsSuccessfullyImported(total)Observation: Looking at the existing code, both camelCase and PascalCase patterns exist in the codebase (e.g., 2. Enhanced Test Coverage for PluralizationExpand for detailsWhile the existing tests verify the string usage, they don't explicitly test the pluralization behavior (singular vs plural forms). Consider adding tests that verify: // AlertVaultTests.swift - potential enhancement
func test_cipherDecryptionFailure_pluralization() {
// Test singular form (1 item)
let singular = Alert.cipherDecryptionFailure(cipherIds: ["id1"], isFromCipherTap: false) { _ in }
XCTAssertTrue(singular.message.contains("1 vault item")) // singular form
// Test plural form (2+ items)
let plural = Alert.cipherDecryptionFailure(cipherIds: ["id1", "id2"], isFromCipherTap: false) { _ in }
XCTAssertTrue(plural.message.contains("2 vault items")) // plural form
}However, this may be considered over-testing since iOS handles stringsdict pluralization automatically. The current test coverage is adequate for verifying correct key usage. 3. Documentation Comment AccuracyFile: The comment states: This could be more precise about the format: However, the existing comment is clear enough and follows the same pattern as other comments in the file. Good Practices Observed
Action Items for AuthorNone required. The PR is ready to merge as-is. The suggested improvements above are minor enhancements that are not blockers. Optional Considerations
Security & Architecture Compliance
Verdict: ✅ Approved - This is a well-executed localization improvement that enables proper pluralization for item-related strings across multiple languages. |

🎟️ Tracking
https://bitwarden.atlassian.net/browse/PM-27098
📔 Objective
This migrates several entries containing the words "item" into a
stringsdictso we can do proper pluralization.This uses some parts of #1999, but not all of it, to provide a more-focused PR for item-related plurals.
⏰ Reminders before review
🦮 Reviewer guidelines
:+1:) or similar for great changes:memo:) or ℹ️ (:information_source:) for notes or general info:question:) for questions:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion:art:) for suggestions / improvements:x:) or:warning:) for more significant problems or concerns needing attention:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt:pick:) for minor or nitpick changes