asp.net
For example, I have a landing page with two labels and two textbox, the page is named Login.aspx and the control is named Lbl_username,lbl_password,txt_username,txt_password.
You can start by creating a new App_LocalResources folder on your Web site, and then create a new resource file named Login.aspx.resx
The naming needs are the same as the matching page names. Then create another new resource file, named Login.aspx.zh-cn.resx
Login.aspx.resx This is the default, and Login.aspx.zh-cn.resx this is called when the browser default language is set to Chinese.
Open Login.aspx.resx File:
Name value
Labelresource1.text Username
Labelresource2.text Password
Open Login.aspx.zh-cn.resx File:
Labelresource1.text User Name
Labelresource2.text Password
And then, in our page code,
Put <asp:label id= "lbl_username" runat= "Server" ></asp:Label>
<asp:label id= "Lbl_password" runat= "Server" ></asp:Label>
Change to <asp:label id= "Lbl_username" runat= "Server" text= "<%$ Resources:LabelResource1.Text%>" ></asp: Label>
<asp:label id= "Lbl_password" runat= "Server" text= "<%$ Resources:LabelResource2.Text%>" ></asp:label >
Finally, in the page property of the pages, add culture= "AUTO:ZH-CN" uiculture= "AUTO:ZH-CN", which is set to Chinese by default.
When the browser default language is in English, you can see that two labels are displayed as username and password.
When the browser default language is Chinese, you can see that two labels appear as user names and passwords.