[PTRun][UnitConverter] Use invariant casing for degree unit tokens - #50414
Open
cui fliter (cuishuang) wants to merge 1 commit into
Open
[PTRun][UnitConverter] Use invariant casing for degree unit tokens#50414cui fliter (cuishuang) wants to merge 1 commit into
cui fliter (cuishuang) wants to merge 1 commit into
Conversation
Signed-off-by: cuishuang <imcusg@gmail.com>
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
🧭 PR intakeVisual evidence: Not needed — The changed files do not indicate a visible UI change. No visual evidence is expected. Recommendation
✅ Ready for reviewThis PR passed the automated intake checks and is ready for maintainer review. Automated PR intake; PowerToys maintainers make final decisions. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of the Pull Request
Fixes culture-sensitive parsing of
CELSIUSandFAHRENHEITin the PowerToys Run Unit Converter.DegreePrefixer()was usingToLower(CultureInfo.CurrentCulture)for fixed English unit tokens. Intr-TR, uppercaseIis lowercased to the dotlessı, causing inputs such asCELSIUSandFAHRENHEITto miss their expected branches.The implementation now uses
ToLowerInvariant()for both unit tokens.PR Checklist
Detailed Description of the Pull Request / Additional comments
Updated
DegreePrefixer()so internal English unit tokens are normalized independently of the user's current culture.Added
PrefixesDegreesWithTurkishCulture, which setsCultureInfo.CurrentCulturetotr-TRand verifies that:CELSIUSbecomesDegreeCelsiusFAHRENHEITbecomesDegreeFahrenheitThe test restores the original culture in a
finallyblock.Validation Steps Performed
git diff --checkpassed.celsıusandfahrenheıt.tr-TR.