Wednesday, March 16, 2005

[itsdifferent] Satellite Assemblies

Satellite assemblies allow storing the translated strings for each culture in a separate, resource-only assembly file that can load automatically based on the setting of the CurrentUICulture property. Using satellite assemblies provides the same advantages as adjusting to the culture at run time, plus satellite assemblies simplify displaying content from multiple translated sources.

Satellite assemblies are assembly files (.dll) that contain localized resources for an application. Each satellite assembly file contains the resources for one culture. An application can have many satellite assemblies, depending on how many cultures the application supports.

Web application projects use satellite assemblies to store the translated strings, graphics, and other culture-dependent aspects of an application’s user interface. To create the assemblies themselves, we use the Resource Manager. At run time, the Web application loads the translated strings into the Web form based on the current thread’s CurrentUICulture property.

To use satellite assemblies, follow these steps:

1. Set the id and runat attributes for all of the user-interface elements of application that require translation. Server controls have these attributes by default, but we will need to add them to HTML elements such as heading, paragraph, and span so that we can load translated strings into those elements.

2. Create a fallback resource file containing the default strings to display in the user interface if the user’s culture is not specified or not recognized. Name the fallback resource file filename.resx—for example, strings.resx.

3. Create resource files containing the translated strings to display for each general language that Web application supports. Name the translated resource files filename.languagecode.resx—for example, strings.es.resx.

4. Optionally, create resource files containing the translated strings to display for each specific culture that Web application supports. Name the resource file filename.languagecode-regioncode.resx—for example, strings.ex-MX.resx.

5. Write code to load the resources for the Web form using the ResourceManager class.

6. Write code to detect the user’s culture and set the Thread class’s CurrentCulture and CurrentUICulture properties to match. ASP.NET uses the CurrentCulture property to determine formatting for dates, currency, and numbers; ASP.NET uses the CurrentUICulture property to determine which satellite assembly is used when loading translated strings.

7. Write code to get strings from the resource files and display them in elements on the Web form.

 

Advantages

 

• Efficiency developing a new international version of the application only involves creating a new international resource file because each version has the same code block. This streamlines the creation of multiple language versions of application.

• Greater security whether we decide to localize application in-house or to use an external company, we will not need to access source code to develop international versions of application.

• Less testing this approach dramatically reduces the amount of testing required to ensure the quality of application's international version.

• Better localization by placing all relevant string resources in one file, ensure a more efficient localization process and reduce the chance of leaving some strings un-localized.

 

Regards,

Deven Goratela

 



Note: This Group is not a Job Searching Group, so please co-operate and dont transfer any kind of job related material across this Group.AnyOne doing so can be banned from the Group
Thanx , Group Co-Ordinators



Yahoo! Groups Sponsor
ADVERTISEMENT
click here


Yahoo! Groups Links

3 comments:

job opportunitya said...

Great blog. I surf the web looking for blogs like
this. Your site was on point and will be back again!
You got me! I will check out your plastic surgery philadelphia blog a.s.a.p!

job opportunitya said...

Unique blog my friend, I can hardly wait to vist
this site again. I just worship the site its comes
from! Believe me in my extra time I'm consistently
looking up blogs like this.
Go and click my plastic surgery for man blog.

job opportunitya said...

Captivating blog. I love surfing the web for the
type of blogs that you do. It had me on the edge of my
seat and I kept going back to again and again!
Where you been? You have got to look at my plastic surgery new jersey blog!