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

Multi-Language Add-In for Visual Studio


Silverlight

Does anybody knows if the tool works wiht silverlight?
Germany

Hi,

it more or less works, but I don't think it is quite perfect.

Improving support for Silverlight (and WPF) is one of my top priorities at the moment. I'm making an effort to learn more about Silverlight, because I really need a bit more practical experience of using it.

I am really interested in having users test the Add-In with real projects. Can you try it out?

Phil


Of course. In fact I've tried it but I'm facing errors scanning the project. But I'm using beta version and don't know if this is an issue. Count on me to test the Add-in wiht silverlight.

REgards


> But I'm using beta version

Wanted to say trial version.

Germany

Hi,

the trial version makes no difference. The only restriction is on the number of translations. Otherwise it has the full functionality.

I have just uploaded a new version (4.7x.0071) with some minor changes to the Xaml scan. Also, in the previous version (4.7x.0070) I added more logging to the XAML scan, in particular to reading the type information.

Can you try out the latest version (4.7x.0071)? If you get problems, can you please send me the log file?

If the error dialog is shown, there is a button to send an email report. The log file is attached automatically.

Otherwise the log file is located in the user specific "application data" directory, in the subdirectory MultiLang.Net. The location of this directory is dependent on the version of Windows, and it is usually hidden (which I find crazy).

On my Windows 7 system, the directory is:
c:\Users\Phil\AppData\Roaming\MultiLang.Net\

On Windows XP it is:
C:\Documents and Settings\Phil\Application Data\MultiLang.Net\
and may be localized.

Obviously the username will probably not be Phil on your system.

Phil

Hi

I've tested the new version. Stills same errors as previous one. I've sent an email via the add-in.

Regards.

Germany

Hi,

thanks, that was very useful.

I have been testing with the Telerik sample applications and have fixed several problems.

Can you please try out the latest version (4.72.0072)?

Phil

Hi,

Last version (4.72.0072) now scan controls and source in the right way. But there are problems with the generated code. These are the ones I've found by now. Don't know if there are more because the first one is really a showstopper.

1.- x:Static does not exists in Silverlight.

2.- You can't add runtime support. The supplied template (I'm using VB.NET) is not a silverlight class so you can't add a reference to it.

Regards.

Germany

Hi,

I haven't taken a look at the second issue yet, but I hope that I have fixed the first one (in version 4.7x.0073). Instead of using the x:Static syntax, the Add-In now uses Binding syntax.

For example, previously the Add-In inserted something like "{x:Static ml:MultiLang._1}".

Instead of this, it now inserts "{Binding _1, Source={StaticResource ml}}".

For this to work, the Add-In defines the StaticResource in the file App.Xaml, with a line something like
<res:MultiLang xmlns:res="clr-namespace:PROJECT_NAMESPACE.ml_resources" x:Key="ml" />

As I write, I realize that I have screwed up, and don't actually insert the project namespace at all. I think that it inserts the name of my test project. If I don't fix that in the next few hours, then you will have to correct it by hand. Sorry.

Also, when you click on a line the Add-In's controls grid, it will highlight the text in the Xaml file. If necessary, it will load the Xaml file into the editor. Unfortunately, it fails to highlight the text immediately after loading the file. I find this very useful, but I'm a bit worried about the performance.

By the way, in the Add-In settings dialog, under the WPF tab, there is a selection between Global resources and Local resources. I think that Global resources is selected by default.

The option Global resources means that all strings are read from MultiLang.resx. This mechanism should work.

The option Local resources generates a separate .resx file for each .xaml file. This mechanism only half works. It requires a StaticResource definition in the Xaml file, for example
<UserControl.Resources>
<res:MainPage xmlns:res="clr-namespace:PROJECT_NAMESPACE.ml_resources" x:Key="FILENAME_ml" />
</UserControl.Resources>
but it does not insert this automatically.

Phil

Germany

Hi,

I have fixed the stupid error adding the StaticResource to App.Xaml, which I mentioned above, in version 4.7x.0074.

Phil

Hi,

I've sent you an email. Still some issues but I think you're in the road.

Regards

Germany

Hi,

I think the problem is with the attributes in the root node.

Firstly, the Add-In seems to add xmlns:ml="clr-namespace:SilverlightApplication1.ml_resources" as a namespace, but I think this is only needed for the WPF support using x:Static.

Secondly, the Add-In seems to have added an x:Name attribute to the root nodes in two pages.

I will try to fix this tomorrow, or at the latest Wednesday. I am a bit tired today!

Phil

Ok. Will wait.

Regards.

Germany

Hi,

I have just uploaded a new version (4.7x.0075) which should fix these problems.

If you continue with the same project, you will have to remove the unnecessary attributes from the root nodes by hand.

Phil

Hi Phil,

It seems that the issue with the telerik window is solved but I can’t run the project. I’m facing this error when I try to run the project:
No matching constructor was found 'SilverlightApplication1.ml_resources.MultiLang'. Line: 6 Position: 93.
I’m using the small sample I sent last time and of course I’ve started with the ‘before’ project. Do not know if I’m doing something wrong. I translate the few strings that the project have and hit the ‘Start debugging’ button. Do I need to do any previous step?

Thank you in advance and please…I’m starting to be in a hurry.

Regards

Germany

Hi,

for some reason, the code generated by the PublicResXFileCodeGenerator gives the constructor the "Friend" (VB) or "internal" (C#) attribute.

It should run if you open the automatically generated file MultiLang.Designer.vb and change "Friend Sub New()" to "Public Sub New()". In my version that was at line 35.

I will have to find a solution to this problem, because it will be changed back every time that the file is regenerated.

Another issue is probably the build action for the .resx files. The Add-In sets the build action for the .resx files to "Embedded Resource". Apparently you should use the setting "Resource" instead of "Embedded Resource" with Silverlight. I'm not entirely sure what difference that really makes.

I'm still trying to get my head around these issues and learn about Silverlight at the same time.

Phil

Hi Phil.

Yes, that does the trick. It works. I can live changing Friend to Public until you find a solution. Now I'm going to try with my real project but I think it's time to buy your wonderful product.

Thanks for your time and efforts and it's has been a pleasure to help you to fine-tune the add-in to work with silverlight.

Regards