Skip to content

Commit

Permalink
TF-250 Improvements, translations
Browse files Browse the repository at this point in the history
  • Loading branch information
adocyn committed Apr 21, 2024
1 parent d950dac commit fc33ade
Show file tree
Hide file tree
Showing 22 changed files with 14 additions and 35 deletions.
5 changes: 5 additions & 0 deletions TwoFAS/Sync/SyncHandler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ final class SyncHandler {
userInfo: [AnyHashable: Any],
fetchCompletionHandler completionHandler: @escaping (BackgroundFetchResult) -> Void
) {
#if os(iOS)
let dict = userInfo as! [String: NSObject]
guard let notification: CKDatabaseNotification = CKNotification(
fromRemoteNotificationDictionary: dict
Expand All @@ -117,6 +118,10 @@ final class SyncHandler {
return
}
Log("SyncHandler - We have a notification! \(notification)", module: .cloudSync)
#elseif os(watchOS)
Log("SyncHandler - We have a notification!", module: .cloudSync)
#endif

fromNotificationCompletionHandler = completionHandler
synchronize()
}
Expand Down
2 changes: 2 additions & 0 deletions TwoFAS/TwoFAS/Other/Generated/T.generated.swift
Original file line number Diff line number Diff line change
Expand Up @@ -976,6 +976,8 @@ internal enum T {
internal static let enterNewPinShort = T.tr("Localizable", "security__enter_new_pin_short", fallback: "Enter new PIN")
/// Please enter your PIN
internal static let enterPin = T.tr("Localizable", "security__enter_pin", fallback: "Please enter your PIN")
/// Enter PIN
internal static let enterPinShort = T.tr("Localizable", "security__enter_pin_short", fallback: "Enter PIN")
/// Please enter your new %s PIN
internal static func enterYourNewPin(_ p1: UnsafePointer<CChar>) -> String {
return T.tr("Localizable", "security__enter_your_new_pin", p1, fallback: "Please enter your new %s PIN")
Expand Down
Binary file modified TwoFAS/TwoFAS/Other/de.lproj/Localizable.strings
Binary file not shown.
Binary file modified TwoFAS/TwoFAS/Other/en.lproj/Localizable.strings
Binary file not shown.
Binary file modified TwoFAS/TwoFAS/Other/es.lproj/Localizable.strings
Binary file not shown.
Binary file modified TwoFAS/TwoFAS/Other/fr.lproj/Localizable.strings
Binary file not shown.
Binary file modified TwoFAS/TwoFAS/Other/id.lproj/Localizable.strings
Binary file not shown.
Binary file modified TwoFAS/TwoFAS/Other/it.lproj/Localizable.strings
Binary file not shown.
Binary file modified TwoFAS/TwoFAS/Other/nl.lproj/Localizable.strings
Binary file not shown.
Binary file modified TwoFAS/TwoFAS/Other/pl.lproj/Localizable.strings
Binary file not shown.
Binary file modified TwoFAS/TwoFAS/Other/pt-BR.lproj/Localizable.strings
Binary file not shown.
Binary file modified TwoFAS/TwoFAS/Other/pt-PT.lproj/Localizable.strings
Binary file not shown.
Binary file modified TwoFAS/TwoFAS/Other/tr.lproj/Localizable.strings
Binary file not shown.
Binary file modified TwoFAS/TwoFAS/Other/uk.lproj/Localizable.strings
Binary file not shown.
Binary file modified TwoFAS/TwoFAS/Other/zh-Hans.lproj/Localizable.strings
Binary file not shown.
2 changes: 2 additions & 0 deletions TwoFAS/TwoFASAuth/Generated/T.generated.swift
Original file line number Diff line number Diff line change
Expand Up @@ -976,6 +976,8 @@ internal enum T {
internal static let enterNewPinShort = T.tr("Localizable", "security__enter_new_pin_short", fallback: "Enter new PIN")
/// Please enter your PIN
internal static let enterPin = T.tr("Localizable", "security__enter_pin", fallback: "Please enter your PIN")
/// Enter PIN
internal static let enterPinShort = T.tr("Localizable", "security__enter_pin_short", fallback: "Enter PIN")
/// Please enter your new %s PIN
internal static func enterYourNewPin(_ p1: UnsafePointer<CChar>) -> String {
return T.tr("Localizable", "security__enter_your_new_pin", p1, fallback: "Please enter your new %s PIN")
Expand Down
13 changes: 0 additions & 13 deletions TwoFAS/TwoFASWatch Watch App/Main/MainPresenter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,28 +25,15 @@ final class MainPresenter: ObservableObject {
@Published var favoriteList: [Service] = []

private let interactor: MainInteracting
private let notificationCenter = NotificationCenter.default

init(interactor: MainInteracting) {
self.interactor = interactor

notificationCenter.addObserver(
self,
selector: #selector(refresh),
name: .syncCompletedSuccessfuly,
object: nil
)
}

deinit {
notificationCenter.removeObserver(self)
}

func onAppear() {
refresh()
}

@objc
private func refresh() {
favoriteList = interactor
.listFavoriteServices()
Expand Down
8 changes: 3 additions & 5 deletions TwoFAS/TwoFASWatch Watch App/PIN/PINKeyboardPresenter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,7 @@ final class PINKeyboardPresenter: ObservableObject {
init(interactor: PINKeyboardInteracting, completion: @escaping (PINKeyboardResult) -> Void) {
self.interactor = interactor
self.completion = completion
}

func onAppear() {

showCloseButton = interactor.variant.showCloseButton
navigationTitle = interactor.variant.navigationTitle
}
Expand Down Expand Up @@ -143,8 +141,8 @@ private extension PINKeyboardPresenter {
private extension PINKeyboardVariant {
var navigationTitle: String {
switch self {
case .PINValidation: T.Security.enterPin
case .PINValidationWithClose: T.Security.enterPin
case .PINValidation: T.Security.enterPinShort
case .PINValidationWithClose: T.Security.enterPinShort
case .enterNewPIN: T.Security.enterNewPinShort
case .verifyPIN: T.Security.repeatNewPinShort
}
Expand Down
3 changes: 0 additions & 3 deletions TwoFAS/TwoFASWatch Watch App/PIN/PINKeyboardView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,6 @@ struct PINKeyboardView: View {
})
.toolbarTitleDisplayMode(.inline)
.navigationTitle(presenter.navigationTitle)
.onAppear {
presenter.onAppear()
}
}

@ViewBuilder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ struct ServiceCellView: View {
style: .continuous
)
.fill(service.badgeColor)
.preferredColorScheme(.dark)
.frame(width: 5)
IconRenderer(service: service)
VStack(alignment: .leading, spacing: 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,9 @@ final class ServiceListPresenter: ObservableObject {
@Published var list: [Category] = []

private let interactor: ServiceListInteracting
private let notificationCenter = NotificationCenter.default

init(interactor: ServiceListInteracting) {
self.interactor = interactor

notificationCenter.addObserver(
self,
selector: #selector(refresh),
name: .syncCompletedSuccessfuly,
object: nil
)
}

deinit {
notificationCenter.removeObserver(self)
}
}

Expand All @@ -47,7 +35,6 @@ extension ServiceListPresenter {
refresh()
}

@objc
private func refresh() {
list = interactor.listAllServices()
.toCategories()
Expand Down
2 changes: 1 addition & 1 deletion TwoFAS/TwoFASWatch Watch App/Settings/About/LogoView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ struct LogoView: View {
.aspectRatio(contentMode: .fit)
.frame(width: 40)
.padding(.leading, 4)
.padding(.bottom, 4)
.padding(.vertical, 4)

Text(T.Commons._2fasToolbar)
.font(.title)
Expand Down

0 comments on commit fc33ade

Please sign in to comment.