StrataFrame Forum

Save and Undo toolstrip button localization not working...

http://forum.strataframe.net/Topic23368.aspx

By S. Brandon Keller - 6/5/2009

I would like to make localization entries for all of my application toolstrip buttons on my maintenance forms; originally, I wanted to do so in order to provide keyboard shortcuts for the toolstrip buttons. If there's a more 'native' way to do that, please let me know.



Anyway, in my quest to localize each of the buttons, I discovered that the EditButtonTextKey works perfectly, but the SaveButtonTextKey and the UndoButtonTextKey don't have any effect. I have confirmed that the key values (e.g. 'SaveTool' and 'UndoTool') exist in my localization XML file, and that other changes made to the localization are showing up in the application.



As with my other post, since I'm new to the framework I figure there's a good chance that I'm missing something, though this particular example seems very straightforward. Does anyone have any thoughts?



Thanks!
By Trent L. Taylor - 6/5/2009

If you notice, there are two "Save" and "Undo" properties. Once that accepts a localization key and another that is just a text entry field. First, let me explain that this particular control is already pre-localized in 11 languages. So you could be fighting against that. But I just tested this and it did work when I changed the SaveButtonText. If you are just wanted to say something else other than what is already pre-localized, then that is fine and you can do that, but I thought I would at least give you a heads up.



In an absolute worst case, you can call the Localization.RetrieveTextValue("MyKey") and set the SaveButtonText property in the Load of the form or control (if you are inheriting this class).
By S. Brandon Keller - 6/5/2009

Thanks for the response!



Are you referring to [Save|Undo]ButtonText vs. [Save|Undo]ButtonTextKey? Modifying XButtonText to use the hotkey notation (e.g. setting SaveButtonText to '&Save') works perfectly, but setting [Save|Undo]ButtonTextKey to a valid Localization key has no effect. The same change, made to the EditButtonTextKey, works perfectly. I even tried assigning the same Localization key to all three of the buttons, but only the Edit button will obey the change.



It's not even that I really want to localize to a new language in this case - localization just provides a really convenient way to make sure that all of our Toolstrips provide hotkey access and that the wording is consistent and easy to change through the localization system. Although I could change the XButtonText on each control in every toolstrip in the application, I was hoping that I could set the localization key once for each button in every toolstrip, and then use the localization system to make any changes that the customers desire. With the current problem that I described for Save and Undo, I can't do that.



This seems like a bug to me; do you agree, Trent?
By Trent L. Taylor - 6/6/2009

This seems like a bug to me; do you agree, Trent?

I will try and setup this up and double check.  This is  pretty common thing so I will look into it....so if it is an issue, I am surprised it has not come up until now.