Glossary Item Box

Localization

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

Localizing the ActiveReports Engine

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

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

The walkthrough is split up into the following activities:

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

You can find these files in your Program Files/Data Dynamics/ActiveReports for .NET 2.0/Localization folder. You will also need access to the current ActiveReports.dll installed on your machine which you can find in the Program Files/Common Files/Data Dynamics/ActiveReports for .NET 2.0 folder.

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

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.
  4. Copy the required files (Strings.txt, Descriptions.txt, ParamPromptDialog.resx, ActiveReports.dll,  PublicKey.snk, and SatelliteAssembly.exe) to this new folder.

Using the Windows Resource Localization Editor

To use the Windows Resource Localization Editor 

  1. Open a Visual Studio .NET 2003 or 2005 command prompt from the Start menu > All Programs > Visual Studio .NET > Visual Studio .NET Tools. 
  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 ParamPromptDialog.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. Close the Windows Resource Localization Editor.
  8. Close the Visual Studio .NET 2003 or 2005 command prompt window.
  9. 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.resources.dll".
    • Select or type the correct .NET 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.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.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 ParamPromptDialog.resx file that has the culture information added to the file name. For example, for Japanese, you would choose "ParamPromptDialog.ja.resx ". Click Open to add the file 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. 
    File Namespace
    ParamPromptDialog DataDynamics.ActiveReports
    Strings DataDynamics.ActiveReports.Viewer.Resources
    Descriptions DataDynamics.ActiveReports.Viewer.Resources
  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.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 an ActiveReport with Parameters

To add the ActiveReport with Parameters

  1. In your project, click on Project > Add New Item...
  2. Select "ActiveReports File" and rename the file rptParams.
  3. Follow the instructions in the Parameters with Simple Reports walkthrough to create your report with parameters.

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.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.