Reinventing The Wheel, this time it’s a localization framework

If you look at the SWiki Roadmap, you will see that translated versions are planned for Version 0.12, which is incidentially the next version of SWiki. SWiki is intended to be just a bit outside of my reach, so that I can learn and grow from it. As I have no experience with creating a localized WinForms application, that allows me to learn how to do it 🙂

Unfortunately, Localization support in Visual Studio 2008 left me somewhat unimpressed. So I set the "Localizable" property of my Form to true and then automagically it creates the resources I need and allows me to change any form settings, including Text, Position, Size etc. That is so far a great idea and works very well, but it has several drawbacks:

  • One resx file per form and language means exponential growth of files
  • The resx files are tied to the form - which means I cannot just put them in a "Localized" Folder
  • While it's great that Forms are supported, I still have to find another way for my Exceptions and other Non-Form Code
  • Translations are stored in satellite assemblies. The Goal of SWiki is to have as few files as possible, preferably only one.
  • No way to share strings between different parts

In short: The built in support is unsuitable for SWiki. I have put my requirements in a StackOverflow question, but the answers were somewhat discouraging. I have looked around a bit and naturally also ended up at GNU Gettext which handles strings, but does not solve the problem of a) non-string content (Images, Location/Sizes of Controls) and b) the actual application of resources to the target.

One of the main issues is that the InitializeComponent() function is somewhat untouchable, as the designer will break if you change it too much and will replace your code with it's own anyway. Visual Studio is certainly not lying when it tells you to not mess with the function.

So anyway, I have just decided to build my own localization framework for use with the SWiki UI. Finding a name was reasonably easy, I just called it "The Wheel". I don't know if it's going to be much use, but just in case, it's going to be licensed under Microsoft Reciprocal License (Ms-RL). Release Date? I don't know, I hope by the end of the week.

Comments (1)

[...] due to the fact that I’m not satisfied with the built-in features of Visual Studio I’m rolling my own framework now. This will however take a little [...]