Friday, February 5, 2010

How to use multilingual feature

ON LOGIN PAGE

Session.Add("Language", DropDownList1.SelectedValue)


THEN create LMSLanguage.resx under Language folder (for english language)






xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">







msdata:Ordinal="1" />

msdata:Ordinal="2" />










msdata:Ordinal="1" />









text/microsoft-resx


1.0.0.0


System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral,

PublicKeyToken=b77a5c561934e089



System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral,

PublicKeyToken=b77a5c561934e089



Home


Logout



AND also for marathi and hindi.......


System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral,

PublicKeyToken=b77a5c561934e089



marathi word


marathi word



THEN ON PAGE LOAD FOR EACH PAGE


If Session("userid") Is Nothing Then
Response.Redirect("../login.aspx")
End If
Try

Dim rm As System.Resources.ResourceManager
Dim s As String
's = ConfigurationSettings.AppSettings("rootPath")
''s = s + "/Languages/"
's = Server.MapPath("wwwroot") ' 'Path.DirectorySeparatorChar
's = "C:\Inetpub\wwwroot\LMS\Languages\"
s = Server.MapPath(rootPath & "/Languages/")
rm = ResourceManager.CreateFileBasedResourceManager("LMSLanguage", s, Nothing)
Dim a As String
a = Session.Item("Language").ToString
Dim cinfo As CultureInfo
cinfo = New CultureInfo(a)
lblMyOption.Text = rm.GetString("lblMyOptions", cinfo)
lblMyCourses.Text = rm.GetString("lblMyCourses", cinfo)
lblPreference.Text = rm.GetString("lblPreferences", cinfo)
lblChangePwd.Text = rm.GetString("btnTxtChangePwd", cinfo)
lblOldPwd.Text = rm.GetString("lblOldPwd", cinfo)
lblNewPwd.Text = rm.GetString("lblNewPwd", cinfo)
lblReNewPwd.Text = rm.GetString("lblReNewPwd", cinfo)
btnAssinAdd.Text = rm.GetString("btnTextSave", cinfo)
btnAssinCancel.Text = rm.GetString("btnTextCancel", cinfo)

Catch ex As Exception

End Try

No comments:

Post a Comment