Fix GitCodeLensProvider.resolveGitAuthors… "others" pluralization.#3296
Merged
d13 merged 1 commit intogitkraken:mainfrom May 31, 2024
Merged
Conversation
ac4f125 to
6c9a10c
Compare
NinoScript
approved these changes
May 15, 2024
TJohnsonSE
suggested changes
May 16, 2024
Contributor
There was a problem hiding this comment.
This looks this change has a bug where the generated 'andOthers' string is squished against the 'author' trunk. See screenshot below:
My recommendation is to change the ternary evaluation to check three cases: when count is exactly 1, when count is exactly 2, and when count is > 2. Then just tack in the extra missing space before the "and".
Something like this should work:
let title = ${pluralize('author', count, { zero: '?' })} (${author}${ count > 2 ? ' and others' : count === 2 ? ' and 1 other' : '' });
6c9a10c to
ba647ca
Compare
Contributor
Author
|
Oops, @TJohnsonSE, thanks for catching the squishing — fixed! |
d13
approved these changes
May 31, 2024
Member
|
@bm-w thank you for the contribution! |
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.


Description
Fixes Authors lens to say e.g. “one other” (in full “2 authors (Jane Doe and one other)”) when there are 2 authors (#3295).
Checklist
Fixes $XXX -orCloses #XXX -prefix to auto-close the issue that your PR addresses