Implementing Globalizationย  , Localization in MVC Razor

ย Short introduction:

Globalizationย  :ย  Tthe process of designing and developing application that functions in multiple cultures/locales.
(Adapting a global product for a multiple language)
Localizationย ย  :ย  The process of adapting a particular language. ie., which is comfortable to use in the target country.

In this post let we see how we implement Localization

Step 1 :ย ย  Add resource file to the application as show in below

Creating resource 1

Step 2 : Open Resources.resx fils and enter the key and value as like below screen

resource1

Note :ย  while saving the resource file ,we want to set the access specifier to access the resource name in the view

Step 3 :ย  Add the following code in the view

ย ย ย ย ย ย ย ย ย ย ย ย ย ย  View : Include reference on the top of the view page

@using MVCRazor.Properties
<div> @Resources.sampletext</div>

Step 4 : Run the application

resource2

Description :

1 ) @using MVCRazor.Propertiesย  : importing the reference to the view

2) @Resources.sampletext :ย  @Resources is a name of the resource and sampletext be a key of the resource file

3) At runtime it will display the equlant value match for the key