Add localisation support to various pluralisable strings#38047
Open
diquoks wants to merge 7 commits into
Open
Conversation
bdach
reviewed
Jun 12, 2026
| public DeleteCollectionDialog(Live<BeatmapCollection> collection, Action deleteAction) | ||
| { | ||
| BodyText = collection.PerformRead(c => $"{c.Name} ({"beatmap".ToQuantity(c.BeatmapMD5Hashes.Count)})"); | ||
| BodyText = collection.PerformRead(c => DialogStrings.DeleteCollectionBodyText(c.Name, c.BeatmapMD5Hashes.Count)); |
Collaborator
There was a problem hiding this comment.
This is much too specific. I would rather have this composed from parts. Something along the lines of:
LocalisableString.Interpolate($@"{c.Name} ({CommonStrings.BeatmapCount(c.BeatmapMD5Hashes.Count)}")
Contributor
Author
There was a problem hiding this comment.
yeah, i thought about that too, to be honest
| /// <summary> | ||
| /// "{0:#,0} item|{0:#,0} items" | ||
| /// </summary> | ||
| public static LocalisableString ItemUnit(int itemsCount) => new PluralisableString(new TranslatableString(getKey(@"item_unit"), @"{0:#,0} item|{0:#,0} items", itemsCount), itemsCount, '|'); |
Collaborator
There was a problem hiding this comment.
Would prefer ItemCount or ItemCounter
| /// <summary> | ||
| /// "{0:#,0} match|{0:#,0} matches" | ||
| /// </summary> | ||
| public static LocalisableString MatchUnit(int matchesCount) => new PluralisableString(new TranslatableString(getKey(@"match_unit"), @"{0:#,0} match|{0:#,0} matches", matchesCount), matchesCount, '|'); |
Collaborator
There was a problem hiding this comment.
Would prefer MatchCount or MatchCounter
- rename some strings - split `DeleteCollectionBodyText` string - create separate version for `ItemsCount` in `DrawableCollectionListItem` with special formatting
diquoks
commented
Jun 12, 2026
| /// <summary> | ||
| /// "{0:#,0} item|{0:#,0} items" | ||
| /// </summary> | ||
| public static LocalisableString ItemsCount(int quantity) => new PluralisableString(new TranslatableString(getKey(@"items_count"), @"{0:#,0} item|{0:#,0} items", quantity), quantity, '|'); |
Contributor
Author
There was a problem hiding this comment.
idk if you'll like it or not, but i wanted to keep the original formatting in both cases, so i had to duplicate this string for usage in DrawableCollectionListItem
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.
SongSelect#36625 (see A few localizations inSongSelect#36625 (comment))changes can be reviewed commit by commit