Skip to content

Commit

Permalink
Parametrize app name in strings
Browse files Browse the repository at this point in the history
  • Loading branch information
keeshux committed Nov 17, 2024
1 parent 00ba67f commit 20813ac
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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])
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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])
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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.")
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 20813ac

Please sign in to comment.