- Set the UICulture and Culture attributes on a page to "Auto"
- Create an ASP.NET folder named App_LocalResources
- In App_LocalResources create a resource file using the following pattern:
for example:
Default.aspx, en-us -> Default.aspx.en-us.resx
Default.aspx, pl -> Default.aspx.pl.resx
- On the element that needs localization set the attribute meta:resourcekey to something meaningful, for example:
<asp:Label ID="LblText" Text="Hello, world!" runat="server" />
becomes
<asp:Label ID="LblText" Text="Hello, world!" meta:resourcekey="LblText" runat="server" />
- Add resource key for the property to modify using the following pattern:
resourcekey.property
for example:
LblText.Text
- DO NOT FORGET TO REBUILD AND RE-RUN THE APPLICATION!
Here's a complete and working solution for you to play around
ASP.NET-Localization.zip
Have fun!
No comments:
Post a Comment