Repository navigation
Format count in context plural strings and use FormatProvider for context strings - #61
Merged
perpetualKid merged 1 commit intoNov 26, 2026
Conversation
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.
GetPluralString(text, pluralText, n)formats the result withn, but its context counterpartGetParticularPluralString(context, text, pluralText, n)returns the raw string:This also shows up in the WPF
Gettextmarkup extension: withCountand no context it goes throughGetPluralStringand shows3 items, addingContextsends it toGetParticularPluralStringand it shows{0} items.GetParticularString(context, text, args)also formats withCultureInfowhile every other formatting overload usesFormatProvider, so a customFormatProvideris ignored only there.Changes:
GetParticularPluralString(context, text, pluralText, n)formats withn, same asGetPluralString(text, pluralText, n)GetParticularString(context, text, args)usesFormatProviderTests: two new tests in
CatalogTestfail before the change and pass after. All test projects pass on net10.0 and net48.