11.3. Solution

As a sample implementation for this chapter, I fully localized the command layout stored in the template.master file, and most of the user controls, especially those that are part of the site's common structure, such as NewsletterBox, PollBox, ShoppingCartBox, ThemeSelector, WelcomeBox, and PersonalizationManager. To do this, you start by editing the template.master file and wrapping the static text you want to localize (such as the copyright notices, or the acknowledgments to Template Monster for providing the sample layout) into Localize controls. Then, from the Design View, you execute the Generate Local Resource command for the master page, thus creating a Template.master.resx file under the root App_LocalResources special folder. You copy this file into the same folder, rename it to Template.master.it-IT.resx (for Italian), open it in Visual Studio's resource editor, and translate all string values to the destination language. Figure 11-10 is a screenshot of the resource file for Italian opened in the editor.

Figure 11.10. Figure 11-10

Then you follow the exact same process for the controls mentioned above, which will produce a number of resource files under /Controls/App_LocalResources, as shown in Figure 11-11.

Figure 11.11. Figure 11-11

Yet another thing ...

Get ASP.NET 2.0 Website Programming Problem - Design - Solution now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.