From 9bb116bdd1787a8813b6248d045a0eb0f6e7dd30 Mon Sep 17 00:00:00 2001 From: Davide Date: Wed, 27 Nov 2024 14:32:52 +0100 Subject: [PATCH] Refactor some root strings --- .../Views/App/InstalledProfileView.swift | 4 ++-- .../AppUIMain/Views/App/ProfileCardView.swift | 2 +- .../Views/Profile/ActiveProfileView.swift | 2 +- .../UILibrary/L10n/SwiftGen+Strings.swift | 22 ++++++++++--------- .../Resources/en.lproj/Localizable.strings | 7 +++--- 5 files changed, 19 insertions(+), 18 deletions(-) diff --git a/Passepartout/Library/Sources/AppUIMain/Views/App/InstalledProfileView.swift b/Passepartout/Library/Sources/AppUIMain/Views/App/InstalledProfileView.swift index ab4485f48..f47913084 100644 --- a/Passepartout/Library/Sources/AppUIMain/Views/App/InstalledProfileView.swift +++ b/Passepartout/Library/Sources/AppUIMain/Views/App/InstalledProfileView.swift @@ -76,7 +76,7 @@ private extension InstalledProfileView { if profile != nil { statusView } else { - Text("FIXME") + Text(Strings.Views.App.InstalledProfile.None.status) .foregroundStyle(.secondary) } } @@ -90,7 +90,7 @@ private extension InstalledProfileView { } func nameView() -> some View { - Text(profile?.name ?? Strings.Views.App.Rows.notInstalled) + Text(profile?.name ?? Strings.Views.App.InstalledProfile.None.name) .font(.title2) .fontWeight(theme.relevantWeight) .themeTruncating(.tail) diff --git a/Passepartout/Library/Sources/AppUIMain/Views/App/ProfileCardView.swift b/Passepartout/Library/Sources/AppUIMain/Views/App/ProfileCardView.swift index 6e615ff4f..2705203e2 100644 --- a/Passepartout/Library/Sources/AppUIMain/Views/App/ProfileCardView.swift +++ b/Passepartout/Library/Sources/AppUIMain/Views/App/ProfileCardView.swift @@ -50,7 +50,7 @@ struct ProfileCardView: View { .font(.headline) .themeTruncating() - Text(preview.subtitle ?? Strings.Views.App.Rows.noModules) + Text(preview.subtitle ?? Strings.Views.App.Profile.noModules) .multilineTextAlignment(.leading) .font(.subheadline) .foregroundStyle(.secondary) diff --git a/Passepartout/Library/Sources/AppUITV/Views/Profile/ActiveProfileView.swift b/Passepartout/Library/Sources/AppUITV/Views/Profile/ActiveProfileView.swift index fa5225227..4dbbab49b 100644 --- a/Passepartout/Library/Sources/AppUITV/Views/Profile/ActiveProfileView.swift +++ b/Passepartout/Library/Sources/AppUITV/Views/Profile/ActiveProfileView.swift @@ -85,7 +85,7 @@ struct ActiveProfileView: View { private extension ActiveProfileView { var currentProfileView: some View { - Text(profile?.name ?? Strings.Views.App.Rows.notInstalled) + Text(profile?.name ?? Strings.Views.App.InstalledProfile.None.name) .font(.title) .fontWeight(theme.relevantWeight) .frame(maxWidth: .infinity, alignment: .leading) diff --git a/Passepartout/Library/Sources/UILibrary/L10n/SwiftGen+Strings.swift b/Passepartout/Library/Sources/UILibrary/L10n/SwiftGen+Strings.swift index 7d12e8b20..5863894b8 100644 --- a/Passepartout/Library/Sources/UILibrary/L10n/SwiftGen+Strings.swift +++ b/Passepartout/Library/Sources/UILibrary/L10n/SwiftGen+Strings.swift @@ -581,10 +581,6 @@ public enum Strings { public static let tunnel = Strings.tr("Localizable", "views.app.errors.tunnel", fallback: "Unable to execute tunnel operation.") } public enum Folders { - /// Installed profile - public static let activeProfile = Strings.tr("Localizable", "views.app.folders.active_profile", fallback: "Installed profile") - /// Add profile - public static let addProfile = Strings.tr("Localizable", "views.app.folders.add_profile", fallback: "Add profile") /// My profiles public static let `default` = Strings.tr("Localizable", "views.app.folders.default", fallback: "My profiles") /// No profiles @@ -594,16 +590,22 @@ public enum Strings { public static let migrate = Strings.tr("Localizable", "views.app.folders.no_profiles.migrate", fallback: "Migrate old profiles...") } } + public enum InstalledProfile { + public enum None { + /// Select a profile + public static let name = Strings.tr("Localizable", "views.app.installed_profile.none.name", fallback: "Select a profile") + /// FIXME + public static let status = Strings.tr("Localizable", "views.app.installed_profile.none.status", fallback: "FIXME") + } + } + public enum Profile { + /// No active modules + public static let noModules = Strings.tr("Localizable", "views.app.profile.no_modules", fallback: "No active modules") + } public enum ProfileContext { /// Connect to public static let connectTo = Strings.tr("Localizable", "views.app.profile_context.connect_to", fallback: "Connect to") } - public enum Rows { - /// No active modules - public static let noModules = Strings.tr("Localizable", "views.app.rows.no_modules", fallback: "No active modules") - /// Select a profile - public static let notInstalled = Strings.tr("Localizable", "views.app.rows.not_installed", fallback: "Select a profile") - } public enum Toolbar { /// Import profile public static let importProfile = Strings.tr("Localizable", "views.app.toolbar.import_profile", fallback: "Import profile") diff --git a/Passepartout/Library/Sources/UILibrary/Resources/en.lproj/Localizable.strings b/Passepartout/Library/Sources/UILibrary/Resources/en.lproj/Localizable.strings index 6be92a23e..0dac989db 100644 --- a/Passepartout/Library/Sources/UILibrary/Resources/en.lproj/Localizable.strings +++ b/Passepartout/Library/Sources/UILibrary/Resources/en.lproj/Localizable.strings @@ -39,11 +39,10 @@ "views.about.credits.notices" = "Notices"; "views.about.credits.translations" = "Translations"; -"views.app.rows.not_installed" = "Select a profile"; -"views.app.rows.no_modules" = "No active modules"; -"views.app.folders.active_profile" = "Installed profile"; +"views.app.installed_profile.none.name" = "Select a profile"; +"views.app.installed_profile.none.status" = "FIXME"; +"views.app.profile.no_modules" = "No active modules"; "views.app.folders.default" = "My profiles"; -"views.app.folders.add_profile" = "Add profile"; "views.app.folders.no_profiles" = "No profiles"; "views.app.folders.no_profiles.migrate" = "Migrate old profiles..."; "views.app.toolbar.new_profile.empty" = "Empty profile";