Answered by:
Windows Forms localization by 3rd parties

Question
-
I am using the Windows Forms designer to localize forms. The Localizable property is set to true and language is set to the language I want to create resources for. Then the appropriate resx file is created containing localized text + position and size of controls.
Everything works fine. Now here is the problem...
To actually create the localized version of the forms we need to engage 3rd parties with the appropriate foreign language experience. However we do not want to send them source code. I am struggling with how to do this.
Perhaps I could re-organize all the forms into separate DLLs but this is not good enough. The form itself sometimes contains a lot of logic in event handlers and so on.
Any ideas on how to package the Winforms resources so they don't contain source code and thus can be shipped to 3rd parties for translation?
Regards,
Bob Rundle
Bob Rundle
Wednesday, June 18, 2014 9:16 PM
Answers
-
Hi Bob,
If these are managed WinForms then you can in fact change the size and location using my product (see the "Form View" feature). I don't recall seeing any other product that supported this feature the last time I checked (admittedly sometime ago). What other products sometimes support is the ability to view your translated forms, but not actually change the size and location of its controls in a designer setting (unlike my own product). However, don't get too excited just yet. Creating forms in a design-time environment outside of VS is non-trivial since MSFT never really designed things for it. For instance, form-based ".resx" files don't always contain all the info req'd to perfectly create a form. MSFT doesn't always populate this file with all the necessary info for some controls and even their own crude "WinRes.exe" utility (therefore) can't handle it. It's simply not possible without turning to other techniques. Even then it's still not trivial however and I had a very tough time getting the "Form View" feature to work as it is (even after consulting with some members of the WinForms team a MSFT). There's also the matter of 3rd-party controls (including your own perhaps). whose assemblies won't likely be installed on a translator's machine. Even if installed, some 3rd-party controls don't always follow certain MSFT protocols so it often makes it very difficult to create them. I could go on about the difficulties but for the most part my product does a very good job, all things considered. It often creates a form perfectly (or near perfectly), depending on various factors. I would recommend trying it to see how it handles your own forms. Feel free to send any questions.
Note BTW that you may want to investigate the "TableLayoutPanel" control for future forms (since refactoring your existing forms wouldn't be easy). This control is even recommended by MSFT (for localization), since it automatically shifts all controls around to accommodate different sized strings (so it's perfect for localization). It takes some solid practice to completely get your head around it though, and the impact of certain other form-based properties on its behavior, so it can be frustrating. Also note that you may want to consider *not* localizing the "Control.Size" and "Control.Location" properties of your translated forms, but simply allow them to rely on these properties from the default language form. The default language values of these properties would therefore have to be adjusted to accommodate all strings regardless of size (so controls don't bump into each other, etc.), but it's arguably much easier and less error-prone to handle things this way (opposed to juggling these properties for every form in every language). It will take some effort of course.
Lastly, note that my product has much to offer in spite of the imperfect situation with forms (which all products I've seen have issues with), but I say this with my developer's hat on, and not merely because I'm trying to make a sale (I don't work that way). It objectively makes the job orders of magnitudes easier and safer. It also has certain critical features which are completely absent in other products (again, last time I looked). This actually came as a surprise when I first investigated other products, since these are must-have features for developers. For instance, after sending your strings out for translation, if you make any further changes to your strings in your solution (while they're out being translated), these will be detected when the translated strings are returned. In any event, my product would be the tool of choice for me personally even if I wasn't the author (and it's also very stable). For whatever shortcomings it has, it does an excellent job overall for Visual Studio developers. A lot of my customers agree (I've received a lot of feedback) and some have even abandoned some large and well-known products in favor of it. You need to be the judge yourself of course but give it a try. You may be pleasantly surprised. If you want to contact me further with product specific questions however, this obviously isn't the right forum so feel free to contact me at support@hexadigm.com. For any other questions however (unrelated to my product), you might want to continue to post them here if it will benefit others. Good luck!
Larry (25+ years on MSFT platforms, mostly in C/C++)
- Edited by Hexadigm Systems Friday, June 20, 2014 12:55 AM Trivial changes only
- Marked as answer by Bob Rundle Friday, June 20, 2014 9:46 PM
Friday, June 20, 2014 12:40 AM
All replies
-
Hi,
We may don't need to share the source code with them, since we could create a resource file for English localization.
How to: Create a Localized Version of a Resource File
And we could just share that resource file with them, and they could just deal with the contents of data tags to get them translated.
Regards.
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click HERE to participate the survey.Thursday, June 19, 2014 6:36 AM -
You can just send them your ".resx" files only. Source code is unnecessary since all localized resources (strings, etc.) are in the ".resx" files themselves (when you set the "Localizable" property). A professional translator should know how to handle these. Note (in the interest of full disclosure) that I'm also the author of a 3rd-party localization program for Visual Studio developers (VS add-in and external translator's program). You may wish to review my product since it makes the job of sending your strings to an external translator far safer and easier (with lots of bells and whistles including the detection of changed strings in your solution). See http://www.hexadigm.com but please note that I stand to profit from it (again, in the interest of full disclosure).
Larry (25+ years on MSFT platforms, mostly in C/C++)
- Edited by Hexadigm Systems Thursday, June 19, 2014 1:44 PM
- Proposed as answer by Carl Cai Thursday, June 19, 2014 1:57 PM
Thursday, June 19, 2014 1:40 PM -
Yes, I am doing that also for embedded text in the application. However this localized text is for forms.
So the designer creates a localized resx files for me, for example MyForm.zh-CN.resx. The resx file contains not only the localized text but the size of position of the control on the form.
Bob Rundle
Thursday, June 19, 2014 7:53 PM -
Hi Larry,
I looked at hexadigm.com with interest. We are indeed looking for a tool to help us with localization. What I like about your tool is that you support unmanaged code. I will have your tool evaluated along with the other tools that we are currently looking at. Resharper seems to be the best so far, however it is managed code only and does not help with the problem I have described above.
Indeed I could simply send the resx file for the form to the 3rd party but this is simply not a complete solution. For example if I look at the resx file for one of my forms I see the following Name/Value pair:
m_labelDim1.Text = "Dim 1:"
Quite likely this will be interpreted as a dimness setting 1 on a lighting control when in fact the label is an abbreviation of Dimension 1.
The point is that you cannot properly translate the text without a proper context. The proper context is given by the form designer which provides an organizing principle for the text. A second problem is that the resx file contains the dimensions of the text which must be adjusted for each language as the length of the strings in each language is different.
So if we simply send the resx files away for translations then there will be additional work when they come back to position the text properly on the forms. Then after integrating these new files, each form will have to be checked again to insure that no text has been translated out of context. This approach is unworkable in my view.
What we have to do...as we have literally a 1000 forms to be translated...is to write a tool that converts the designer code + resx file into some kind of form description language that can be loaded in a standalone editor. Once edited the description language can be converted back to the designer code + resx files.
This is really more work than I want to do, so I was hoping that someone made a tool to do this. So far I haven't found one.
Regards,
Bob Rundle
Bob Rundle
Thursday, June 19, 2014 8:17 PM -
Hi Bob,
If these are managed WinForms then you can in fact change the size and location using my product (see the "Form View" feature). I don't recall seeing any other product that supported this feature the last time I checked (admittedly sometime ago). What other products sometimes support is the ability to view your translated forms, but not actually change the size and location of its controls in a designer setting (unlike my own product). However, don't get too excited just yet. Creating forms in a design-time environment outside of VS is non-trivial since MSFT never really designed things for it. For instance, form-based ".resx" files don't always contain all the info req'd to perfectly create a form. MSFT doesn't always populate this file with all the necessary info for some controls and even their own crude "WinRes.exe" utility (therefore) can't handle it. It's simply not possible without turning to other techniques. Even then it's still not trivial however and I had a very tough time getting the "Form View" feature to work as it is (even after consulting with some members of the WinForms team a MSFT). There's also the matter of 3rd-party controls (including your own perhaps). whose assemblies won't likely be installed on a translator's machine. Even if installed, some 3rd-party controls don't always follow certain MSFT protocols so it often makes it very difficult to create them. I could go on about the difficulties but for the most part my product does a very good job, all things considered. It often creates a form perfectly (or near perfectly), depending on various factors. I would recommend trying it to see how it handles your own forms. Feel free to send any questions.
Note BTW that you may want to investigate the "TableLayoutPanel" control for future forms (since refactoring your existing forms wouldn't be easy). This control is even recommended by MSFT (for localization), since it automatically shifts all controls around to accommodate different sized strings (so it's perfect for localization). It takes some solid practice to completely get your head around it though, and the impact of certain other form-based properties on its behavior, so it can be frustrating. Also note that you may want to consider *not* localizing the "Control.Size" and "Control.Location" properties of your translated forms, but simply allow them to rely on these properties from the default language form. The default language values of these properties would therefore have to be adjusted to accommodate all strings regardless of size (so controls don't bump into each other, etc.), but it's arguably much easier and less error-prone to handle things this way (opposed to juggling these properties for every form in every language). It will take some effort of course.
Lastly, note that my product has much to offer in spite of the imperfect situation with forms (which all products I've seen have issues with), but I say this with my developer's hat on, and not merely because I'm trying to make a sale (I don't work that way). It objectively makes the job orders of magnitudes easier and safer. It also has certain critical features which are completely absent in other products (again, last time I looked). This actually came as a surprise when I first investigated other products, since these are must-have features for developers. For instance, after sending your strings out for translation, if you make any further changes to your strings in your solution (while they're out being translated), these will be detected when the translated strings are returned. In any event, my product would be the tool of choice for me personally even if I wasn't the author (and it's also very stable). For whatever shortcomings it has, it does an excellent job overall for Visual Studio developers. A lot of my customers agree (I've received a lot of feedback) and some have even abandoned some large and well-known products in favor of it. You need to be the judge yourself of course but give it a try. You may be pleasantly surprised. If you want to contact me further with product specific questions however, this obviously isn't the right forum so feel free to contact me at support@hexadigm.com. For any other questions however (unrelated to my product), you might want to continue to post them here if it will benefit others. Good luck!
Larry (25+ years on MSFT platforms, mostly in C/C++)
- Edited by Hexadigm Systems Friday, June 20, 2014 12:55 AM Trivial changes only
- Marked as answer by Bob Rundle Friday, June 20, 2014 9:46 PM
Friday, June 20, 2014 12:40 AM -
Thanks Larry. We'll investigate the Form View...it really is just what we are looking for. I understand that it won't work in every case...most cases will be good enough. And yes if we were starting development in WinForms today we would use TableLayoutPanel...but there is simply too much legacy to deal with. Regards, Bob Rundle
Bob Rundle
Friday, June 20, 2014 9:45 PM -
Ok, hope your translation goes well regardless of the tools you use.
Regards,
Larry
Larry (25+ years on MSFT platforms, mostly in C/C++)
Saturday, June 21, 2014 4:05 PM