Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
250
Internationalization/Localization
posted

 I've been preparing my app for internationalization, where controls read their localized text from the form resource files.  The toolbar adds tools in initializeComponent like this:

 Infragistics.Win.UltraWinToolbars.ButtonTool buttonTool22 = new Infragistics.Win.UltraWinToolbars.ButtonTool("FileExit");

appearance34.Image = ((object)(resources.GetObject("appearance34.Image")));
buttonTool122.SharedProps.AppearancesSmall.Appearance = appearance34;
buttonTool122.SharedProps.Caption = resources.GetString("resource.Caption43");
buttonTool122.SharedProps.Category = resources.GetString("resource.Category42");
buttonTool122.SharedProps.ToolTipText = resources.GetString("resource.ToolTipText30");

 The problem is that when tools are rearranged/added/removed within the toolbar, the resource file and InitializeComponent seem to get out of sync and the wrong captions and tooltips are applied to each tool.

Is there some way around this, or some standard method of internationalization I am missing.?

Thanks,

Erik 

Parents
  • 44743
    Verified Answer
    posted

    This bug has been reported and fixed in version 7.2 and later. However, if the fix were applied to existing tools, all localizations would be lost (instead of them just being out of sync). Obviously this is much worse, so specific code was added so that the fix would only be applied to new tools added to a toolbars manager. The bug will still affect tools which have already been defined on your toolbars manager. There are 2 options to fix this: 1) Redefine all your tools and localizations for each language from scratch (I don't think you want to do this though as it could be very time consuming). 2). Redefine all your tools and localizations using the toolbars manager's built-in save/load layout functionality. The 2nd approach is a little trickier because the save/load layout logic wasn't originally designed for this, but it will save you a lot of time. Here it is:

    1.       Save a layout file for each localized language, including the default language:

    a.     Set the Form’s language to the language which needs to be saved.

    b.    Save the layout (see ‘Saving a layout’ below). Choose a filename that indicates the Form’s language, such as layout-french.DAT

    2.       Set the Form’s language to (Default).

    3.       Load the attached layout file named layout-empty.DAT (see ‘Loading a layout’ below).

    4.       Perform a Save All in Visual Studio (Ctrl+Shift+S).

    5.       Close the Form designer.

    6.       Perform these steps for each language which had a layout saved for it in step 1:

    a.     Open the Form designer

    b.    Load the layout for the Form’s current language which was saved in step 1.

    c.     Perform a Save All. (If all saved layout files have been loaded, the process is complete).

    d.    Change the Form’s language to the next language that needs to be loaded.

    e.     Load the layout-empty.DAT layout file.

    f.     Perform a Save All.

    g.    Close the form designer. Note: this step is very important. Without performing this step, localizations from all loaded layouts before this will be lost.  

      

    Saving a layout:

    1.     Right click on the toolbars manager and select Load/Save Configuration.

    2.     Choose to save a layout in binary format.

    3.     Browse to the file that will be saved by clicking the browse button next to the filename box.

    4.     Click ‘Save’ to save the layout.

     

    Loading a layout:

    1.     Right click on the toolbars manager and select Load/Save Configuration.

    2.     Choose to load a layout in binary format.

    3.     Browse to the file that will be loaded by clicking the browse button next to the filename box.

    4.     Click ‘Load’ to load the layout.

    layout-empty.zip
Reply Children
No Data