Repository navigation
Clear the localizability warning in the autocrlf pop up - #594
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
core.autocrlfpop ups carry one row that means "no value", and thecontroller recognised it by comparing against its
(not set)title.That made a piece of user-facing text load bearing, which is what the
NonLocalizedStringCheckeranalyzer warning was pointing at.words on it no longer decide what gets saved
out the unset row, which is safe because every other row is titled
with a value git accepts
drift apart quietly
Wrapping the literal in
NSLocalizedStringwould have cleared thewarning and left a trap behind. GitX ships only
en.lproj, so the macroreturns 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 wordsinto
core.autocrlf. Keying on a tag instead frees the label to betranslated 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
the repository and the global pop up
GitXTestsis green at 47 of 47xcodebuild analyzeno longer reports the warning atPBGitPrefsWindowController.m:169, with the file confirmedre-analyzed in that run