Skip to content

Conversation

@mrashutoshnigam
Copy link
Contributor

Feature/Code Quality: Centralize and Refactor Localization Strings in Files App

This pull request aims to improve code quality and maintainability in the Files App by centralizing localization strings and replacing string literals with string constants. The changes enhance consistency, reduce the risk of typos, and streamline future updates and localization efforts.
#16718

Changes Made

  1. Created a centralized Strings class to manage all localization strings.
  2. Refactored localization strings in the following actions:
    • EmptyRecycleBinAction
    • RestoreAllRecycleBinAction
    • RestoreRecycleBinAction
  3. Updated confirmation dialog titles, content, and button texts for improved user experience.
  4. Replaced string literals with corresponding string constants throughout the Files App codebase.

Benefits

  • Improved maintainability: All strings are now managed in one place.
  • Enhanced consistency across the application.
  • Reduced likelihood of typos and errors.
  • Improved code readability.
  • Streamlined future updates and localization efforts.

Testing Steps

  1. Open Files App.
  2. Navigate through Recycle Bin sections of the app to ensure all strings are displayed correctly.
  3. Perform actions that trigger string-dependent functionality (e.g., error messages, tooltips).
  4. Update language via settings and repeat steps 2 and 3.
  5. Verify that no visual or functional regressions occurred due to the changes.
  6. Check for any compile-time errors or warnings related to string usage.

Additional Notes

  • This change does not alter any functionality but improves code maintainability.
  • Code reviewers should pay special attention to ensure no string literals were missed during this refactoring.

Refactor localization strings in `EmptyRecycleBinAction`,
`RestoreAllRecycleBinAction`, and `RestoreRecycleBinAction`
to use a centralized `Strings` class. This change improves
maintainability and consistency across the application,
ensuring all strings are managed in one place.
Confirmation dialog titles, content, and button texts
have also been updated for a better user experience.
@yaira2
Copy link
Member

yaira2 commented Feb 23, 2025

LGTM

@yaira2 yaira2 changed the title Update localization for recycle bin actions #16718 Code Quality: Update localization for recycle bin actions Feb 23, 2025
@yaira2 yaira2 added the ready to merge Pull requests that are approved and ready to merge label Feb 23, 2025
@yaira2 yaira2 merged commit 5e34c3b into files-community:main Feb 23, 2025
6 checks passed
@mrashutoshnigam mrashutoshnigam deleted the codeQuality/replaceStringsLiteralsWithContants_16718_01 branch February 28, 2025 16:17
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.

2 participants