2016-10-04 00:00:00

Multi Language ASP. NET website

Yay! Big step into future! I support Polish language on my website. I am proud as this my first time when I could apply multi language feature in ASP .NET

Simplest instruction:

1. Prepare resource files folder: right click on solution -> add asp .net folder and then App_globalResources.

2. In this folder create a Resources Files for all supported languages eg. languages.resx and languages.pl.resx (first default and second for Polish)

3. In session save language you use. (eg. Session["lang"] )

4. Each time you open any page, load language from session and apply culture:

string culture =  Session["lang"] ;//here load culture eg. "pl-PL"
            Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(culture);
            Thread.CurrentThread.CurrentUICulture = new CultureInfo(culture );

5. Instead of writing texts on pages use literal with correct resource name:

                        asp:Literal ID="Literal1" runat="server" Text="<%$Resources:language,valuationSec1Title%>"/>


That's all! Let me know if you have any issues!