-
Notifications
You must be signed in to change notification settings - Fork 492
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
BUG: Fix ctkLanguageComboBox normalizing default language and selection #1179
base: master
Are you sure you want to change the base?
Conversation
This change ensures the fix integrated through commontk/CTK#1179 (BUG: Fix ctkLanguageComboBox normalizing default language and selection) is effective.
7af2ae7
to
a7385c9
Compare
Could this have the unintended side effect that if the widget is used in the application settings then it writes in some language automatically (as if the user actively selected it)? That would not be nice, because we could not distinguish if the user selected English explicitly (in this case we should use English) or the user simply did not select a language (in this case we may decide in the future to use for example the operating system's language). |
a7385c9
to
9b849cf
Compare
Discovered during the resolution of issues in `ctkLanguageComboBoxTest`, this commit addresses a bug in the normalization and selection of the default language in `ctkLanguageComboBox`. It introduces the function `normalizeLocaleCode` to ensure that the default locale code is set to its normalized value if valid. Furthermore, the `updateLanguageItems()` function is updated to select the default locale code if the user has not already made a selection. Co-authored-by: Andras Lasso <[email protected]>
4cb0268
to
9e7f262
Compare
It seems the language combobox is trying to be both a manager and language selector, moving forward we should probably look into introducing an object for dealing with the scanning of a directory, dealing with default vs explicitly selected ... This should probably be done in future improvements. With this fix, the test now pass and the behavior reported in Slicer/SlicerLanguagePacks#57 is fixed. |
Discovered during the resolution of issues in
ctkLanguageComboBoxTest
, this commit addresses a bug in the normalization and selection of the default language inctkLanguageComboBox
.It introduces the function
normalizeLocaleCode
to ensure that the default locale code is set to its normalized value if valid.Furthermore, the
updateLanguageItems()
function is updated to select the default locale code if the user has not already made a selection.