Skip to content

Conversation

@mrashutoshnigam
Copy link
Contributor

This pull request refactors localization strings in several action classes within the Files.App.Actions namespace, replacing hardcoded string literals with references to a centralized Strings class. The changes improve maintainability and enhance localization support across the application.

#16718

Changes Made

  • Created a centralized Strings class for managing localization strings.
  • Refactored localization strings in the following action classes:
    • SetAsAppBackgroundAction
    • SetAsLockscreenBackgroundAction
    • SetAsSlideshowBackgroundAction
    • SetAsWallpaperBackgroundAction
    • RotateLeftAction
    • RotateRightAction
  • Updated error messages, labels, and descriptions to use the new Strings class.

Benefits

  • Improved maintainability: All localization strings are now managed in one place.
  • Enhanced consistency across the application.
  • Simplified future updates and localization efforts.
  • Reduced risk of typos and errors in localized strings.

Testing Steps

  1. Open the Files App.
  2. Navigate to image files and test the following actions:
    • Set as app background
    • Set as lock screen background
    • Set as slideshow background
    • Set as wallpaper background
    • Rotate left
    • Rotate right
  3. Verify that all labels, descriptions, and error messages are displayed correctly.
  4. Change the application language in settings and repeat steps 2-3 to ensure proper localization.
  5. Check for any visual inconsistencies or errors in the displayed strings.

Additional Notes

  • This change does not alter any functionality but improves code maintainability for the affected action classes.
  • Code reviewers should ensure all string literals in the mentioned classes have been replaced with references to the new Strings class.
  • Verify that the changes do not introduce any regression in existing image-related actions.

Refactor localization strings in archive compression and
decompression actions to utilize a new `Strings` class.
This change replaces direct string literals with references
to the centralized resource management, enhancing
maintainability and consistency across the application.
Affected classes include `CompressIntoArchiveAction`,
`CompressIntoSevenZipAction`, `CompressIntoZipAction`,
`DecompressArchive`, `DecompressArchiveHere`,
`DecompressArchiveHereSmart`, and
`DecompressArchiveToChildFolderAction`. The
`ComputeLabel` method in `DecompressArchiveToChildFolderAction`
has also been updated for consistent localization.
Refactor various action classes in the `Files.App.Actions` namespace to replace hardcoded string literals with references to a centralized `Strings` class for localization. This change applies to error messages, labels, and descriptions in `SetAsAppBackgroundAction`, `SetAsLockscreenBackgroundAction`, `SetAsSlideshowBackgroundAction`, `SetAsWallpaperBackgroundAction`, `RotateLeftAction`, and `RotateRightAction`, improving maintainability and localization support.
@Lamparter
Copy link
Contributor

Was the PR body written by AI 😁

@Lamparter
Copy link
Contributor

- Code Quality: Update localization to use centralized Strings class 5
+ Code Quality: Updated localization strings in archive and images actions

Copy link
Member

@yaira2 yaira2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@yaira2 yaira2 added the ready to merge Pull requests that are approved and ready to merge label Mar 2, 2025
@yaira2 yaira2 merged commit 7bffa1c into files-community:main Mar 2, 2025
6 checks passed
@mrashutoshnigam mrashutoshnigam deleted the codeQuality/replaceStringsLiteralsWithContants_16718_05 branch March 2, 2025 17:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready to merge Pull requests that are approved and ready to merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants