You can localize all of the strings and images that appear in the Windows Forms Viewer control in included resource files, and alter and run a batch file to localize the control.
To localize the viewer control
All of the localization files are located in C:\Program Files (x86)\GrapeCity\ActiveReports 13\Localization.
Specify the culture you want to use in the batch file.
- Start Notepad or another text editor.
- Open the WinViewer.bat file and change the Culture value to the culture you want to use.
- Save and close the file.
Localize strings (and images) in the resource files.
- Copy the following files required for the Web Viewer from the Localization folder: C:\Program Files (x86)\GrapeCity\ActiveReports 13\Localization:
-
- WinViewer.zip
- WinViewer.bat
- NameComplete.exe
- NameComplete.exe.config
- Localize.bat
- publickey.snk
- Paste these files to a local folder, say D:\Localize\.
- Extract WinViewer.zip file.
- In the folder extracted, open each subfolder and change the strings in each of the *.resx files.
For example, D:\Localize\WinViewer\WinViewer\Res\ActiveReports\Viewer\Win\FlatViewer.resx
- If you want to change the images, rename your localized images to the names of the ones in the Res\Resources subfolder and replace them with your localized images.
Run the batch file.
- From the Start menu, type cmd in the text box.
- Navigate to the local directory by typing cd D:\Localize\ and press Enter.
- Type WinViewer.bat and press Enter to run the file. The NameCompleter.exe application runs, and creates the following.
- A SatelliteAssembly folder inside the WinViewer folder.
- A language subfolder with the name of the culture (say ja) you set inside the SatelliteAssemby folder.
- A localized GrapeCity.ActiveReports.Viewer.Win.resources.dll file inside the language subfolder.
- Add verification entry for the assembly by running following command:
sn.exe -Vr "ja\GrapeCity.ActiveReports.Design.Win.resources.dll".
- Copy the language subfolder and paste it into the Debug folder of your application.
Note: Before you can distribute or put your localization in the Global Assembly Cache (GAC), you must first send the localized GrapeCity.ActiveReports.Viewer.Win.resources.dll file to
GrapeCity and get it signed with a strong name. Then you can drag the language subfolder with the signed dll file into C:\WINDOWS\ASSEMBLY.
Test your localized application on a machine that does not share the culture of the localized DLL.
- Add the following code in the form's constructor just before the InitializeComponent method is called.
- Replace the "ja" in the example code with the culture you specified in the WinViewer.bat file.
To write the code in Visual Basic.NET
Visual Basic.NET code. Paste INSIDE the form's constructor just before the InitializeComponent method. |
Copy Code
|
System.Threading.Thread.CurrentThread.CurrentUICulture = New System.Globalization.CultureInfo("ja") |
To write the code in C#
C# code. Paste INSIDE the form's constructor just before the InitializeComponent method. |
Copy Code
|
System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo("ja"); |