.NET Forum / Visual Studio.NET / IDE / March 2008
Changing the name of a control does not refactor the .es.resx reso
|
|
Thread rating:  |
Allan Michaels - 28 Feb 2008 20:36 GMT Hello,
I had a groupbox named 'groupbox1' on a System.Windows.Forms.UserControl called 'usercontrol1'. 'groupbox1' had a Text property which was stored in 'usercontrol1.resx' as 'groupbox1.text'. 'usercontrol1' also has a 'usercontrol1.es.resx' file containing the translated text for 'groupbox1.text'.
In Visual Studio 2005, I displayed 'usercontrol1', selected 'groupbox1', and in the properties pane I changed the name of the groupbox to 'gbLabel'. Refactoring began and all instances of 'groupbox1' in the 'usercontrol1.cs' file were changed to 'gbLabel'. 'groupbox1' properties in the .resx file also were renamed appropriately to 'gbLabel.Text'.
But the .es.resx file still had properties named 'groupbox1.text'.
Refactoring did not extend to the translated .resx files.
What is going on here? Feature? Bug? User Error? User misunderstanding? Fluke of nature?
Thank you in advance for your assistance.
 Signature Allan Michaels Ann Arbor, MI
Wen Yuan Wang [MSFT] - 29 Feb 2008 09:07 GMT Hello Allan,
According to your description, your issue is that changing the name of control doesn't refract the ".es.resx" resource file, but it refracts the default ".resx" file. If I misunderstood anything here, please correct me.
This isn't a correct behavior. On VS 2005, if user control has been set as "Localizable", the changing should refract your ".es.resx" file, rather than ".resx" file. It should do nothing with default ".resx" file. Does this issue occur on all your user controls? Have you tried with a new project? If this issue only occurs on your current project, I'd like to investigate on it if you could send it to me. My email address is v-wywang@microsoft.com.
By the way, have you installed VS 2005 sp1? You can get it from http://www.microsoft.com/downloads/details.aspx?displaylang=zh-cn&familyid=b b4a75ab-e2d4-4c96-b39d-37baf6b5b1dc [Microsoft? Visual Studio? 2005 Team Suite Service Pack 1]
Hope this helps. Let me know if you have any more concern. We are glad to assist you. Have a great day, Best regards,
Wen Yuan Microsoft Online Community Support ====================================== This posting is provided "AS IS" with no warranties, and confers no rights.
Allan Michaels - 04 Mar 2008 16:19 GMT Thanks for the reply, Wen.
I have reproduced this in a simple application.
Simply said, create a New Windows Application and on the resulting Form1 put a groupbox2 inside of a groupbox1. Then change the Name property of groupbox2. The associated .es.resx file entry does not change its name.
Changing the Name property of groupbox1 DOES correctly refactor the .es.resx file. It seems to be the groupbox within a groupbox that has this problem.
If you need more specifics, I can send step by step instructions to reproduce the situation.
Thanks for the assistance.
Wen Yuan Wang [MSFT] - 05 Mar 2008 10:10 GMT Hello Allan,
Thanks for your reply. I reproduced it. VS IDE only writes the difference from default resx file into localized ex.resx files. I'm afraid this is because changing the control name in localized mode makes some confuse to VS IDE.
I'm not sure why you managed to change the groupbox name in localized mode. The correct way to change control id is in Default Language. The localized resource file should only contain information about the culture (such as text). It's not appropriate way to rename control.
Please set the language back to "Default", before you want to rename groupbox. Then, you can reset the language to "Spanish", make changes on the text property of groupbox. This is the recommend way.
Hope this helps. Please feel free to let me know, if there is anything unclear. We are glad to assist you.
Have a great day, Best regards,
Wen Yuan Microsoft Online Community Support ================================================== This posting is provided "AS IS" with no warranties, and confers no rights.
Allan Michaels - 05 Mar 2008 15:59 GMT Hello Wen,
I think there is a miscommunication. The Language property of Form1 is set to (default) when I change the Name property of groupbox2.
1. Create new C# windows application which by default has a Form1. 2. Change the Localizable property of Form1 to true. 3. Add groupbox1 to the Form1. 4. Add groupbox2 inside of groupbox1. 5. Build the solution. 6. Change the Language property of Form1 to Spanish. 7. Change the Text property of groupbox1 to 'groupbox1-es'. 8. Change the Text property of groupbox2 to 'groupbox2-es'. 9. Change the Language property of Form1 to (default). 10. Build the solution. 11. Change the Name property of groupbox1 to 'groupbox1renamed'. 12. Change the Name property of groupbox2 to 'groupbox2renamed'. 13. Build the solution. 14. Open the Form1.resx file in the VS Resource Editor and observe the Name column entries of 'groupBox1renamed.Text' and 'groupBox2renamed.Text'. 15. Open the Form1.es.resx file in the VS Resource Editior and observe the Name column entries of 'groupBox1.Text' and 'groupBox2.Text'.
I believe that refactoring should have changed the Form1.es.resx file.
(Note: the above steps demonstrate both groupboxes as not refactoring correctly. This is a bit different than my previous posts where I reproduced groupbox2 not refactoring, but groupbox1 refactoring correctly. This gives me hope that there is a way for these groupBoxes' Name properties to be refactored correctly.)
Thanks Wen.
 Signature Allan Michaels Ann Arbor, MI
Wen Yuan Wang [MSFT] - 06 Mar 2008 03:44 GMT Hello Allan, Thanks for your reply.
I misunderstood you renamed control in Spanish before. But, now I think your issue is that renaming control in Default Language Mode doesn't take effect in Localized Language Resource file. I have reproduced it by your steps on my side. thanks.
Under my research, I'm afraid this is by designed. In Localized Mode, VS IDE only saves the changes into current Language resource file. Thereby, if you make some changes in Groupbox in default language mode, this information will only be insert into default resource file. These changes won't be inserted into other localized language files. I agree with you, it seems VS should have to do this, but it doesn't. By designed, VS doesn't check other language files. Thus other language file won't know the groupbox name has been renamed... Please understand VS isn't enough smart in such scenario. You have to drill into each localized language resource file, and modify the control name (GroupBox1) to (GroupBox1Rename) manual...
By the way, If you really have concern on this, you can also submit a feedback to our Connect feedback portal. Our developer will evaluate them seriously and communicate with you directly on the issue there. http://connect.microsoft.com/VisualStudio/ Improving the quality of our products and services is a never ending.
Thanks again for your understanding. Best regards, Wen Yuan Microsoft Online Community Support ================================================== This posting is provided "AS IS" with no warranties, and confers no rights.
Allan Michaels - 06 Mar 2008 15:10 GMT Thanks, Wen.
I do recommend MS fix this. At the moment, I only have a Spanish and English to maintain. But French, German, Japanese, and Chinese are potentially on the horizon.
You can see that the work multiplies dramatically as the languages increase. Plus, VS gives no indication that it DID NOT do the expected work, leaving developers with the impression that all is OK, when really they have (temporarily) 'lost' their translations.
Perhaps I will pursue it further at the connect.microsoft.com site you mentioned.
 Signature Allan Michaels Ann Arbor, MI
Wen Yuan Wang [MSFT] - 07 Mar 2008 04:57 GMT Hello Allan, Thanks for your reply.
This behavior is really confused. I will log it in our DB for product team to investigate. By the way, if you need communicate with product team members on the issue, you can also post it on our connect.microsoft.com site. Maybe they can add a warning message in the next version. Improving the quality of our products and services is a never ending process for Microsoft.
Thanks again for your feedback. Let me know if you have any more concern. It's my pleasure to assist you. Have a great day, Best regards,
Wen Yuan Delighting our customers is our #1 priority. We welcome your comments and suggestions about how we can improve the support we provide to you. Please feel free to let my manager know what you think of the level of service provided. You can send feedback directly to my manager at: msdnmg@microsoft.com. ================================================= This posting is provided "AS IS" with no warranties, and confers no rights.
Free MagazinesGet these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...
|
|
|