Skip to content

Commit a2972c8

Browse files
committed
feat: popover monitor use-language status
1 parent 9c46d94 commit a2972c8

5 files changed

Lines changed: 12 additions & 30 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ Notable changes to EasyKey. Format follows Keep a Changelog; versioning follows
139139
**Changed**
140140

141141
- Menu bar icons (all styles plus the pause and health indicators) render at a user-selectable scale: 1.0×–1.5×, default 1.3×.
142-
- The popover monitor row now shows the current app name as its title, with the monitoring status below it.
142+
- The popover monitor row now shows the current app name as its title, the language in use below it (e.g. "Use Vietnamese"), and a Monitor toggle.
143143

144144
**Fixed**
145145

‎EasyKeyApp/Coordination/SmartSwitchController.swift‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,13 +122,13 @@ final class SmartSwitchController {
122122
applyLanguage(from: choice)
123123
}
124124
currentAppSmartSwitchStatus = localization.format(
125-
.smartSwitchApplied,
125+
.smartSwitchUseLanguage,
126126
localization.displayName(for: choice.language)
127127
)
128128
AppLog.debug(.smartSwitch, "Applied preference language=\(choice.language.rawValue)")
129129
case let .recorded(choice):
130130
currentAppSmartSwitchStatus = localization.format(
131-
.smartSwitchSaved,
131+
.smartSwitchUseLanguage,
132132
localization.displayName(for: choice.language)
133133
)
134134
AppLog.debug(.smartSwitch, "Recorded preference language=\(choice.language.rawValue)")
@@ -178,7 +178,7 @@ final class SmartSwitchController {
178178
guard try smartSwitchStore.updateChoice(for: identity, choice: choice) else { return }
179179
smartSwitchRevision &+= 1
180180
currentAppSmartSwitchStatus = localization.format(
181-
.smartSwitchSaved,
181+
.smartSwitchUseLanguage,
182182
localization.displayName(for: choice.language)
183183
)
184184
onPublishedStateChange?()

‎EasyKeyApp/Localizable.xcstrings‎

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2189,36 +2189,19 @@
21892189
}
21902190
}
21912191
},
2192-
"smartSwitch.applied": {
2192+
"smartSwitch.useLanguage": {
21932193
"comment": "Status format %@ = language",
21942194
"localizations": {
21952195
"en": {
21962196
"stringUnit": {
21972197
"state": "translated",
2198-
"value": "Switched to %@"
2198+
"value": "Use %@"
21992199
}
22002200
},
22012201
"vi": {
22022202
"stringUnit": {
22032203
"state": "translated",
2204-
"value": "Đã chuyển sang %@"
2205-
}
2206-
}
2207-
}
2208-
},
2209-
"smartSwitch.saved": {
2210-
"comment": "Status format %@ = language",
2211-
"localizations": {
2212-
"en": {
2213-
"stringUnit": {
2214-
"state": "translated",
2215-
"value": "Remembered %@"
2216-
}
2217-
},
2218-
"vi": {
2219-
"stringUnit": {
2220-
"state": "translated",
2221-
"value": "Đã ghi nhớ %@"
2204+
"value": "Dùng %@"
22222205
}
22232206
}
22242207
}
@@ -3825,13 +3808,13 @@
38253808
"en": {
38263809
"stringUnit": {
38273810
"state": "translated",
3828-
"value": "Monitor this app"
3811+
"value": "Monitor"
38293812
}
38303813
},
38313814
"vi": {
38323815
"stringUnit": {
38333816
"state": "translated",
3834-
"value": "Theo dõi ứng dụng này"
3817+
"value": "Theo dõi"
38353818
}
38363819
}
38373820
}

‎EasyKeyApp/Localization/L10n.swift‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,6 @@ enum L10nKey: String, CaseIterable, Sendable {
246246
case settingsToggleSidebar = "settings.toggleSidebar"
247247
case settingsWindowTitle = "settings.windowTitle"
248248
case smartSwitchApp = "smartSwitch.app"
249-
case smartSwitchApplied = "smartSwitch.applied"
250249
case smartSwitchCurrentApp = "smartSwitch.currentApp"
251250
case smartSwitchEmpty = "smartSwitch.empty"
252251
case smartSwitchEnableHint = "smartSwitch.enableHint"
@@ -259,11 +258,11 @@ enum L10nKey: String, CaseIterable, Sendable {
259258
case smartSwitchRememberEncodingDescription = "smartSwitch.rememberEncoding.description"
260259
case smartSwitchRememberPerApp = "smartSwitch.rememberPerApp"
261260
case smartSwitchRememberPerAppDescription = "smartSwitch.rememberPerApp.description"
262-
case smartSwitchSaved = "smartSwitch.saved"
263261
case smartSwitchSavedApps = "smartSwitch.savedApps"
264262
case smartSwitchStatus = "smartSwitch.status"
265263
case smartSwitchUnavailable = "smartSwitch.unavailable"
266264
case smartSwitchUnknownApp = "smartSwitch.unknownApp"
265+
case smartSwitchUseLanguage = "smartSwitch.useLanguage"
267266
case statusEnglishInput = "status.englishInput"
268267
case statusNeedsAttention = "status.needsAttention"
269268
case statusPaused = "status.paused"

‎EasyKeyTests/SmartSwitchControllerTests.swift‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ final class SmartSwitchControllerTests: XCTestCase {
145145
XCTAssertEqual(preference.choice.encoding, .tcvn3)
146146
XCTAssertEqual(
147147
controller.currentAppSmartSwitchStatus,
148-
localization.format(.smartSwitchSaved, localization.displayName(for: .english))
148+
localization.format(.smartSwitchUseLanguage, localization.displayName(for: .english))
149149
)
150150
}
151151

@@ -169,7 +169,7 @@ final class SmartSwitchControllerTests: XCTestCase {
169169
XCTAssertEqual(settingsStore.settings.input.encoding, .tcvn3)
170170
XCTAssertEqual(
171171
controller.currentAppSmartSwitchStatus,
172-
localization.format(.smartSwitchApplied, localization.displayName(for: .vietnamese))
172+
localization.format(.smartSwitchUseLanguage, localization.displayName(for: .vietnamese))
173173
)
174174
}
175175

0 commit comments

Comments
 (0)