Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Localization] Move PowerToys Run string resources from xaml files to resx #6165

Merged
merged 19 commits into from
Sep 2, 2020

Conversation

arjunbalgovind
Copy link
Contributor

@arjunbalgovind arjunbalgovind commented Aug 25, 2020

Summary of the Pull Request

What is this about?
This PR removes all the language xaml files in the PowerToys Run projects and plugin projects and adds an english resx file with the strings, and enables its localization on the pipeline. The Internationalization related classes in Wox.Core.Resources were also removed as they were no longer required.

PR Checklist

Info on Pull Request

What does this include?

  • en.xaml files converted to Resources.resx for all launcher projects (manually with some Ctrl+F and Ctrl+H magic along with resgen)
  • Replaced all calls to GetTranslation by directly referencing the resource with the statement ProjectName.Properties.Resources.resourceName.
  • The Internationalization and Language related classes were removed since there were used only for the Language xaml files. Since this contained GetTranslation, the GetTranslation method was removed from IPublicAPI as well.
  • Modified the tests which checked the number of mocked calls to GetTranslation. Instead of checking for a call with a resource name, it was changed to check the values set for the context menu item titles.
  • For all the projects were resx files were added, the Resource class was set to public, and the Assembly neutral language was set to en-us. This is the default resource language that will be included in the dll. All other resources would appear in the file path structure langCode\ProjectName.resources.dll.
  • Removed all language xaml files for launcher projects from the installer.
  • Removed the wox settings xaml files present in some of the Plugin projects. These were used by Wox in their settings, however we do not require them in PowerToys Run.
  • Added LocProject.json for all the projects to enable localization on the pipeline

Pending Work (to be done in a separate PR)

  • Remove unused Wox strings
  • Some strings are still hardcoded and should be added to the resx files.

Validation Steps Performed

How does someone test & validate?

  • Validated that all the plugins run in launcher from VS.
  • Validated that the installer builds and launcher works from the installer.
  • Validated with a dummy Resources.fr.resx for indexer plugin with a few strings modified that the French resources are loaded when the OS language is changed to French.
  • Validate that the resx and lcl files are generated on the CDPX pipeline

@arjunbalgovind arjunbalgovind added Product-PowerToys Run Improved app launch PT Run (Win+R) Window Area-Localization issues regarding to Localization the application labels Aug 25, 2020
@arjunbalgovind arjunbalgovind requested a review from a team August 25, 2020 21:41
Copy link
Contributor

@dsrivastavv dsrivastavv left a comment

Choose a reason for hiding this comment

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

LGTM!

@arjunbalgovind arjunbalgovind merged commit 1b598ad into master Sep 2, 2020
@arjunbalgovind arjunbalgovind deleted the user/arbalgov/localizePTRun branch September 10, 2020 18:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Localization issues regarding to Localization the application Product-PowerToys Run Improved app launch PT Run (Win+R) Window
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants