Loading...
 
Multi-Language Add-In for Visual Studio

Multi-Language Add-In for Visual Studio


Multilanguage Tool for Windows CE Forms

We're evalutating the Mulitlanguage tool for Vs2005 .Net applications and are really happy with itbiggrin.

Now we also have an embedded terminal that runs Windows CE with a form application. This is already implemented with several langugages and is able to change the language on the fly. But the handling of the strings is realy tedious...

therefore i've tried to use the multilanguage tool, but I didn't get it to workcry...
If I choose "native runtime support" the window for "Support for Runtime lang switching" is shown instead...

Doesn't the add-in support windows CE?

Thanks
Christof

Germany

Hello Christof,

It certainly ought to work with Windows CE. I will test it later today.

Phil


Germany

Hi Christof,

I've just uploaded a new version (4.52.0005) with some minor fixes, but I don't know if any of these will fix your problem. Nevertheless, I'll start by describing these changes:

  • The Add-In no longer automatically selects Alternative runtime support for Smart Device projects. This was a hangover from Visual Studio 2003, but I'll come back to this in a minute.
  • A bug fix in the template file MlString.vb (in the version for smart device projects). If you are using VB.NET, you will need this.
  • A new template file for the language selection form, this time for C#.


Now a little background information. With Visual Studio 2003, there wasn't much support for localization with Smart Device projects. In particular, Forms and UserControls did not have a Localizable property. I originally implemented the alternative runtime support especially for Smart Device projects, because no other method was available.

With Visual Studio 2005, Smart Device projects support more or less the same localization features as Windows Forms projects. This means that you can set the Localizable property to True and the form designer will generate code to initialise properties from resource files.

That sounds good, but there is still one big problem. The Thread object does not support the CurrentUICulture property. For a Windows Forms project, you can modify the current language by setting the property System.Threading.Thread.CurrentThread.CurrentUICulture, but this is not possible under Windows CE.

As far as I understand, this means that Visual Studio's built in localization will work, but you can't actually change the language. I guess the language is fixed when the operating system is configured, i.e. a French version of Windows CE would use the French resources, but I'm not entirely sure.

If you want to switch the language on the fly, then as I see it, the only option is to use the alternative runtime support. You would now have to select this option in the project settings dialog (since it is no longer the default).

You said, that if you select "native runtime support", then the window "Support for Runtime Language Switching" is shown. That would be a real error, but I can't reproduce it and I think you must be mistaken on two counts. Firstly, I think that you must mean when "alternative runtime support" is selected. Secondly, the two dialogs for "alternative runtime support" and "runtime language switching" look very similar and you could easily mistake one for the other.

In fact these two features are technically very similar. In both cases, a function ml_UpdateControls() is added to each Form and UserControl and used to initialise the properties of the controls. For the alternative runtime support it is called after InitializeComponent(). For runtime language switching, it is called when the langauge is changed.

The implementation of the ml_string() function is different for Smart Device projects. For Windows Forms projects, it relies on a ResourceManager object to load the correct resources (using the CurrentUICulture property). For Smart Device projects it uses a ResourceSet object, which it loads explicitly for the selected language. (By the way, this breaks the resource fallback mechanism, but if that's a problem, I am sure that I can fix it).

Take another look at the dialog, I think that you will find that it has "Alternative Runtime Support" in the title bar.

Since you wrote, that you are already able to change language on the fly, I guess that you are doing something similar already. (Actually, I'm sure that you know much more about Smart Device projects than I do. Feel free to tell me that everything I have written is nonsense!)

I hope that this helps (and isn't too much information),

Best regards
Phil


Hi Phil

Thanks for your reply and the new version. It's working fine now. biggrin
I'm doing the language switching on the fly without the select language form. As I only have one form (with about 100 controls) I do not need the Events.


Thanks again.
Regards
Christof