-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Add support for Pyeong, a Korean floorspace unit. #444
Add support for Pyeong, a Korean floorspace unit. #444
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job!!
Can you also modify UnitConverter::RestoreUserPreference
so it will ignore an optional unit if not available for the current culture? (In case a user selects an optional unit, close the app, select a region not supporting this unit, and open the app again)
Thanks @rudyhuyn ! So I've been reading through how Calculator preferences work, and I noticed 1 bug and 1 possible improvement. But before I go into them, I would like to note that So in case a user choose Pyeong, closes Calculator, changes the current region to non-Korea (e..g US), and starts up Calculator, the app won't attempt to load Pyeong. In fact, at the moment, the app will fall back to the default conversion values ( it looks like that may not be intended behaviour though - I think the current intended behaviour, at least from the code, was to show no unit ( Circling back to the bug & improvement I mentioned earlier, here are what I found. Bug 1: saving user preference doesn't seem to work correctly.Specifically,
Possible improvement 1: Instead of showing no unit, we should display a default value (or the first available value if any) if we fail to find units that we saved from last session.So this behaviour where we don't show any unit probably never really got observed in real life because of Bug 1. I made a little tweak, and the below is what is looks like if we actually defaulted to I am not sure if the above was a product decision though ( hence I labeled it as a possible improvement instead of a bug ). @grochocki What are your opinions on the above mentioned bug & possible improvement? Cheers! |
Hmm, I tried 3 times already with an hour or so interval, but |
<data name="UnitName_Pyeong" xml:space="preserve"> | ||
<value>평</value> | ||
<comment>A measurement unit for area.</comment> | ||
</data> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, our Localizaton system is not yet able to directly accept localization changes directly through this repo, so we should only add the english resource.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gotcha. I removed translations for Korean :)
We do not expect users to change region often, so resetting to the defaults is fine.
Good catch! There is not anything tracking this, so lets create a new issue and handle that separately from this PR. IRT CLA agreement issues, I would maybe try again and see if it was just a temporary issue. Otherwise, @HowardWolosky, do you have any ideas? |
Luckily (or unfortunately) Any future PR (to fix the restoration or any changes on |
@grochocki |
@rudyhuyn I addressed your comment regarding not restoring from saved units if they are not valid with the current available units! |
@grochocki I haven't created one for replacing Cheers! |
The change is great!
It should be fine, if |
Thanks, @rudyhuyn ! So to confirm my understanding of what you said, an issue where no unit is selected should not occur after fixing user preferences issue because of the below flow?
|
I'm AFK, but in my memory |
btw, is there a further action I need to take for review? 😄 |
Hi, @danbelcher-MSFT Thanks for your reviews! :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, Seulgi!
Fixes microsoft#382 Description of the changes: Add Pyeong as an Area conversion unit. Pyeong shows up only if the user's current region is Korea ( i.e. region is either KP or KR ). Added Korean translation for Pyeong (평). For other locales, we default to English ( Pyeong ). How changes were validated: Manually tested the below For non-Korean regions, Pyeong does not show up. Korean region with Korean locale => Pyeong shows up and Pyeong is correctly translated. pyeong_Korean Korean region with English locale => Pyeong shows up and Pyeong is in English. pyeong_English Korean region with simplified Chinese locale => Pyeong shows up and Pyeong is in English. pyeong_Chinese
Fixes #382
Description of the changes:
KP
orKR
).How changes were validated:
Manually tested the below
For non-Korean regions, Pyeong does not show up.
Korean region with Korean locale => Pyeong shows up and Pyeong is correctly translated.
Korean region with English locale => Pyeong shows up and Pyeong is in English.
Korean region with simplified Chinese locale => Pyeong shows up and Pyeong is in English.