Developing ASP.NET MVC Web Applications — Question 102
You are designing a localized ASP.NET MVC online shopping application that will be deployed to customers in the United States, China, France, and Brazil. The application must support multiple cultures so that content in the appropriate language is available in each area.
You need to ensure that the content can be viewed in several languages.
How should you implement this feature?
Answer options
- A. Use a resource (.resx) file to provide translations.
- B. Use Systems.Collections.Generics.Dictionary to store alternative translations.
- C. Ensure that all strings are marked internal to avoid conflict with internal literals.
- D. Include language-specific content in the assembly manifest and use .NET culture libraries.
Correct answer: A
Explanation
The correct answer is A because using a resource (.resx) file is a standard approach in .NET applications for supporting localization, allowing easy management of translations for different cultures. Option B is less effective as a Dictionary does not inherently provide the structure and benefits of resource files. Option C does not address localization needs, and option D, while a valid consideration, is more complex and not the primary method for managing translations.