Added proper pluralization support for localized strings#125
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces SmartFormat-based localization formatting to support proper pluralization in UI strings (e.g., “1 item” vs “2 items”), and adjusts several view models/pages to use the new plural-aware resource keys.
Changes:
- Added SmartFormat to the SDK and switched
ToLocalized(..., interpolate)formatting to useSmart.Format(...). - Updated many UI call sites (C#/XAML) and
en-USresources to use new*Pluralresource keys and SmartFormat plural/choose expressions. - Extended transfer progress state (
TotalProgress.State) and adjusted transfer reporting to include richer interpolation data.
Reviewed changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/SecureFolderFS.Tests/ServiceImplementation/MockLocalizationService.cs | Updates mocked date resource keys to the new *Plural variants. |
| src/Sdk/SecureFolderFS.Sdk/ViewModels/Views/Vault/VaultHealthViewModel.cs | Uses new pluralized resource key for collected-item subtitle. |
| src/Sdk/SecureFolderFS.Sdk/ViewModels/Views/Vault/BrowserViewModel.cs | Adds an IsPickingFolder flag and toggles it during folder-pick navigation. |
| src/Sdk/SecureFolderFS.Sdk/ViewModels/Controls/Transfer/TransferViewModel.cs | Switches transfer titles to new SmartFormat pluralized keys and passes structured interpolation. |
| src/Sdk/SecureFolderFS.Sdk/ViewModels/Controls/Storage/Browser/FolderViewModel.cs | Changes folder-picking detection to BrowserViewModel.IsPickingFolder. |
| src/Sdk/SecureFolderFS.Sdk/ViewModels/Controls/Storage/Browser/BrowserItemViewModel.cs | Updates delete dialogs to new pluralized resource keys. |
| src/Sdk/SecureFolderFS.Sdk/SecureFolderFS.Sdk.csproj | Adds SmartFormat package dependency. |
| src/Sdk/SecureFolderFS.Sdk/Extensions/TransferExtensions.cs | Adjusts transfer progress reporting to include State and supports custom item-name selection. |
| src/Sdk/SecureFolderFS.Sdk/Extensions/LocalizationServiceExtensions.cs | Updates relative-date localization to use new plural keys. |
| src/Sdk/SecureFolderFS.Sdk/Extensions/LocalizationExtensions.cs | Switches interpolation formatting from string.Format to Smart.Format. |
| src/Sdk/SecureFolderFS.Sdk/AppModels/TotalProgress.cs | Extends progress model to include optional State. |
| src/Platforms/SecureFolderFS.Uno/Views/Vault/VaultHealthPage.xaml | Updates count-to-string key to pluralized variant. |
| src/Platforms/SecureFolderFS.UI/ViewModels/Health/HealthFileDataIssueViewModel.cs | Uses pluralized corrupted-chunks resource key. |
| src/Platforms/SecureFolderFS.UI/ValueConverters/BaseDateTimeToStringConverter.cs | Makes LOCALIZE parameter handling case-insensitive. |
| src/Platforms/SecureFolderFS.UI/Strings/en-US/Resources.resx | Adds SmartFormat plural/choose strings and introduces many new *Plural keys. |
| src/Platforms/SecureFolderFS.UI/Assets/Licenses/SmartFormat LICENSE | Adds SmartFormat license text. |
| src/Platforms/SecureFolderFS.Maui/Views/Vault/BrowserPage.xaml | Updates selection/count strings to pluralized keys. |
| src/Platforms/SecureFolderFS.Maui/UserControls/Browser/TransferControl.xaml | Adds tail truncation for long transfer titles. |
| src/Platforms/SecureFolderFS.Maui/UserControls/Browser/BrowserControl.DragDrop.xaml.cs | Updates transfer call to pass item-name selector overload. |
| src/Platforms/SecureFolderFS.Maui/Platforms/Android/ServiceImplementation/VaultForegroundService.cs | Updates notification title to pluralized key. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
No description provided.