mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-10-31 16:24:11 +00:00
209a36cbea
* Add HealthChat API and extended profile services Expose OpenID tokens and homeserver credentials from the client proxy, and add fork-only services for the HealthChat member directory backend (api.healthchat.ch) plus a service that reads MSC4133 extended profile fields directly from the homeserver. Groundwork for the members tab and the profile screens. Claude-Session: https://claude.ai/code/session_013qdTbAWsZj2quQzEkagXaS * Show extended profile details on the profile screens Add a UserProfileScreenHook that lets the fork inject an extra Form section below the header of the user profile and room member details screens. The HealthChat implementation loads the MSC4133 extended profile fields and renders them with tappable phone/email/website links, hiding the section entirely for profiles without any fields. Strings live in a new fork-only HealthChat.strings table (de/en/fr, generated as HealthChatL10n via SwiftGen) since Untranslated.strings pins the English bundle. Claude-Session: https://claude.ai/code/session_013qdTbAWsZj2quQzEkagXaS * Add a member directory tab Add a HomeTabsHook that lets the fork append an extra tab to the home tab bar, and a HealthChat members flow behind it: a directory of all approved members from the HealthChat API with server-side search, pending-approval and error states, chat shortcuts and pushed member profiles. Chats and calls are handed back to the session flow via the hook's actions publisher. Claude-Session: https://claude.ai/code/session_013qdTbAWsZj2quQzEkagXaS * Let members edit their profile and invite others Add a native profile editor for the HealthChat extended profile fields (13 fields plus avatar, saved as a partial diff through the HealthChat API so displayname derivation and Zitadel sync stay server-side), an invitation sheet (email plus personal note) and a profile-completeness hint on the member directory. A new UserDetailsEditScreenHook lets the fork substitute the profile editor behind the settings user row — the stock display-name editor would let users edit a value the next profile update derives away. Claude-Session: https://claude.ai/code/session_013qdTbAWsZj2quQzEkagXaS
98 lines
5.6 KiB
Swift
98 lines
5.6 KiB
Swift
// swiftlint:disable all
|
||
// Generated using SwiftGen — https://github.com/SwiftGen/SwiftGen
|
||
|
||
import Foundation
|
||
|
||
// swiftlint:disable superfluous_disable_command file_length implicit_return
|
||
|
||
// MARK: - Strings
|
||
|
||
// swiftlint:disable explicit_type_interface function_parameter_count identifier_name line_length
|
||
// swiftlint:disable nesting type_body_length type_name vertical_whitespace_opening_braces
|
||
internal nonisolated enum HealthChatL10n {
|
||
/// Title
|
||
internal static var commonAcademicTitle: String { return HealthChatL10n.tr("HealthChat", "common_academic_title") }
|
||
/// Address
|
||
internal static var commonAddress: String { return HealthChatL10n.tr("HealthChat", "common_address") }
|
||
/// Business email
|
||
internal static var commonBusinessEmail: String { return HealthChatL10n.tr("HealthChat", "common_business_email") }
|
||
/// Business phone
|
||
internal static var commonBusinessTel: String { return HealthChatL10n.tr("HealthChat", "common_business_tel") }
|
||
/// City
|
||
internal static var commonCity: String { return HealthChatL10n.tr("HealthChat", "common_city") }
|
||
/// First name
|
||
internal static var commonFirstName: String { return HealthChatL10n.tr("HealthChat", "common_first_name") }
|
||
/// Further infos / qualifications
|
||
internal static var commonFurtherInfo: String { return HealthChatL10n.tr("HealthChat", "common_further_info") }
|
||
/// No.
|
||
internal static var commonHouseNumber: String { return HealthChatL10n.tr("HealthChat", "common_house_number") }
|
||
/// Last name
|
||
internal static var commonLastName: String { return HealthChatL10n.tr("HealthChat", "common_last_name") }
|
||
/// Postal code
|
||
internal static var commonPostalCode: String { return HealthChatL10n.tr("HealthChat", "common_postal_code") }
|
||
/// Practice name
|
||
internal static var commonPracticeName: String { return HealthChatL10n.tr("HealthChat", "common_practice_name") }
|
||
/// Speciality
|
||
internal static var commonSpecialty: String { return HealthChatL10n.tr("HealthChat", "common_specialty") }
|
||
/// Street
|
||
internal static var commonStreet: String { return HealthChatL10n.tr("HealthChat", "common_street") }
|
||
/// Website
|
||
internal static var commonWebsite: String { return HealthChatL10n.tr("HealthChat", "common_website") }
|
||
/// Email address
|
||
internal static var screenInviteMemberEmailPlaceholder: String { return HealthChatL10n.tr("HealthChat", "screen_invite_member_email_placeholder") }
|
||
/// The personal message must be at least 10 characters long.
|
||
internal static var screenInviteMemberNoteFooter: String { return HealthChatL10n.tr("HealthChat", "screen_invite_member_note_footer") }
|
||
/// Personal message
|
||
internal static var screenInviteMemberNotePlaceholder: String { return HealthChatL10n.tr("HealthChat", "screen_invite_member_note_placeholder") }
|
||
/// Invitation sent
|
||
internal static var screenInviteMemberSuccess: String { return HealthChatL10n.tr("HealthChat", "screen_invite_member_success") }
|
||
/// Invite a member
|
||
internal static var screenInviteMemberTitle: String { return HealthChatL10n.tr("HealthChat", "screen_invite_member_title") }
|
||
/// Your account is being reviewed. You’ll get access to the member directory once it has been approved.
|
||
internal static var screenMemberDirectoryPendingApproval: String { return HealthChatL10n.tr("HealthChat", "screen_member_directory_pending_approval") }
|
||
/// Name, practice, city or speciality
|
||
internal static var screenMemberDirectorySearchPlaceholder: String { return HealthChatL10n.tr("HealthChat", "screen_member_directory_search_placeholder") }
|
||
/// Members
|
||
internal static var screenMemberDirectoryTitle: String { return HealthChatL10n.tr("HealthChat", "screen_member_directory_title") }
|
||
/// Practice address
|
||
internal static var screenProfileEditSectionAddress: String { return HealthChatL10n.tr("HealthChat", "screen_profile_edit_section_address") }
|
||
/// Contact details
|
||
internal static var screenProfileEditSectionContact: String { return HealthChatL10n.tr("HealthChat", "screen_profile_edit_section_contact") }
|
||
/// Personal details
|
||
internal static var screenProfileEditSectionPersonal: String { return HealthChatL10n.tr("HealthChat", "screen_profile_edit_section_personal") }
|
||
/// Professional details
|
||
internal static var screenProfileEditSectionProfessional: String { return HealthChatL10n.tr("HealthChat", "screen_profile_edit_section_professional") }
|
||
}
|
||
// swiftlint:enable explicit_type_interface function_parameter_count identifier_name line_length
|
||
// swiftlint:enable nesting type_body_length type_name vertical_whitespace_opening_braces
|
||
|
||
// MARK: - Implementation Details
|
||
|
||
nonisolated extension HealthChatL10n {
|
||
static func tr(_ table: String, _ key: String, _ args: CVarArg...) -> String {
|
||
// Use preferredLocalizations to get a language that is in the bundle and the user's preferred list of languages.
|
||
let languages = Bundle.overrideLocalizations ?? Bundle.app.preferredLocalizations
|
||
|
||
for language in languages {
|
||
if let translation = trIn(language, table, key, args) {
|
||
return translation
|
||
}
|
||
}
|
||
return Bundle.app.developmentLocalization.flatMap { trIn($0, table, key, args) } ?? key
|
||
}
|
||
|
||
private static func trIn(_ language: String, _ table: String, _ key: String, _ args: CVarArg...) -> String? {
|
||
guard let bundle = Bundle.lprojBundle(for: language) else { return nil }
|
||
let format = NSLocalizedString(key, tableName: table, bundle: bundle, comment: "")
|
||
let translation = String(format: format, locale: Locale(identifier: language), arguments: args)
|
||
guard translation != key,
|
||
translation != "\(key) \(key)" // Handle double pseudo for tests
|
||
else {
|
||
return nil
|
||
}
|
||
return translation
|
||
}
|
||
}
|
||
|
||
// swiftlint:enable all
|