@@ -38,9 +38,9 @@ struct MainView: View {
38
38
39
39
var insertYubiKeyMessage = {
40
40
if YubiKitDeviceCapabilities . supportsISO7816NFCTags {
41
- " Insert YubiKey \( !UIAccessibility. isVoiceOverRunning ? " or pull down to activate NFC " : " or scan a NFC YubiKey " ) "
41
+ String ( localized : " Insert YubiKey " ) + " \( !UIAccessibility. isVoiceOverRunning ? String ( localized : " or pull down to activate NFC " ) : String ( localized : " or scan a NFC YubiKey " ) ) "
42
42
} else {
43
- " Insert YubiKey "
43
+ String ( localized : " Insert YubiKey " )
44
44
}
45
45
} ( )
46
46
@@ -61,7 +61,7 @@ struct MainView: View {
61
61
AccountRowView ( account: account, showAccountDetails: $showAccountDetails)
62
62
}
63
63
} else {
64
- ListStatusView ( image: Image ( systemName: " person.crop.circle.badge.questionmark " ) , message: " No matching accounts on YubiKey " , height: reader. size. height)
64
+ ListStatusView ( image: Image ( systemName: " person.crop.circle.badge.questionmark " ) , message: String ( localized : " No matching accounts on YubiKey " ) , height: reader. size. height)
65
65
}
66
66
} else if model. pinnedAccounts. count > 0 {
67
67
Section ( header: Text ( " Pinned " ) . frame ( maxWidth: . infinity, alignment: . leading) . font ( . title3. bold ( ) ) . foregroundColor ( Color ( " ListSectionHeaderColor " ) ) ) {
@@ -87,12 +87,12 @@ struct MainView: View {
87
87
AccountRowView ( account: account, showAccountDetails: $showAccountDetails)
88
88
}
89
89
} else {
90
- ListStatusView ( image: Image ( systemName: " person.crop.circle " ) , message: " No accounts on YubiKey " , height: reader. size. height)
90
+ ListStatusView ( image: Image ( systemName: " person.crop.circle " ) , message: String ( localized : " No accounts on YubiKey " ) , height: reader. size. height)
91
91
}
92
92
}
93
93
}
94
94
. accessibilityHidden ( showAccountDetails != nil )
95
- . searchable ( text: $searchText, prompt: " Search " )
95
+ . searchable ( text: $searchText, prompt: String ( localized : " Search " ) )
96
96
. autocorrectionDisabled ( true )
97
97
. keyboardType ( . asciiCapable)
98
98
. listStyle ( . inset)
@@ -138,7 +138,7 @@ struct MainView: View {
138
138
}
139
139
}
140
140
}
141
- . navigationTitle ( model. accountsLoaded ? " Accounts " : " " )
141
+ . navigationTitle ( model. accountsLoaded ? String ( localized : " Accounts " , comment : " Navigation title in main view. " ) : " " )
142
142
}
143
143
. accessibilityHidden ( showAccountDetails != nil )
144
144
. overlay {
@@ -159,24 +159,24 @@ struct MainView: View {
159
159
DisableOTPView ( )
160
160
}
161
161
162
- . alert ( " Enter password " , isPresented: $model. presentPasswordEntry) {
163
- SecureField ( " Password " , text: $password)
164
- Button ( " Cancel " , role: . cancel) { password = " " }
165
- Button ( " Ok " ) {
162
+ . alert ( String ( localized : " Enter password " , comment : " Password alert " ) , isPresented: $model. presentPasswordEntry) {
163
+ SecureField ( String ( localized : " Password " , comment : " Password alert " ) , text: $password)
164
+ Button ( String ( localized : " Cancel " , comment : " Password alert " ) , role: . cancel) { password = " " }
165
+ Button ( String ( localized : " Ok " , comment : " Password alert " ) ) {
166
166
model. password. send ( password)
167
167
password = " "
168
168
}
169
169
} message: {
170
170
Text ( model. passwordEntryMessage)
171
171
}
172
- . alertOrConfirmationDialog ( " Save password? " , isPresented: $model. presentPasswordSaveType) {
173
- Button ( " Save password " ) { model. passwordSaveType. send ( . some( . save) ) }
172
+ . alertOrConfirmationDialog ( String ( localized : " Save password? " , comment : " Save password alert " ) , isPresented: $model. presentPasswordSaveType) {
173
+ Button ( " Save password " , comment : " Save password alert. " ) { model. passwordSaveType. send ( . some( . save) ) }
174
174
let authenticationType = PasswordPreferences . evaluatedAuthenticationType ( )
175
175
if authenticationType != . none {
176
176
Button ( " Save and protect with \( authenticationType. title) " ) { model. passwordSaveType. send ( . some( . lock) ) }
177
177
}
178
- Button ( " Never for this YubiKey " ) { model. passwordSaveType. send ( . some( . never) ) }
179
- Button ( " Not now " , role: . cancel) { model. passwordSaveType. send ( nil ) }
178
+ Button ( " Never for this YubiKey " , comment : " Save password alert. " ) { model. passwordSaveType. send ( . some( . never) ) }
179
+ Button ( " Not now " , comment : " Save passsword alert " , role: . cancel) { model. passwordSaveType. send ( nil ) }
180
180
}
181
181
. errorAlert ( error: $model. sessionError)
182
182
. errorAlert ( error: $model. connectionError) { model. start ( ) }
0 commit comments