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

Multi-Language Add-In for Visual Studio


AddIn + Infragistics

Hi!

We have problems using the MultiLang-AddIn together with Infragistics Controls, especially with the ultraGrid control. Currently we are using Infragistics NetAdvantage 2007 Volume 3 together with Visual Studio 2008.

When reading via Source Code, the strings are extracted correctly from any ultraButton, ultraLabel, etc. but from the ultraGrid there is only one property (.Text) extracted. The column header captions are missing!

This seems to be a bug, but it is not so serious because when reading via Designer, the column header captions are also extracted and I can enter/change the strings.
So far so good.

But after having exported the strings back to the ResX files, even having checked the checkbox "Namen der Ressourcen bestimmen" which is recommended when using Infragistics controls, the strings are displayed always in German! No English column headers!

What can I do?

Greetings!
Robert

Germany

Hi,

I have a few different Infragistics trial versions. I have just installed version 2008/1 (and the sample applications) which should be pretty close to your version. I don't really know how to work with the Infragistics controls, so I usually just work with the sample applications.

The trouble with the Grid samples, is that they almost never configure the columns in the design window (as far as I can tell). The particular form that I tried to translate was frmConditionalFormatting.vb in the (grid) SamplesExplorer project.

If you hold the mouse over the name of the property in the Add-In's controls grid, a tooltip will show you - amongst other things - the resource name used for the property.

In this screenshot, you can see that the resource name is resource.Caption3.
Image

This is after exporting the resources, and selecting the option "Determine resource names". Without this option, the resource name will be identical to the property name, which for the Infragistics controls is always wrong.

For one of the column headers which is not translated, can you:

  • look at this tooltip and see what the resource name is
    • if it is the same as the property name, try exporting the resources again
  • open the neutral resource file .resx (with a double click in the solution explorer) and look for this resource
    • Is the original text stored in this resource?
    • If not, then is the original text stored with a different resource name?
  • open the English resource file .en.resx and look for this resource
    • Does it contain your translated text?
  • Finally, check that the localizable property for the Form has been set to True.


If the resource name is correct, the translation is stored in the English resource file and Form has the Localizable property, then it has to work.

I therefore expect that at least one of these will be incorrect.

Phil


Hi Phil!

Thanks for your response and investigation!

> For one of the column headers which is not translated, can you:
> look at this tooltip and see what the resource name is

Property and resource name are the same!
Property: ultraGrid1.DisplayLayout.Bands%22Band 0%22.Columns%22Benutzer%22.Header.Caption
Resource: ultraGrid1.DisplayLayout.Bands%22Band 0%22.Columns%22Benutzer%22.Header.Caption


> if it is the same as the property name, try exporting the resources again
> open the neutral resource file .resx (with a double click in the solution explorer)
> and look for this resource
> Is the original text stored in this resource?
No, it is not!

> If not, then is the original text stored with a different resource name?
No.

> open the English resource file .en.resx and look for this resource
> Does it contain your translated text?
Yes!
Name: ultraGrid1.DisplayLayout.Bands%22Band 0%22.Columns%22Benutzer%22.Header.Caption
Value: User

> Finally, check that the localizable property for the Form has been set to True.
Yes!

So the German strings can be found in the corresponding de/en resx files
but not in the neutral resx file.

Any idea what goes wrong?

I have attached the small test project. This may help you.

Best regards!
Robert

Germany

Hi Robert,

this is what I think is happening.

You have defined a grid with four columns
Image

The grid is associated with the datasource ultraDataSource1. This datasource defines four fields.
If we take a look at the configuration of these fields, we see that the key property of each field is identical to the column header in the grid.
Image

This seems to be critical for localization.

Because the column header is identical to the key property from the datasource, the grid appears to actually take it from the datasource, and does not store is as a resource.

If we change the column headers, so that they do not match the key properties, then the behaviour is different. I have simply prefixed the column headers with an underscore:
Image
Image

If the Localizable property of the form is set, then the form designer will immediately change the code in the .Designer.cs file to load the column headers from resources:

Image

and store the captions to the neutral resource file:
Image

If you now export the translations to the resx files, with the option "Determine resource names", it will pick up the resource name and generate resources with the same names in the English and German resource files.

And when you run the program and select the English, the column headers appear appear in English.
Image

So it seems absolutely critical that the column headers are not the same as the default text from the datasource.

You could even do it as I did, with a underscore as prefix. This will not appear in either the German or the English version, because the correct text is stored in the language specific resource file. (It would appear in the user was able to select a different language.)

Of course, you might find it easier to set the column headers programatically, and to localize them in the source code.

Phil


Hi!

> Of course, you might find it easier to set the column headers programatically,
> and to localize them in the source code.

I think this is the way we have to go.
In the Form_Load-Event I call a function SetMultiLanguageValues() and in this function I set the column headers manually using the ml-IDs:

ultraGrid1.DisplayLayout.Bands%22Band 0%22.Columns%22Benutzer%22.Header.Caption = ml.ml_string(6, "Benutzer");

Is there a chance that this problem is resolved some time by you or by Infragistics?

Thanks and greetings,
Robert