Localise content

This commit is contained in:
Alfonso Grillo
2022-10-26 12:44:49 +02:00
parent ba5132e6ee
commit 5465c74d46
4 changed files with 63 additions and 3 deletions
@@ -98,3 +98,38 @@ class UserSessionOverviewViewModel: UserSessionOverviewViewModelType, UserSessio
}
}
}
extension UserSessionOverviewViewState {
var bottomSheetTitle: String {
cardViewData.verificationState.bottomSheetTitle
}
var bottomSheetDescription: String {
cardViewData.verificationState.bottomSheetDescription
}
}
#warning("AG: add missing localisations")
private extension UserSessionInfo.VerificationState {
var bottomSheetTitle: String {
switch self {
case .unknown:
return "TODO_TITLE"
case .unverified:
return VectorL10n.userSessionUnverifiedSessionTitle
case .verified:
return VectorL10n.userSessionVerifiedSessionTitle
}
}
var bottomSheetDescription: String {
switch self {
case .unknown:
return "TODO_DESCRIPTION"
case .unverified:
return VectorL10n.userSessionUnverifiedSessionDescription
case .verified:
return VectorL10n.userSessionVerifiedSessionDescription
}
}
}
@@ -83,9 +83,9 @@ struct UserSessionOverview: View {
}
.accentColor(theme.colors.accent)
.bottomSheet(isPresented: $viewModel.showBottomSheet) {
InfoView(title: "Verified sessions",
descripion: "Further context on verified sessions. What do those mean, and how do they differ from unverified ones.\n\nWe could provide a link to an external reference resource for even more context.",
action: .init(text: "GOT IT", action: { $viewModel.showBottomSheet.wrappedValue = false }))
InfoView(title: viewModel.viewState.bottomSheetTitle,
descripion: viewModel.viewState.bottomSheetDescription,
action: .init(text: VectorL10n.userSessionGotIt, action: { $viewModel.showBottomSheet.wrappedValue = false }))
}
}
}