diff --git a/Crisp/Resources/Localizable.xcstrings b/Crisp/Resources/Localizable.xcstrings index 3df3f72..d2a534c 100644 --- a/Crisp/Resources/Localizable.xcstrings +++ b/Crisp/Resources/Localizable.xcstrings @@ -322,6 +322,26 @@ } } }, + ", main display" : { + "localizations" : { + "zh-Hans" : { + "stringUnit" : { + "state" : "translated", + "value" : ",主显示器" + } + } + } + }, + ", selected" : { + "localizations" : { + "zh-Hans" : { + "stringUnit" : { + "state" : "translated", + "value" : ",已选中" + } + } + } + }, "%@, expanded" : { "localizations" : { "zh-Hans" : { @@ -1312,6 +1332,36 @@ } } }, + "DDC" : { + "localizations" : { + "zh-Hans" : { + "stringUnit" : { + "state" : "translated", + "value" : "DDC" + } + } + } + }, + "Show Volume Sliders" : { + "localizations" : { + "zh-Hans" : { + "stringUnit" : { + "state" : "translated", + "value" : "显示音量滑块" + } + } + } + }, + "Speaker volume" : { + "localizations" : { + "zh-Hans" : { + "stringUnit" : { + "state" : "translated", + "value" : "扬声器音量" + } + } + } + }, "Switch failed, please try again" : { "localizations" : { "zh-Hans" : { diff --git a/Crisp/Views/BrightnessSliderView.swift b/Crisp/Views/BrightnessSliderView.swift index e09ff5f..bf0b0b5 100644 --- a/Crisp/Views/BrightnessSliderView.swift +++ b/Crisp/Views/BrightnessSliderView.swift @@ -98,7 +98,13 @@ struct BrightnessSliderView: View { } .padding(.horizontal, 12) .padding(.top, 2) - .accessibilityLabel(display.isBuiltin ? "Brightness control mode: System" : "Brightness control mode: \(ddcStatus == true ? "DDC hardware" : "Software emulation")") + .accessibilityLabel( + display.isBuiltin + ? "Brightness control mode: System" + : (ddcStatus == true + ? "Brightness control mode: DDC hardware" + : "Brightness control mode: Software emulation") + ) } HStack(spacing: 8) { diff --git a/Crisp/Views/DisplayModeListView.swift b/Crisp/Views/DisplayModeListView.swift index ea23a49..5466da5 100644 --- a/Crisp/Views/DisplayModeListView.swift +++ b/Crisp/Views/DisplayModeListView.swift @@ -814,7 +814,11 @@ struct CheckmarkRow: View { action() } .onHover { isHovered = $0 } - .accessibilityLabel(isSelected ? "\(label), selected" : label) + .accessibilityLabel( + isSelected + ? "\(NSLocalizedString(label, comment: "")), \(NSLocalizedString(", selected", comment: ""))" + : NSLocalizedString(label, comment: "") + ) .accessibilityAddTraits(.isButton) } } diff --git a/Crisp/Views/MenuBarView.swift b/Crisp/Views/MenuBarView.swift index 356b4ad..e2cd234 100644 --- a/Crisp/Views/MenuBarView.swift +++ b/Crisp/Views/MenuBarView.swift @@ -722,7 +722,7 @@ struct DisplayRowView: View { Label("Copy Display Name", systemImage: "doc.on.doc") } } - .accessibilityLabel("Display: \(display.name)\(display.isMain ? ", main display" : "")\(isExpanded ? ", expanded" : ", collapsed")") + .accessibilityLabel(Text(verbatim: "Display: \(display.name)\(display.isMain ? NSLocalizedString(", main display", comment: "") : "")\(isExpanded ? NSLocalizedString(", expanded", comment: "") : NSLocalizedString(", collapsed", comment: ""))")) .accessibilityHint("Click to expand the control panel") .accessibilityAddTraits(.isButton) }