I have a WinForms application with base language English. I localized a form to German. Some words in German are way longer than their English equivalents so I needed to move some controls around on the German version of the form. The problem is when I move the English controls the German localization doesn’t reflect the movement (obviously).
However some controls were mistakenly moved and I’d like to reset them, so their movements on the English form are reflected on the German form as well.
How can I reset the position and size (or all properties) of a single control on the German form so that the control will move on both language versions of the form when moved on the English form? Is there a way other than digging into the localized .resx file and deleting all property assignments of a control?
I’m the author of a localization product for Visual Studio developers (in the interest of full disclosure). Any property you delete from the localized “.resx” file, either in the Visual Studio forms designer or manually in the “.resx” file itself, will then cause the control to defer to the default language’s value of that property again. There’s no specific feature that handles this however. You need to do it yourself on a control-by-control basis. Note however that Visual Studio is flaky sometimes, and has various bugs, for this and other issues, so things don’t always work even when you do remove them using the designer (last time I reviewed the situation). Unless it’s been fixed by now (I doubt it), if you set the “Location” property of a German control back to the default language’s “Location” property for instance (in the designer), VS should remove the “Location” property from the “.de.resx” file. And it does – sometimes. Other times it doesn’t (go figure) and you need to manually remove it yourself. Once it’s gone though, the “fallback” process ensures that the default language property will then be used again (so moving the control on the English version in your case will move it on the German version, since both are then relying the same property again – the one from the English “.resx” file).