Skip to content

i18n: fix interpolation-based localization failures and add missing zh-Hans strings - #34

Open
xiangfeidexiaohuo wants to merge 1 commit into
didriksg:mainfrom
xiangfeidexiaohuo:main
Open

i18n: fix interpolation-based localization failures and add missing zh-Hans strings#34
xiangfeidexiaohuo wants to merge 1 commit into
didriksg:mainfrom
xiangfeidexiaohuo:main

Conversation

@xiangfeidexiaohuo

@xiangfeidexiaohuo xiangfeidexiaohuo commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Fix three bugs where string interpolation prevented LocalizedStringKey
from matching defined translations:

  • BrightnessSliderView: split ternary into three literal branches so
    "Brightness control mode: DDC hardware" and "...Software emulation"
    translations take effect instead of being looked up as "...: %@".
  • MenuBarView: use Text(verbatim:) + NSLocalizedString to compose the
    display state accessibility label from individually localized
    fragments (", main display", ", expanded", ", collapsed").
  • DisplayModeListView: replace string-interpolated accessibilityLabel
    with explicit NSLocalizedString lookups so both the label and the
    ", selected" suffix are localized.

Add missing zh-Hans keys to Localizable.xcstrings:

  • "Show Volume Sliders" -> "显示音量滑块"
  • "Speaker volume" -> "扬声器音量"
  • "DDC" -> "DDC"
  • ", main display" -> ",主显示器"
  • ", selected" -> ",已选中"

What & why

How tested

Checklist

  • Builds locally (./dev.sh, or ./scripts/release.sh v0.0.0-ci for the full release build)
  • Added/updated Crisp/Resources/Localizable.xcstrings for any new user-facing strings
  • Screenshot or short clip for any UI change

…h-Hans strings

Fix three bugs where string interpolation prevented LocalizedStringKey
from matching defined translations:

- BrightnessSliderView: split ternary into three literal branches so
  "Brightness control mode: DDC hardware" and "...Software emulation"
  translations take effect instead of being looked up as "...: %@".
- MenuBarView: use Text(verbatim:) + NSLocalizedString to compose the
  display state accessibility label from individually localized
  fragments (", main display", ", expanded", ", collapsed").
- DisplayModeListView: replace string-interpolated accessibilityLabel
  with explicit NSLocalizedString lookups so both the label and the
  ", selected" suffix are localized.

Add missing zh-Hans keys to Localizable.xcstrings:
- "Show Volume Sliders" -> "显示音量滑块"
- "Speaker volume" -> "扬声器音量"
- "DDC" -> "DDC"
- ", main display" -> ",主显示器"
- ", selected" -> ",已选中"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant