Glossary Item Box

Localization

See Also ActiveReports for .NET 2 Online Help Send feedback to Data Dynamics

Localizing the ActiveReports Designer

In ActiveReports, the report designer control and associated dialogs can be localized.

This walkthrough illustrates the basics of setting up localized strings for the ActiveReports report designer control.

The walkthrough is split up into the following activities:

To complete the walkthrough, you must have the following files:

  • DataSourceForm.resx
  • DDColorDropDown.resx
  • DDColorPopup.resx
  • DDColorWell.resx
  • Descriptions.txt
  • DesignerTabArea.resx
  • FindReplace.resx
  • FormatBorderDialog.resx
  • GoToLine.resx
  • GridSettingsSheet.resx
  • NewStyleDialog.resx
  • OutputFormatDialog.resx
  • PageSettingSheet.resx
  • PrinterSettingsSheet.resx
  • ReportSettingsDlg.resx
  • RichEditInsertFieldDlg.resx
  • ScriptEditor.resx
  • Strings.txt
  • StyleSettingsSheet.resx
  • PublicKey.snk
  • SatelliteAssembly.exe
  • ActiveReports.Design2.dll

You can find these files in your Program Files/Data Dynamics/ActiveReports for .NET 2.0/Localization folder (most are in the Designer folder). You can find the current ActiveReports.Design2.dll installed on your machine in the Program Files/Common Files/Data Dynamics/ActiveReports for .NET 2.0 folder.

This walkthrough should be completed in conjunction with the Localizing the ActiveReports Report Engine walkthrough.

When you have finished this walkthrough, you will have a localized ActiveReports designer that looks similar to the following. For purposes of this screen shot, Japanese was used to localize the designer.

Creating a new Visual Studio project

To create a new Visual Studio project

  1. Open Visual Studio.
  2. Click on File > New > Project.

  3. Select the project type and click on Windows Application.
  4. Change the name of your project and click OK.

Creating a Directory

To create a directory

  1. Open Windows Explorer and browse to the folder in which your project's EXE file will be contained when the report is run. For Visual Basic .NET, this will be the bin folder. For C#, this will be the bin/Debug folder.
  2. On the File menu, click New > Folder.
  3. Name the folder according to the CultureInfo that you will use to localize your project. For example, you would use "ja" for Japanese.

    Note: Be sure to be consistent with this name. Localization will not work if you name the folder "ja" but create a localization file based on "Japanese (Japan)" rather than "Japanese" because it will be looking for a folder named "ja-ja-JP."

  4. Copy the required files to this new folder. 
    • DataSourceForm.resx
    • DDColorDropDown.resx
    • DDColorPopup.resx
    • DDColorWell.resx
    • Descriptions.txt
    • DesignerTabArea.resx
    • FindReplace.resx
    • FormatBorderDialog.resx
    • GoToLine.resx
    • GridSettingsSheet.resx
    • NewStyleDialog.resx
    • OutputFormatDialog.resx
    • PageSettingSheet.resx
    • PrinterSettingsSheet.resx
    • ReportSettingsDlg.resx
    • RichEditInsertFieldDlg.resx
    • ScriptEditor.resx
    • Strings.txt
    • StyleSettingsSheet.resx
    • PublicKey.snk
    • SatelliteAssembly.exe
    • ActiveReports.Design2.dll

Using the Windows Resource Localization Editor

To use the Windows Resource Localization Editor

  1. Open a Visual Studio .NET 2003 or 2005 command prompt.
  2. Run the Windows Resource Localization Editor by typing "winres" and hitting Enter. This editor allows you to edit dialog .resx files for a certain locale. The utility is included as part of the .NET framework.
  3. Click on File > Open on the Localization Editor's menu bar.
  4. Change the file type to "ResX File(*.resx)".
  5. Navigate to the directory that you created and copied the required files into, choose the DataSourceForm.resx file, and click Open to open the file in the Editor.
  6. On the menu bar, click File > Save, select your localization culture from the list, and then press OK.
  7. Repeat Steps 3-6 for the rest of the .resx files in the directory you created.
  8. Close the Windows Resource Localization Editor.
  9. Close the Visual Studio .NET command prompt window.
  10. In Windows Explorer, browse to the folder containing the required files and rename the .txt files (Strings.txt and Descriptions.txt) according to the culture you have chosen. For example, you would change "Strings.txt" to "Strings.ja.txt" for Japanese.
Note: If any .resx files contain combo box items then the .resx files need to be modified after they are saved.

Running the Satellite Assembly Utility

To run the Satellite Assembly Utility

  1. Double-click the SatelliteAssembly.exe file to run the utility.
  2. On the menu bar, select File > New. This creates a project window for the Satellite assembly.
  3. On the menu bar, select Edit > Properties...
  4. On the Build tab of the Properties dialog:
    • Select the correct localization culture.
    • Set the input and output directories to the directory you created that contains the .resx and .txt files.
    • Set the output file name to "ActiveReports.Design2.resources.dll".
    • Select or type in the proper Framework Version.
  5. On the Assembly tab of the Properties dialog:
    • In the Assembly Attributes section, set the Version number to match the version of the ActiveReports.Design2.dll file located in the directory you created.
    • In the Delayed Signing section, set the Strong Name KeyFile to the publickey.snk key file in the directory you created.
    • In the Use Template File section, browse to the ActiveReports.Design2.dll file located in the directory you created. Click OK to continue.
  6. Right-click on the Resource file list view and select Add...
  7. With the File Type set to "Resx", add the .resx files that have the culture information added to the file names. For example, for Japanese, you would choose "DataSourceForm.ja.resx", "RichEditInsertFieldDlg.ja.resx", etc. Click Open to add the files to the list.
  8. Right-click on the list view and select Add... again. Change the File Type to "Strings File" and select the two .txt files that you renamed according to the culture you have chosen. Click Open to add the files to the list.
  9. Select all of the files in the list view, then right-click and select Edit... This brings up the Edit dialog for each file.
  10. Change the namespace for each culture-localized file according to the list below. Click OK after each change to save the namespace changes.
    Resource file Resource file namespace
    DataSourceForm.ja.resx DataDynamics.ActiveReports
    DDColorDropDown.ja.resx DataDynamics.ActiveReports.Design.Dialogs
    DDColorPopup.ja.resx DataDynamics.ActiveReports.Design.Dialogs
    DDColorWell.ja.resx DataDynamics.ActiveReports.Design.Dialogs
    DesignerTabArea.ja.resx DataDynamics.ActiveReports.Design
    FindReplace.ja.resx Compona.Windows.Forms.SyntaxBox.FindReplaceForm
    FormatBorderDialog.ja.resx DataDynamics.ActiveReports.Design.Dialogs
    GoToLine.ja.resx Compona.Windows.Forms.SyntaxBox.GotoLineForm
    GridSettingsSheet.ja.resx DataDynamics.ActiveReports.Design.Dialogs
    NewStyleDialog.ja.resx DataDynamics.ActiveReports.Design.Dialogs
    OutputFormatDialog.ja.resx DataDynamics.ActiveReports.Design.Dialogs
    PageSettingSheet DataDynamics.ActiveReports.Design.Dialogs
    PrinterSettingsSheet.ja.resx DataDynamics.ActiveReports.Design.Dialogs
    ReportSettingsDlg.ja.resx DataDynamics.ActiveReports.Design.Dialogs
    RichEditInsertFieldDlg.ja.resx  DataDynamics.ActiveReports.Design
    ScriptEditor.ja.resx DataDynamics.ActiveReports.Design.Dialogs.InternalC
    StyleSettingsSheet.ja.resx DataDynamics.ActiveReports.Design.Dialogs
    Strings.ja.txt DataDynamics.ActiveReports.Design.Res
    Descriptions.ja.txt DataDynamics.ActiveReports.Design.Res
  11. Select Save As... from the File menu. Click the Save button. This will create a .loc file for the culture you have chosen which contains all of the project-related information.
  12. Double-click on each item in the list view, select Editor..., and edit each file for the language you have chosen to localize. Below is an image of part of the "Strings.ja.txt" file used for this project.

  13. When all of the resources have been localized, you can build the Satellite assembly (ActiveReports.Design2.resources.dll) by selecting Build Assembly from the Build menu.
Note: If you are unable to edit the .txt files using the Satellite Assembly utility, you can open the files using Notepad and save them with Unicode encoding instead of ANSI.

Adding the ActiveReports Designer control

To add the designer control

  1. Drag and drop the ActiveReports report Designer control from the appropriate toolbox to Form1.
  2. Set the Dock property for the Designer to Fill.

Adding code to Change the Culture Information (Optional Step)

Note: This step is only necessary if you are developing on a machine with culture information different from that in the project you are localizing.

To add code to change the culture information

Running the Project

To run the project

  1. Press F5 to run the application.
  2. If the satellite assembly in the directory you created has only been signed with the Data Dynamics public key, you will need to turn off sn security for the assembly. You can do this by going to the Visual Studio .NET 2003 or 2005 command prompt, browsing to the directory in which the file is located and typing in the following line: "sn -Vr ActiveReports.Design2.resources.dll".

Note: Prior to deploying the project, you can send the ActiveReports.Design2.resources.dll file to ActiveReports.Support@DataDynamics.com to have it signed. When you deploy the project, if your other DLLs are being sent to the Global Assembly Cache, this file will also need to be sent there.

Localization

 

 


Copyright © 2004-2005 Data Dynamics, Ltd. All rights reserved.