Learn how to build multilingual applications in .Net by leveraging the framework's built-in support for globalization Globalization and localization are two important concepts in .Net that help you to internationalize your applications. While globalization is the process that is used to build applications targeted at various cultures, localization is the process that is used to customize your application to provide support for a particular culture and locale. The steps to internationalize your application in .Net include the following: Identify the localizable resources Create resource files for each locale your application needs to provide support for Read the resource data in your application wherever applicable Compile the resource files to create satellite assemblies (one for each locale your application supports) Deploy your application To implement localization in your applications, you should take advantage of the following namespaces: System.Globalization — types that are used to culture-specific information System.Resources — types that are used for creating, manipulating, and using resources System.Text — types that are used to represent ASCII, Unicode and ANSI character encodings System.Threading — types that are used to work with multi-threading Resource files A resource is a piece of non-executable data that your application takes advantage of often. Typical examples of resources include locale specific strings, bitmaps, icons, cursors, etc. Such resources are stored in files known as resource files. To internationalize your application using .Net, you would need to take advantage of resource files. Resource files are used to store data specific to a particular locale. Note that resource files are XML files that can store binary information as well — the binary resources are actually base64 encoded. Ideally, you would have a separate resource file for each locale, i.e., one resource file per locale. Typically, your application can then read data from the resource files based on the locale your application is using and then display information pertaining to that locale to the user. Resources used for globalization in .Net can be of two types. These include the following: Local resources — used by a particular Web page, i.e., such resources are Web page specific Global resources — used by the entire application — all the Web pages of your application can leverage such resources Creating resource files You can create resource files using the Visual Studio IDE or even programmatically. To create a resource file in the Visual Studio IDE follow these steps. Open Visual Studio IDE in your system Click on File -> New -> Project to create a new web project In the Solution Explorer window, select your project and then right click on it Click Add -> New Item Select General from the list of the installed templates displayed in the window that pops up Select “Resources File” to create a file for storing the resources you need. The name of the file should indicate the locale it is targeted at Lastly, specify a name for your resource file and click OK A new resource file would now be created and added to your project in the name you specified – the extension of this file would be .resx. When naming your resource file, you can follow any one of the following conversions: resourcefilename.language.resx resourcefilename.language-locale.resx If you are creating global resources, i.e., resources that would be used by the entire application, you can place them inside the App_GlobalResources – if there isn’t one available you can just create one for you. Once your resource file has been created, you can add data in your resource file using the Resource Designer window. To access the culture specific resources, you can leverage the System.Resources.ResourceManager class. After you are done adding the necessary data to one or more resource files for your project, you can build your solution to generate the satellite assemblies for your project. A satellite assembly is a special type of an assembly in .Net that comprise of resources like, locale specific strings, bitmaps, icons, etc. You can also create a satellite assembly using the assembly linker command line tool Al.exe by running the Developer Command Prompt window in administrator mode. You can refer to this link for more information on this tool. Related content feature What is Rust? Safe, fast, and easy software development Unlike most programming languages, Rust doesn't make you choose between speed, safety, and ease of use. Find out how Rust delivers better code with fewer compromises, and a few downsides to consider before learning Rust. By Serdar Yegulalp Nov 20, 2024 11 mins Rust Programming Languages Software Development how-to Kotlin for Java developers: Classes and coroutines Kotlin was designed to bring more flexibility and flow to programming in the JVM. Here's an in-depth look at how Kotlin makes working with classes and objects easier and introduces coroutines to modernize concurrency. By Matthew Tyson Nov 20, 2024 9 mins Java Kotlin Programming Languages analysis Azure AI Foundry tools for changes in AI applications Microsoft’s launch of Azure AI Foundry at Ignite 2024 signals a welcome shift from chatbots to agents and to using AI for business process automation. By Simon Bisson Nov 20, 2024 7 mins Microsoft Azure Generative AI Development Tools news Microsoft unveils imaging APIs for Windows Copilot Runtime Generative AI-backed APIs will allow developers to build image super resolution, image segmentation, object erase, and OCR capabilities into Windows applications. By Paul Krill Nov 19, 2024 2 mins Generative AI APIs Development Libraries and Frameworks Resources Videos