0
votes

I have been trying to localize a WinForms application for a while. I have used the method that I set the form's Localizable property true, changed the Language and changed the control's Text properties.The problem is my app has multiple forms and I don't want to have a resource file for each form, I would like to localize the app with a common,single resource file. Should I merge these resource files or is there an other way to do this? Thanks for any help.

1
I think, you should use a single resx file for all the winforms, and a wrapper class that interact with resx and winforms.Rohit Prakash
It's unclear what you want. And unclear how designer should localize forms (if they are not per-language, then where should it keep different values, to example, for Labels) . But you are always free to implement own localization manager, which will not work with designer . Why multiple resx-files per form are problem? Is your actual problem related to presense of satellite assemblies (multiple folders and dlls inside near exe-file)?Sinatr
Actually, I have a resource file per-language and per form.I want to localize the forms by a single/global resource file, problem is not with the dlls.@Rohit, I follow a way like you mentioned, but I wonder if there is another way.jack sparrow

1 Answers

0
votes

(Note: In the interest of full disclosure, I'm the developer of a 3rd-party localization program for Visual Studio). I've been down this avenue before and while I don't recall the details anymore (I'd have to dig them up again), it's unlikely you really want to do this. It's not trivial so whatever benefits you may derive will likely be outweighed by the drawbacks. It's just much more difficult to implement and maintain your program this way. If you want to do this because it's just easier than dealing with a bunch of ".resx" file for translation purposes (I agree, and MSFT's system for translating ".resx" files is extremely poor IMHO), you're better off using a 3rd-party translation tool (since Visual Studio offers you nothing better). I'm not suggesting that to promote my own product (which does move all strings into a single file for external translation), but because it is legitimately easier to stick with MSFT's native system (regardless of which 3rd-party tool you choose to use).