Parametrize app name in strings

This commit is contained in:
Davide 2024-11-17 18:48:29 +01:00
parent 00ba67f135
commit 20813ac77e
No known key found for this signature in database
GPG Key ID: A48836171C759F5E
5 changed files with 13 additions and 9 deletions

View File

@ -67,7 +67,7 @@ private extension MigrateContentView.ListView {
}
var messageView: some View {
Text(Strings.Views.Migrate.Sections.Main.header)
Text(Strings.Views.Migrate.Sections.Main.header(Strings.Unlocalized.appName))
.padding([.top, .leading, .trailing])
}

View File

@ -61,7 +61,7 @@ private extension MigrateContentView.TableView {
}
var messageView: some View {
Text(Strings.Views.Migrate.Sections.Main.header)
Text(Strings.Views.Migrate.Sections.Main.header(Strings.Unlocalized.appName))
.padding([.top, .leading, .trailing])
}

View File

@ -612,8 +612,10 @@ public enum Strings {
public static let ok = Strings.tr("Localizable", "theme.confirmation.ok", fallback: "Confirm")
}
public enum LockScreen {
/// Passepartout is locked
public static let reason = Strings.tr("Localizable", "theme.lock_screen.reason", fallback: "Passepartout is locked")
/// %@ is locked
public static func reason(_ p1: Any) -> String {
return Strings.tr("Localizable", "theme.lock_screen.reason", String(describing: p1), fallback: "%@ is locked")
}
}
}
public enum Ui {
@ -744,8 +746,10 @@ public enum Strings {
}
public enum Sections {
public enum Main {
/// Select below the profiles from old versions of Passepartout that you want to import. In case your profiles are stored on iCloud, they may take a while to synchronize. If you do not see them now, please come back later.
public static let header = Strings.tr("Localizable", "views.migrate.sections.main.header", fallback: "Select below the profiles from old versions of Passepartout that you want to import. In case your profiles are stored on iCloud, they may take a while to synchronize. If you do not see them now, please come back later.")
/// Select below the profiles from old versions of %@ that you want to import. In case your profiles are stored on iCloud, they may take a while to synchronize. If you do not see them now, please come back later.
public static func header(_ p1: Any) -> String {
return Strings.tr("Localizable", "views.migrate.sections.main.header", String(describing: p1), fallback: "Select below the profiles from old versions of %@ that you want to import. In case your profiles are stored on iCloud, they may take a while to synchronize. If you do not see them now, please come back later.")
}
}
}
}

View File

@ -163,7 +163,7 @@
"views.migrate.no_profiles" = "Nothing to migrate";
"views.migrate.items.discard" = "Discard";
"views.migrate.items.migrate" = "Proceed";
"views.migrate.sections.main.header" = "Select below the profiles from old versions of Passepartout that you want to import. In case your profiles are stored on iCloud, they may take a while to synchronize. If you do not see them now, please come back later.";
"views.migrate.sections.main.header" = "Select below the profiles from old versions of %@ that you want to import. In case your profiles are stored on iCloud, they may take a while to synchronize. If you do not see them now, please come back later.";
"views.migrate.alerts.delete.message" = "Do you want to discard these profiles? You will not be able to recover them later.\n\n%@";
"views.donate.title" = "Make a donation";
@ -258,7 +258,7 @@
"theme.confirmation.ok" = "Confirm";
"theme.confirmation.cancel" = "Cancel";
"theme.confirmation.message" = "Are you sure you want to proceed with this operation?";
"theme.lock_screen.reason" = "Passepartout is locked";
"theme.lock_screen.reason" = "%@ is locked";
// MARK: - Components

View File

@ -586,7 +586,7 @@ struct ThemeLockScreenModifier<LockedContent>: ViewModifier where LockedContent:
do {
let isAuthorized = try await context.evaluatePolicy(
policy,
localizedReason: Strings.Theme.LockScreen.reason
localizedReason: Strings.Theme.LockScreen.reason(Strings.Unlocalized.appName)
)
return isAuthorized
} catch {