Code Quality: Change all multiple localized singular and plural strings to a single ICU message format string
What feature or improvement do you think would benefit Files?
Benefits of Converting Multiple Localized Strings to ICU Message Format
By adopting the ICU message format, the overall quality and efficiency of the localization process are greatly enhanced, leading to better user experiences across all supported languages.
-
Consistency in Localization Switching to ICU messages ensures consistent use of singular and plural forms across different language versions of the application. ICU messages allow defining and managing all variants within a single string, eliminating the risk of inconsistencies in translation.
-
Reduction in Number of Localized Strings Combining singular and plural forms into one ICU string significantly reduces the number of localized strings. This streamlines the localization process, making it easier to manage and update translations.
-
Improved Maintenance With fewer strings to manage, maintaining translations becomes more straightforward. Changes can be made in one place without the need to update multiple strings, reducing the chance of errors and omissions.
-
Enhanced Flexibility ICU message format supports complex grammatical rules and variations, providing greater flexibility to accommodate the linguistic nuances of different languages. This ensures that the translations are more accurate and natural-sounding.
-
Scalability As the application grows and supports more languages, the ICU message format can easily scale to accommodate new translations without significantly increasing the localization workload.
-
Developer Efficiency Developers can work more efficiently with a unified format, reducing the complexity of managing multiple strings and making the codebase cleaner and more maintainable. This leads to faster implementation of new features and bug fixes.
Note: This discussion will focus specifically on using ICU plural forms.
TODO list
[!IMPORTANT] ✅ Success merged ☑️ Ready for review 🚧 Not found where used 🏗️ Start build ⏳ Waiting ⏸️ Skip
[!NOTE] If there is a new key that needs a plural, I will add it.
Strings
Stage Zero
✅ ItemSelected.Text, ItemsSelected.Text ----> SelectedItems
https://github.com/files-community/Files/blob/af0ab75334fc38273042201bc73119dd4e470b26/src/Files.App/Strings/en-US/Resources.resw#L429-L434
✅ ItemCount.Text, ItemsCount.Text ----> Items
https://github.com/files-community/Files/blob/af0ab75334fc38273042201bc73119dd4e470b26/src/Files.App/Strings/en-US/Resources.resw#L435-L440
Stage One
✅🚧 CopyItemsDialogTitle ----> CopyItemsDialogTitle
https://github.com/files-community/Files/blob/af0ab75334fc38273042201bc73119dd4e470b26/src/Files.App/Strings/en-US/Resources.resw#L1239-L1241
✅ DeleteItemsDialogTitle ----> DeleteItemsDialogTitle
https://github.com/files-community/Files/blob/af0ab75334fc38273042201bc73119dd4e470b26/src/Files.App/Strings/en-US/Resources.resw#L1242-L1244
✅🚧 CopyItemsDialogSubtitleSingle, CopyItemsDialogSubtitleMultiple ----> CopyItemsDialogSubtitle
https://github.com/files-community/Files/blob/af0ab75334fc38273042201bc73119dd4e470b26/src/Files.App/Strings/en-US/Resources.resw#L1269-L1271 https://github.com/files-community/Files/blob/af0ab75334fc38273042201bc73119dd4e470b26/src/Files.App/Strings/en-US/Resources.resw#L1236-L1238
✅🚧 MoveItemsDialogSubtitleSingle, MoveItemsDialogSubtitleMultiple ----> MoveItemsDialogSubtitle
https://github.com/files-community/Files/blob/af0ab75334fc38273042201bc73119dd4e470b26/src/Files.App/Strings/en-US/Resources.resw#L1275-L1277 https://github.com/files-community/Files/blob/af0ab75334fc38273042201bc73119dd4e470b26/src/Files.App/Strings/en-US/Resources.resw#L1248-L1250
✅🚧 MoveItemsDialogTitle ----> MoveItemsDialogTitle
https://github.com/files-community/Files/blob/af0ab75334fc38273042201bc73119dd4e470b26/src/Files.App/Strings/en-US/Resources.resw#L1251-L1253
✅ DeleteItemsDialogSubtitleSingle, DeleteItemsDialogSubtitleMultiple ----> DeleteItemsDialogSubtitle
https://github.com/files-community/Files/blob/af0ab75334fc38273042201bc73119dd4e470b26/src/Files.App/Strings/en-US/Resources.resw#L1272-L1274 https://github.com/files-community/Files/blob/af0ab75334fc38273042201bc73119dd4e470b26/src/Files.App/Strings/en-US/Resources.resw#L1254-L1256
✅ ConflictingItemsDialogSubtitleMultipleConflictsMultipleNonConflicts, ConflictingItemsDialogSubtitleSingleConflictMultipleNonConflicts, ConflictingItemsDialogSubtitleSingleConflictNoNonConflicts, ConflictingItemsDialogSubtitleMultipleConflictsNoNonConflicts ----> ConflictingItemsDialogSubtitleConflicts, ConflictingItemsDialogSubtitleConflictsNonConflicts
https://github.com/files-community/Files/blob/af0ab75334fc38273042201bc73119dd4e470b26/src/Files.App/Strings/en-US/Resources.resw#L1260-L1262 https://github.com/files-community/Files/blob/af0ab75334fc38273042201bc73119dd4e470b26/src/Files.App/Strings/en-US/Resources.resw#L1266-L1268 https://github.com/files-community/Files/blob/af0ab75334fc38273042201bc73119dd4e470b26/src/Files.App/Strings/en-US/Resources.resw#L1290-L1295
✅ ConflictingItemsDialogTitle ----> ConflictingItemsDialogTitle
https://github.com/files-community/Files/blob/af0ab75334fc38273042201bc73119dd4e470b26/src/Files.App/Strings/en-US/Resources.resw#L1263-L1265
Stage Two
✅ DayAgo, DaysAgo ----> DaysAgo
https://github.com/files-community/Files/blob/af0ab75334fc38273042201bc73119dd4e470b26/src/Files.App/Strings/en-US/Resources.resw#L387-L392
✅ HourAgo, HoursAgo ----> HoursAgo
https://github.com/files-community/Files/blob/af0ab75334fc38273042201bc73119dd4e470b26/src/Files.App/Strings/en-US/Resources.resw#L393-L398
✅ MinuteAgo, MinutesAgo ----> MinutesAgo
https://github.com/files-community/Files/blob/af0ab75334fc38273042201bc73119dd4e470b26/src/Files.App/Strings/en-US/Resources.resw#L399-L404
✅ OneSecondAgo, SecondsAgo ----> SecondsAgo
https://github.com/files-community/Files/blob/af0ab75334fc38273042201bc73119dd4e470b26/src/Files.App/Strings/en-US/Resources.resw#L405-L410
Stage Three
✅ PropertiesFilesAndFoldersCountString ----> PropertiesFilesAndFoldersCountString
https://github.com/files-community/Files/blob/af0ab75334fc38273042201bc73119dd4e470b26/src/Files.App/Strings/en-US/Resources.resw#L471-L473
✅ PropertiesFilesFoldersAndLocationsCountString ----> PropertiesFilesAndFoldersAndLocationsCountString
https://github.com/files-community/Files/blob/af0ab75334fc38273042201bc73119dd4e470b26/src/Files.App/Strings/en-US/Resources.resw#L474-L476
✅ DetailsArchiveItemCount ----> DetailsArchiveItems
https://github.com/files-community/Files/blob/af0ab75334fc38273042201bc73119dd4e470b26/src/Files.App/Strings/en-US/Resources.resw#L1626-L1628
Prepare
☑️ ItemSizeBytes ----> ItemSizeBytes
https://github.com/files-community/Files/blob/af0ab75334fc38273042201bc73119dd4e470b26/src/Files.App/Strings/en-US/Resources.resw#L450-L452
Skipped
...
⏸️ CopyItemDescription ----> CopyItemsDescription
https://github.com/files-community/Files/blob/af0ab75334fc38273042201bc73119dd4e470b26/src/Files.App/Strings/en-US/Resources.resw#L2376-L2378
⏸️ CopyPathDescription ----> CopyPathDescription
https://github.com/files-community/Files/blob/af0ab75334fc38273042201bc73119dd4e470b26/src/Files.App/Strings/en-US/Resources.resw#L2379-L2381
⏸️ CopyPathWithQuotesDescription ----> CopyPathWithQuotesDescription
https://github.com/files-community/Files/blob/af0ab75334fc38273042201bc73119dd4e470b26/src/Files.App/Strings/en-US/Resources.resw#L2382-L2384
⏸️ CutItemDescription ----> CutItemsDescription
https://github.com/files-community/Files/blob/af0ab75334fc38273042201bc73119dd4e470b26/src/Files.App/Strings/en-US/Resources.resw#L2385-L2387
⏸️ PasteItemDescription ----> PasteItemsDescription
https://github.com/files-community/Files/blob/af0ab75334fc38273042201bc73119dd4e470b26/src/Files.App/Strings/en-US/Resources.resw#L2388-L2390
⏸️ PasteItemToSelectionDescription ----> PasteItemsToSelectionDescription
https://github.com/files-community/Files/blob/af0ab75334fc38273042201bc73119dd4e470b26/src/Files.App/Strings/en-US/Resources.resw#L2391-L2393
⏸️ DeleteItemDescription ----> DeleteItemsDescription
https://github.com/files-community/Files/blob/af0ab75334fc38273042201bc73119dd4e470b26/src/Files.App/Strings/en-US/Resources.resw#L2394-L2396
⏸️ CreateShortcutDescription ----> CreateShortcutsDescription
https://github.com/files-community/Files/blob/af0ab75334fc38273042201bc73119dd4e470b26/src/Files.App/Strings/en-US/Resources.resw#L2400-L2402
⏸️ RestoreRecycleBinDescription ----> RestoreRecycleBinDescription
https://github.com/files-community/Files/blob/af0ab75334fc38273042201bc73119dd4e470b26/src/Files.App/Strings/en-US/Resources.resw#L2412-L2414
⏸️ OpenItemDescription ----> OpenItemsDescription
https://github.com/files-community/Files/blob/af0ab75334fc38273042201bc73119dd4e470b26/src/Files.App/Strings/en-US/Resources.resw#L2418-L2420
⏸️ OpenItemWithApplicationPickerDescription ----> OpenItemsWithApplicationPickerDescription
https://github.com/files-community/Files/blob/af0ab75334fc38273042201bc73119dd4e470b26/src/Files.App/Strings/en-US/Resources.resw#L2421-L2423
⏸️ ShareItemDescription ----> ShareItemsDescription
https://github.com/files-community/Files/blob/af0ab75334fc38273042201bc73119dd4e470b26/src/Files.App/Strings/en-US/Resources.resw#L2445-L2447
⏸️ PinToStartDescription ----> PinToStartDescription
https://github.com/files-community/Files/blob/af0ab75334fc38273042201bc73119dd4e470b26/src/Files.App/Strings/en-US/Resources.resw#L2448-L2450
⏸️ UnpinFromStartDescription ----> UnpinFromStartDescription
https://github.com/files-community/Files/blob/af0ab75334fc38273042201bc73119dd4e470b26/src/Files.App/Strings/en-US/Resources.resw#L2451-L2453
⏸️ PinFolderToSidebarDescription ----> PinFoldersToSidebarDescription
https://github.com/files-community/Files/blob/af0ab75334fc38273042201bc73119dd4e470b26/src/Files.App/Strings/en-US/Resources.resw#L2454-L2456
⏸️ UnpinFolderFromSidebarDescription ----> UnpinFoldersFromSidebarDescription
https://github.com/files-community/Files/blob/af0ab75334fc38273042201bc73119dd4e470b26/src/Files.App/Strings/en-US/Resources.resw#L2457-L2459
I'll have to create a small patch to enable custom format for number. Add better number format from default 1,000,000.000 to 1 000 000.000 via custom format for used this {0, number}