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

[General]Support language change #34971

Merged
merged 12 commits into from
Sep 25, 2024
Merged

[General]Support language change #34971

merged 12 commits into from
Sep 25, 2024

Conversation

stefansjfw
Copy link
Collaborator

Summary of the Pull Request

PR Checklist

Detailed Description of the Pull Request / Additional comments

Validation Steps Performed

src/common/utils/resources.h Fixed Show fixed Hide fixed
src/common/utils/resources.h Fixed Show fixed Hide fixed
src/common/utils/resources.h Fixed Show fixed Hide fixed
src/common/utils/resources.h Fixed Show fixed Hide fixed
src/common/utils/resources.h Fixed Show fixed Hide fixed
@microsoft microsoft deleted a comment from github-actions bot Sep 19, 2024
@crutkas
Copy link
Member

crutkas commented Sep 19, 2024

🔥🔥🔥🔥🔥🔥

@htcfreek
Copy link
Collaborator

  1. Why do we need a new settings file (json)? Can't we reuse the one containing the utility enabled states?
  2. Do we need an info bar in settings that this not affects any culture settings like date format, time format or currency?

@crutkas
Copy link
Member

crutkas commented Sep 24, 2024

Ooooooo it past CI. Is this ready?

@jaimecbernardo jaimecbernardo added the Needs-Review This Pull Request awaits the review of a maintainer. label Sep 24, 2024
@jaimecbernardo
Copy link
Collaborator

Ooooooo it past CI. Is this ready?

Ready for review :)

@jaimecbernardo jaimecbernardo changed the title [WIP] Support language change [General]Support language change Sep 24, 2024
@stefansjfw
Copy link
Collaborator Author

  1. Why do we need a new settings file (json)? Can't we reuse the one containing the utility enabled states?

To prevent dependency hell. One day we'll refactor Settings.UI.Library and everything will be easier :)

  1. Do we need an info bar in settings that this not affects any culture settings like date format, time format or currency?

I don't think so, it should be clear that it's a language change only. We can easily add it in the future if we see that needs to be clarified

Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

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

check-spelling found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

Copy link
Collaborator

@jaimecbernardo jaimecbernardo left a comment

Choose a reason for hiding this comment

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

Code LGTM! It's working well as well. I do think it needs an optimization for the C++ changes, though. Great work!


inline std::wstring get_resource_string_language_override(UINT resource_id, HINSTANCE instance)
{
std::wstring language = LanguageHelpers::load_language();
Copy link
Collaborator

Choose a reason for hiding this comment

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

If this is supposed to require a PowerToys restart, shouldn't we cache this result somehow? Thinking it's not good to do a file read and json parse on each time we want to get a resource.

Copy link
Member

Choose a reason for hiding this comment

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

should this block on this or can it be addressed in new PR?

@stefansjfw
Copy link
Collaborator Author

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Collaborator

@jaimecbernardo jaimecbernardo left a comment

Choose a reason for hiding this comment

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

LGTM! Everything seems to be working well. Great work!

@@ -58,3 +58,12 @@ $imageResizerContextMenuAppManifestReadFileLocation = $imageResizerContextMenuAp
$imageResizerContextMenuAppManifest.Package.Identity.Version = $versionNumber + '.0'
Write-Host "ImageResizerContextMenu version" $imageResizerContextMenuAppManifest.Package.Identity.Version
$imageResizerContextMenuAppManifest.Save($imageResizerContextMenuAppManifestWriteFileLocation);

# Set FileLocksmithContextMenu package version in AppManifest.xml
$fileLocksmithContextMenuAppManifestWriteFileLocation = $PSScriptRoot + '/../src/modules/FileLocksmith/FileLocksmithContextMenu/AppxManifest.xml';
Copy link
Member

Choose a reason for hiding this comment

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

this seems unrelated to the change described herein - should it be a separate PR?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Whatever regression happened here seems to have been caused by our changes, which is weird.
Anyway, this is something done for the other tier 1 context menus and not this one.
Since it was only bringing issues with this PR, we're just including it here.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Basically, when testing this PR and tried to change the language, File Locksmith wouldn't appear in Windows 11 Tier 1 context menu, while still appearing on main. That's why we understood that we were missing those instructions. Makes sense @DHowett ? 😄

@jaimecbernardo jaimecbernardo merged commit 5b616c9 into main Sep 25, 2024
22 of 25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
In for .85 Needs-Review This Pull Request awaits the review of a maintainer.
Projects
Development

Successfully merging this pull request may close these issues.

5 participants