Hi everyone,
I am currently using vs2002
vb.net to develop some website that requires multilanguage (english, german, italian). I've created resx files for each language (created them by add new web form, assembly class).
1. I don't understand is if I create these resx files independent of the original aspx file, how are they suppose to link?
2. How to display values depending on the local users culture settings?
I have some code that I started off with and had no avale. Please could someone help. I have cut out the
Code:
Imports System.Globalization
Imports System.Resources
Imports System.Threading
Public Class AutoComplete
Inherits System.Web.UI.Page
Protected WithEvents text1 As System.Web.UI.WebControls.TextBox
Protected WithEvents Label1 As System.Web.UI.WebControls.Label
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Try
Thread.CurrentThread.CurrentCulture = _
CultureInfo.CreateSpecificCulture(Request.UserLanguages(0))
Thread.CurrentThread.CurrentUICulture = _
Thread.CurrentThread.CurrentCulture
Dim rm As ResourceManager
Dim rr As ResourceReader = New ResourceReader(Server.MapPath("App_LocalResources/AutoComplete.aspx.de.resx"))
Dim d As DictionaryEntry
Dim temp As String
For Each d In rr
temp = temp & d.Key & ": " & d.Value & "<br>"
Next d
Label1.Text = temp
rr.Close()
'Dim objRm As ResourceManager = ResourceManager.CreateFileBasedResourceManager( _
' "AutoComplete", Server.MapPath("./"), Nothing)
'Label1.Text = objRm.GetString("test")
Catch e1 As Exception
Response.Write(e1.Message)
End Try
End Sub