Skip to content

Commit 4d53d05

Browse files
[PM-27098] Add plurals for items (#2089)
1 parent 1f5b9fc commit 4d53d05

File tree

6 files changed

+56
-11
lines changed

6 files changed

+56
-11
lines changed

BitwardenResources/Localizations/en.lproj/Localizable.strings

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1080,7 +1080,6 @@
10801080
"ImportingEllipsis" = "Importing…";
10811081
"AreYouSureYouWantToCancelTheImportProcessQuestionMark" = "Are you sure you want to cancel the import process?";
10821082
"ImportFailed" = "Import failed";
1083-
"ItemsSuccessfullyImported" = "%1$@ items successfully imported";
10841083
"ThereWasAnIssueImportingAllOfYourPasswordsNoDataWasDeleted" = "There was an issue importing all of your passwords.\n\nNo data was deleted.";
10851084
"RetryImport" = "Retry import";
10861085
"ShowVault" = "Show vault";
@@ -1102,7 +1101,6 @@
11021101
"SendNameRequired" = "Send name (required)";
11031102
"CheckPasswordForDataBreaches" = "Check password for data breaches";
11041103
"PrivateNote" = "Private note";
1105-
"XItems" = "%1$@ items";
11061104
"CannotDeleteUserSoleOwnerDescriptionLong" = "Cannot delete this user because it is the sole owner of at least one organization. Please delete these organizations or upgrade another user.";
11071105
"APasskeyAlreadyExistsForThisApplication" = "A passkey already exists for this application.";
11081106
"APasskeyAlreadyExistsForThisApplicationButAnErrorOccurredWhileLoadingIt" = "A passkey already exists for this application but an error occurred while loading it.";
@@ -1194,8 +1192,6 @@
11941192
"PasswordLastUpdated" = "Password last updated: %1$@";
11951193
"DecryptionError" = "Decryption error";
11961194
"BitwardenCouldNotDecryptThisVaultItemDescriptionLong" = "Bitwarden could not decrypt this vault item. Copy and share this error report with customer success to avoid additional data loss.";
1197-
"BitwardenCouldNotDecryptOneVaultItemDescriptionLong" = "Bitwarden could not decrypt 1 vault item. Copy and share this error report with customer success to avoid additional data loss.";
1198-
"BitwardenCouldNotDecryptXVaultItemsDescriptionLong" = "Bitwarden could not decrypt %1$@ vault items. Copy and share this error report with customer success to avoid additional data loss.";
11991195
"CopyErrorReport" = "Copy error report";
12001196
"ErrorCannotDecrypt" = "[error: cannot decrypt]";
12011197
"AccountName" = "Account name";

BitwardenResources/Localizations/en.lproj/Localizable.stringsdict

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,23 @@
22
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
33
<plist version="1.0">
44
<dict>
5+
<!-- An error report if there are issues decrypting vault items. -->
6+
<key>BitwardenCouldNotDecryptXVaultItemsDescriptionLong</key>
7+
<dict>
8+
<key>NSStringLocalizedFormatKey</key>
9+
<string>%#@vaultitems@. Copy and share this error report with customer success to avoid additional data loss.</string>
10+
<key>vaultitems</key>
11+
<dict>
12+
<key>NSStringFormatSpecTypeKey</key>
13+
<string>NSStringPluralRuleType</string>
14+
<key>NSStringFormatValueTypeKey</key>
15+
<string>d</string>
16+
<key>one</key>
17+
<string>Bitwarden could not decrypt %d vault item</string>
18+
<key>other</key>
19+
<string>Bitwarden could not decrypt %d vault items</string>
20+
</dict>
21+
</dict>
522
<!-- A number of days, used in menu selections. For example, the number of days to keep a send before deletion. -->
623
<key>XDays</key>
724
<dict>
@@ -19,6 +36,40 @@
1936
<string>%d days</string>
2037
</dict>
2138
</dict>
39+
<!-- A number of items, used in headers' voiceover to indicate how many items are in a section. -->
40+
<key>XItems</key>
41+
<dict>
42+
<key>NSStringLocalizedFormatKey</key>
43+
<string>%#@items@</string>
44+
<key>items</key>
45+
<dict>
46+
<key>NSStringFormatSpecTypeKey</key>
47+
<string>NSStringPluralRuleType</string>
48+
<key>NSStringFormatValueTypeKey</key>
49+
<string>d</string>
50+
<key>one</key>
51+
<string>%d item</string>
52+
<key>other</key>
53+
<string>%d items</string>
54+
</dict>
55+
</dict>
56+
<!-- Message indicating a number of items were successfully imported in the Credential Exchange flow. -->
57+
<key>XItemsSuccessfullyImported</key>
58+
<dict>
59+
<key>NSStringLocalizedFormatKey</key>
60+
<string>%#@items@ successfully imported</string>
61+
<key>items</key>
62+
<dict>
63+
<key>NSStringFormatSpecTypeKey</key>
64+
<string>NSStringPluralRuleType</string>
65+
<key>NSStringFormatValueTypeKey</key>
66+
<string>d</string>
67+
<key>one</key>
68+
<string>%d item</string>
69+
<key>other</key>
70+
<string>%d items</string>
71+
</dict>
72+
</dict>
2273
<!-- A number of hours, used in menu selections. For example, how long to log events in the flight recorder. -->
2374
<key>XHours</key>
2475
<dict>

BitwardenShared/UI/Tools/ImportCXF/ImportCXF/ImportCXFState.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ struct ImportCXFState: Equatable, Sendable {
6565
case .importing:
6666
Localizations.pleaseDoNotCloseTheApp
6767
case let .success(total, _):
68-
Localizations.itemsSuccessfullyImported(total)
68+
Localizations.xItemsSuccessfullyImported(total)
6969
case let .failure(message):
7070
message
7171
}

BitwardenShared/UI/Tools/ImportCXF/ImportCXF/ImportCXFStateTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class ImportCXFStateTests: BitwardenTestCase {
6565
XCTAssertEqual(subject.message, Localizations.pleaseDoNotCloseTheApp)
6666

6767
subject.status = .success(totalImportedCredentials: 1, importedResults: [])
68-
XCTAssertEqual(subject.message, Localizations.itemsSuccessfullyImported(1))
68+
XCTAssertEqual(subject.message, Localizations.xItemsSuccessfullyImported(1))
6969

7070
subject.status = .failure(message: "Something went wrong")
7171
XCTAssertEqual(subject.message, "Something went wrong")

BitwardenShared/UI/Vault/Extensions/Alert+Vault.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,7 @@ extension Alert {
2727
let message = if isFromCipherTap {
2828
Localizations.bitwardenCouldNotDecryptThisVaultItemDescriptionLong
2929
} else {
30-
cipherIds.count == 1
31-
? Localizations.bitwardenCouldNotDecryptOneVaultItemDescriptionLong
32-
: Localizations.bitwardenCouldNotDecryptXVaultItemsDescriptionLong(cipherIds.count)
30+
Localizations.bitwardenCouldNotDecryptXVaultItemsDescriptionLong(cipherIds.count)
3331
}
3432

3533
return Alert(

BitwardenShared/UI/Vault/Extensions/AlertVaultTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class AlertVaultTests: BitwardenTestCase { // swiftlint:disable:this type_body_l
4949
XCTAssertEqual(subject.title, Localizations.decryptionError)
5050
XCTAssertEqual(
5151
subject.message,
52-
Localizations.bitwardenCouldNotDecryptOneVaultItemDescriptionLong,
52+
Localizations.bitwardenCouldNotDecryptXVaultItemsDescriptionLong(1),
5353
)
5454
XCTAssertEqual(subject.alertActions.count, 2)
5555
XCTAssertEqual(subject.alertActions[0].title, Localizations.copyErrorReport)
@@ -62,7 +62,7 @@ class AlertVaultTests: BitwardenTestCase { // swiftlint:disable:this type_body_l
6262
copyString,
6363
"""
6464
\(Localizations.decryptionError)
65-
\(Localizations.bitwardenCouldNotDecryptOneVaultItemDescriptionLong)
65+
\(Localizations.bitwardenCouldNotDecryptXVaultItemsDescriptionLong(1))
6666
6767
123abc
6868
""",

0 commit comments

Comments
 (0)