Symantec Management Platform (SMP) Community

 View Only

NS7 Page Localization 

Nov 01, 2011 03:24 PM

This page gives a basic overview. For more details on localization including localization patterns and how to solve common errors, see http://ali-mydev.altiris.com/Wiki/default.aspx/Altiris.NSCore/Localization.html

The Altiris SDK provided a convienient way to localize your web pages for NS 6 under Visual Studio 2003. However there is nothing that currently exists to make this job easy for NS 7 however if you follow the following steps you can (somewhat) easily hook your localization up for language pack localization in NS7:

0) Make sure you have backed up or checked in your NS project before starting, I have lost a lot of work due to "helpful" changes made by Visual Studio.

1) In Visual Studio go to your web project and right-click on the folder where the page you want to localize exists. Select "Add->New Item..."

2) Select “Resource File” from the available templates and name it the same name as your web page with .resx added. So for test.aspx you would create test.aspx.resx.

3) Open up the .aspx.cs file and at the top of your class file add the following member:

 public AltirisResourceManager rm = AltirisResourceManager(typeof(<your UI page class> ) );

4) At the top of your ASPX file add the following line:

 <%@ Assembly Name=”Altiris.NS” %>

5) While keeping the resx file open, go through your UI page’s .aspx and .aspx.cs and add create an entry in the .resx file with a unique ID and the string text. I generally try to match the ID up with the property of the control I’m replacing. For example “lblTitle.Text” becomes my ID. At the same time replace any static string reference in code with a call to:

 rm.GetString(“<ID>”);

passing in the string ID. For the .aspx code use:

 <%= rm.GetString(“<ID>”) %>

6) During the process of adding strings Visual Studio may have made incorrect changes to your .designer.cs file. You can safely back out any changes that were made to this file as the Altiris SDK uses reflection to query the language pack resources from your compiled assembly.

7) Build and test to make sure all your strings are getting loaded from the .resx file properly.

8) Add an Altiris language pack project and perform the "Extract Localization Variants" to query your strings from your assemblies, web project and config files.

Statistics
0 Favorited
0 Views
0 Files
0 Shares
0 Downloads

Tags and Keywords

Related Entries and Links

No Related Resource entered.