-
Notifications
You must be signed in to change notification settings - Fork 634
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
use invariant culture to parse inputs to converters - #10006
use invariant culture to parse inputs to converters - #10006
Conversation
we were passing the culture before but this was usually set to en-us EVEN in localized enviornments unless something set it explicitly wrap with try catch and return some default conversion
src/DynamoCoreWpf/UI/Converters.cs
Outdated
@@ -1414,15 +1414,29 @@ public object ConvertBack(object value, Type targetType, object parameter, Syste | |||
} | |||
} | |||
|
|||
//TODO remove(this is not used anywhere) |
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.
Can you add Dynamo 3.0? Will be easier to identify when the time comes :)
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.
LGTM with some comments
@@ -1414,15 +1414,29 @@ public object ConvertBack(object value, Type targetType, object parameter, Syste | |||
} | |||
} | |||
|
|||
//TODO remove(this is not used anywhere) in Dynamo 3.0 |
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.
@saintentropy this is the converter I was talking about .... is this the one you were thinking of? I can't find this particular one used anywhere.
* use invariant culture to parse inputs - we were passing the culture before but this was usually set to en-us EVEN in localized enviornments unless something set it explicitly wrap with try catch and return some default conversion * Update src/DynamoCoreWpf/UI/Converters.cs * Update src/DynamoCoreWpf/UI/Converters.cs (cherry picked from commit 3dc4202)
* use invariant culture to parse inputs - we were passing the culture before but this was usually set to en-us EVEN in localized enviornments unless something set it explicitly wrap with try catch and return some default conversion * Update src/DynamoCoreWpf/UI/Converters.cs * Update src/DynamoCoreWpf/UI/Converters.cs (cherry picked from commit 3dc4202)
* use invariant culture to parse inputs to converters - (#10006) * use invariant culture to parse inputs - we were passing the culture before but this was usually set to en-us EVEN in localized enviornments unless something set it explicitly wrap with try catch and return some default conversion * Update src/DynamoCoreWpf/UI/Converters.cs * Update src/DynamoCoreWpf/UI/Converters.cs (cherry picked from commit 3dc4202) * merge conflicts
we were passing the culture before but this was usually set to en-us EVEN in localized environments
unless something set it explicitly
wrap with try catch and return some default conversion
Purpose
This one has a bit of a history.
issue from user:
#6261
fix:
#6724
fix:
#9994
When this was fixed originally by @sm6srw it appears that unlike what it implies in his PR - unintentionally the culture might have always been set to
en-us
as @angelowang points out WPF passes en-us culture to the converters EVEN if the environment is localized. (I tried both localizing dynamo and localizing windows and got en-us everytime!)SO - this means that the original fix three years ago, was close, but in certain situations it lets the host change the culture - we don't want that.
Our strings are hardcoded in en-us format in our xaml, and I think that is okay, these converters are not really for public consumption. SO this pr does the following.
I've added similar logic to two other converters that @sm6srw added culture to. It appears to me the only time strings are used on these converters is from hardcoded xaml values, or the tests.
I still need to run the self serve tests.
Declarations
Check these if you believe they are true
*.resx
filesReviewers
@QilongTang
@sm6srw
FYIs
@angelowang