-
Notifications
You must be signed in to change notification settings - Fork 51
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
ComboBox.GetAllItems fails on non-English Windows OS #31
Comments
Can you please provide a patch, will pull the changes in. Thanks reporting this issue, I was not aware of it. |
Never done this before. Here's your patch. Hope it worked! 0001-Removing-hard-coded-English-strings-in-ComboBox-so-i.zip |
@brian-mcmaster ok, I try to apply this patch and rebuild msi package. But I need some test case example for validate result. And for the future, use the pull-requests for sending patches;) |
Sorry, I don't know git at all. I'll research pull requests next time. To test it, you need to install a non-English OS. Note that you need to translate the strings to whatever language you're testing... but you get the idea.
Results: you get an empty list on Spanish OS It fails because the "Open" button's caption is not "Open," so it can't drop down the list. Once you fix that, it fails because the item types it's looking for are "list-item", but that is also localized. |
@brian-mcmaster thank you for detailed test case! After testing I will make pull request to upstream. Stay tuned! |
@brian-mcmaster can you please test this build, they include patch from you. I was run test using scenario that you given me in previous comment, but I still got empty list (tested on Windows 7, russian locale, "File type" combobox in "Save as" dialog in mspaint):
You can look at changes, that applyed to this build in this commit. Maybe I forget something? |
@rrzaripov I spent literally a half day trying to get Windows Update to install the Russian Language pack on my Win7 developer machine, and it failed. I have been unable to reproduce your issue. However, I have since fixed a nullref exception in that code, as well. Some comboboxes don't have an open button at all, so I added a null check on elementItem before logging its contents. If I find a machine with the Russian lang pack on it, i'll let you know :( |
@brian-mcmaster thank for your work. Russian locale are not required to make test. Can you please make this test, step by step:
Result is empty list or not? |
@rrzaripov I tried and your installer failed. Why is it over 800k when my installer is only 630k? It said "the setup ended prematurely and your system was not modified". Edit: it looks like my ldtpjarfile is 0 bytes in my setups which accounts for the difference in size, I think. I still don't know why your installer doesn't work... |
Also, as I mentioned above, you should add a check for elementItem == null on line 169, because some comboboxes don't have any buttons as a direct child and the logging statement will throw a nullref exception in those cases. |
If you just want to send me your ldtpd.dll, I can plug it in to my build and see what happens. |
Specifically, because it hard-codes English strings when looking for sub-controls and control types, such as "Open" and "list_item". These captions are localized on other OS's... i.e. on Spanish these captions are "Abrir" and "elemento de listo," respectively. Here is the diff of how I fixed it. Replaced "Open" with "*" since there should only be one button-type control as a child of a combobox. Also replaced "list_item" with the ControlType.ListItem property. I had to add the element's control type to the propertyHT in Utils.cs at the bottom.
This is just the first issue I encountered running one of our tests in localized OS. I imagine there are many other hard-coded strings in LDTP.
==== cobra-master\Ldtpd\Combobox.cs ====
168c168,169
< elementItem = utils.GetObjectHandle(childHandle, "Open", type, true);
The text was updated successfully, but these errors were encountered: