Skip to content

Clear the localizability warning in the autocrlf pop up - #594

Merged
hannesa2 merged 1 commit into
gitx:masterfrom
goneng:clear-prefs-localizability-warning
Sep 5, 2026
Merged

hannesa2 merged 1 commit into
gitx:masterfrom
goneng:clear-prefs-localizability-warning

Conversation

@goneng

@goneng goneng commented Aug 24, 2026

Copy link
Copy Markdown
Collaborator

The core.autocrlf pop ups carry one row that means "no value", and the
controller recognised it by comparing against its (not set) title.
That made a piece of user-facing text load bearing, which is what the
NonLocalizedStringChecker analyzer warning was pointing at.

  • Mark that row in the nib with a tag and find it by that tag, so the
    words on it no longer decide what gets saved
  • Read the setting from the selected title only once the tag has ruled
    out the unset row, which is safe because every other row is titled
    with a value git accepts
  • Cover both pop ups with a test, so the nib and the controller cannot
    drift apart quietly

Wrapping the literal in NSLocalizedString would have cleared the
warning and left a trap behind. GitX ships only en.lproj, so the macro
returns its key unchanged and everything keeps working; the day a second
locale arrives, the controller's string and the nib's title diverge,
itemWithTitle: stops matching, and GitX writes the translated words
into core.autocrlf. Keying on a tag instead frees the label to be
translated whenever that day comes.

The one thing the change moves into the nib is the tag itself, which is
why the tests assert on the nib rather than trusting it.

Test plan

  • Two new tests fail before the nib change and pass after it, covering
    the repository and the global pop up
  • GitXTests is green at 47 of 47
  • xcodebuild analyze no longer reports the warning at
    PBGitPrefsWindowController.m:169, with the file confirmed
    re-analyzed in that run

The core.autocrlf pop ups carry one row that means "no value", and the
controller recognised it by comparing against its "(not set)" title.
That made a piece of user-facing text load bearing: translating it would
have left the lookup failing and GitX writing the translated words into
core.autocrlf.

- Mark that row in the nib with a tag and find it by that tag, so the
  words on it no longer decide what gets saved
- Read the setting from the selected title only once the tag has ruled
  out the unset row, which is safe because every other row is titled
  with a value git accepts
- Cover both pop ups with a test, so the nib and the controller cannot
  drift apart quietly
@goneng
goneng marked this pull request as ready for review August 24, 2026 14:54
@hannesa2
hannesa2 merged commit 95767e6 into gitx:master Sep 5, 2026
3 checks passed
@goneng
goneng deleted the clear-prefs-localizability-warning branch September 7, 2026 20:05
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.

2 participants