Skip to content

Commit f13c3fb

Browse files
committed
Localization updates
1 parent 2e45700 commit f13c3fb

File tree

8 files changed

+542
-13
lines changed

8 files changed

+542
-13
lines changed

SupportCompanion/Constants.swift

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,15 @@ enum Constants {
3737
enum General {
3838
static let days = String(localized: "General.Days", defaultValue: "Days", comment: "Number of days")
3939
static let daysAgo = String(localized: "General.DaysAgo", defaultValue: "Days ago", comment: "Number of days ago")
40+
static let hours = String(localized: "General.Hours", defaultValue: "Hours", comment: "Number of hours")
41+
static let hour = String(localized: "General.Hour", defaultValue: "Hour", comment: "Number of hour")
42+
static let minute = String(localized: "General.Minute", defaultValue: "Minute", comment: "Number of minute")
4043
static let minutes = String(localized: "General.Minutes", defaultValue: "Minutes", comment: "Number of minutes")
44+
static let second = String(localized: "General.Second", defaultValue: "Second", comment: "Number of second")
45+
static let seconds = String(localized: "General.Seconds", defaultValue: "Seconds", comment: "Number of seconds")
4146
static let manage = String(localized: "General.Manage", defaultValue: "Manage", comment: "Manage")
4247
static let close = String(localized: "General.Close", defaultValue: "Close", comment: "Close")
48+
static let elevate = String(localized: "General.Elevate", defaultValue: "Elevate", comment: "Elevate")
4349
}
4450

4551
enum AppPaths {
@@ -74,6 +80,12 @@ enum Constants {
7480
static let UpdateNotificationMessage = String(localized: "Notification.AppUpdateAvailable", defaultValue: "App Updates Available. Please update your apps to the latest version.", comment: "Notification message when an update is available")
7581
static let UpdateNotificationButtonText = String(localized: "Notification.UpdateNow", defaultValue: "Update Now 🚀", comment: "Notification button text when an update is available")
7682
}
83+
84+
enum Elevation {
85+
static let ElevationStartedMessage = String(localized: "Notification.ElevationStarted", defaultValue: "Privliged session started. You will be demoted in", comment: "Notification message when an elevation is started")
86+
static let ElevationHalfwayMessage = String(localized: "Notification.ElevationHalfway", defaultValue: "Your elevated privileges will be demoted in", comment: "Notification message when half the time has passed")
87+
static let ElevationDemotedMessage = String(localized: "Notification.ElevationDemoted", defaultValue: "Your elevated privileges have been demoted.", comment: "Notification message when the elevation is demoted")
88+
}
7789
}
7890

7991
enum Errors {
@@ -110,6 +122,7 @@ enum Constants {
110122
static let userInfo = String(localized: "Card.UserInfoTitle", defaultValue: "User Information", comment: "Title for user info card")
111123
static let pendingUpdates = String(localized: "Card.PendingUpdatesTitle", defaultValue: "Pending Updates", comment: "Title for pending updates card")
112124
static let installedApps = String(localized: "Card.InstalledAppsTitle", defaultValue: "Installed Applications", comment: "Title for installed apps card")
125+
static let privileges = String(localized: "Card.PrivilegesTitle", defaultValue: "Privileges", comment: "Title for privileges card")
113126
}
114127

115128
enum RebootModal {

SupportCompanion/Extensions/Extensions.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,13 +111,13 @@ extension TimeInterval {
111111
let seconds = Int(self) % 60
112112

113113
if hours > 0 {
114-
let hourUnit = hours == 1 ? "hour" : "hours"
114+
let hourUnit = hours == 1 ? Constants.General.hour : Constants.General.hours
115115
return String(format: "%d \(hourUnit)", hours)
116116
} else if minutes > 0 {
117-
let minuteUnit = minutes == 1 ? "minute" : "minutes"
117+
let minuteUnit = minutes == 1 ? Constants.General.minute : Constants.General.minutes
118118
return String(format: "%d \(minuteUnit)", minutes)
119119
} else {
120-
let secondUnit = seconds == 1 ? "second" : "seconds"
120+
let secondUnit = seconds == 1 ? Constants.General.second : Constants.General.seconds
121121
return String(format: "%d \(secondUnit)", seconds)
122122
}
123123
}

0 commit comments

Comments
 (0)