Any suggestion to create Dynamic Content Generation to
organizing my page to support different language.
Any help would be appreciated, thanks..
Printable View
Any suggestion to create Dynamic Content Generation to
organizing my page to support different language.
Any help would be appreciated, thanks..
ruslina:
Welcome to VBForum.
Could you explain a little more about what you mean by "support different language."
Maybe then soneone here can figure out what you have going on and can give you some suggestions.
Good Luck
Store the string values that are constant to your page in the database, under different language headings. Store the current user language in a session variable and everytime the page loads, based upon the session variable, populate the 'labels'.
Note, however, that this is going to be a rather slow method as you have several database hits occurring each time the page loads.
Hi there..
thanks for reply..For all of your information, I already create 1 dll file (using vb6) to read the database who store field base on different languange heading.I use array method.
The problem is...every label,table,heading etc who i use in current language must be declare in the top page using array method before I checking one by one for every single line before dll file passing the new language I select..Its so tidious...for me to change for every page.
Any different or better method to solve this problem..
My coding in asp page like this:
<html>
<TITLE>Test Read And Write Array From DLL File use this form</TITLE>
<script language=javascript>
</script>
<body><form method="post" action="add_record1.asp">
<%
dim strver
dim n,i
dim strtest(),Result,Kamus
n=5
redim strtest(5)
strtest(1)="No Matrik"
strtest(2)="Nama Pelajar"
strtest(3) = "Negeri"
strtest(4) = "Simpan"
strtest(5) = "Batal"
strver="EN"
Set Kamus=Server.CreateObject("SimpleKamus.Load_Kamus")
for i= 1 to n
Result=Kamus.Baca_Kamus(strtest(i),strver)
%>
<table border=0>
<%if strtest(i)="No Matrik" then%>
<tr>
<td width=50%><%=Result %></td>
<td>:</td>
<td><input name="matrixid"></td>
</tr>
<%end if%>
<%if strtest(i)="Nama Pelajar" then%>
<tr>
<td width=50%><%=Result %></td>
<td>:</td>
<td><input name="name" ></td>
</tr>
<%end if%>
<%if strtest(i)="Negeri" then%>
<tr>
<td width=50%><%=Result %></td>
<td>:</td>
<td><input name="state" ></td>
</tr>
<%end if%>
</table>
<%Next%>
<br /><br />
<%
for i= 1 to n
Result=Kamus.Baca_Kamus(strtest(i),strver)
%>
<%if strtest(i)="Simpan" then%>
<input type="Submit" name="btnSubmit" value=<%=Result%>>
<%end if%>
<%if strtest(i)="Batal" then%>
<input name="reset" type="reset" value=<%=Result%>>
<input type="reset" class="button" value=<%=Result%> onclick="return recbatal();">
<%end if%>
</form>
<%Next%>
<%
Dim strBtn
strBtn = Trim(Request.Form("btnSubmit"))
If strBtn <> "" Then
set conn=Server.CreateObject("ADODB.Connection")
'conn.provider="microsoft.jet.oledb.4.0"
'conn.open server.mappath("student.mdb")
strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("student.mdb") & ";"
conn.Open strConn
conn.Execute "INSERT INTO student (matrixid, name,state) VALUES ('" & request.form("matrixid") & "','" & request.form("name") & "', '" & request.form("state") & "')"
response.write
response.End
on error resume next
'conn.Execute sql,recaffected
if err<>0 then
Response.Write("No update permissions!")
else
Response.Write("<h3>" & recaffected & " record added</h3>")
end if
conn.close
End If
%>
</body>
</html>
Yes, it is going to be difficult and you don't have much of a choice. Consider moving to ASP.NET, where localization is much, much easier. All you need is a resource file for each language, and then populate each control from the codebehind.