Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Multi Lingual Forums
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Multi Lingual Forums

 Post Reply Post Reply Page  123 5>
Author
zMaestro View Drop Down
Senior Member
Senior Member


Joined: 11 May 2003
Location: Egypt
Status: Offline
Points: 1183
Post Options Post Options   Thanks (0) Thanks(0)   Quote zMaestro Quote  Post ReplyReply Direct Link To This Post Topic: Multi Lingual Forums
    Posted: 01 February 2005 at 8:27am

Is there a way i can make a forum multilangual?

i.e. uses 2 different Language Files, one for English and the other for Arabic for eg?
 
Thanks.
Back to Top
zMaestro View Drop Down
Senior Member
Senior Member


Joined: 11 May 2003
Location: Egypt
Status: Offline
Points: 1183
Post Options Post Options   Thanks (0) Thanks(0)   Quote zMaestro Quote  Post ReplyReply Direct Link To This Post Posted: 23 February 2005 at 8:27am

Question

Back to Top
Lingua View Drop Down
Newbie
Newbie
Avatar

Joined: 22 March 2005
Location: Russian Federation
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote Lingua Quote  Post ReplyReply Direct Link To This Post Posted: 22 March 2005 at 2:20pm
Hi,
yes, you can setup Multilanguage forums, but its a liitle bit tricky.
One of the problems is, that the WebWiz Forum does not support utf-8, so you have to recode a few pages, to load a Country Meta Tag into the pages which supports the diffrent languages.
 
---- All following coding was done in the Version 7.9 WebWiz Forum
 
I made a rough and "dirty" coding for that and placed it in the common.asp as a function:
 
'Set the Language Session Variable
Function L_Session()
 DIM  L
 L = TRIM(Request.QueryString("L"))
 If L = "" Then
  If Session("L") = "" Then
   Session("L") = "US"
  Else
   If Session("L") = "DE" Then
    Response.Write("<meta http-equiv=""Content-Type"" content=""text/html; charset=iso-8859-1"">")
   End if  
   If Session("L") = "US" Then
    Response.Write("<meta http-equiv=""Content-Type"" content=""text/html; charset=iso-8859-1"">")
   End if  
   If Session("L") = "RU" Then
    Response.Write("<meta http-equiv=""Content-Type"" content=""text/html; charset=windows-1251"">")
   End if  
  End If
 Else
  If L = "DE" Then
   Session("L") = "DE"
   Response.Write("<meta http-equiv=""Content-Type"" content=""text/html; charset=iso-8859-1"">")
  End if  
  If L = "US" Then
   Session("L") = "US"
   Response.Write("<meta http-equiv=""Content-Type"" content=""text/html; charset=iso-8859-1"">")
  End if  
  If L = "RU" Then
   Session("L") = "RU"
   Response.Write("<meta http-equiv=""Content-Type"" content=""text/html; charset=windows-1251"">")
  End if  
 End if
End Function
------------------------
 
Most of the files in the Forum use the /includes/skin_files.asp, so I included the call of the above function at the bottom of that file.
Just insert at the bottom the word L_Session and that should do the trick for most of the pages.
 
some files like upload from  pictures do not use the skin_file.asp and there you have to enter the function call manual.
Just open (for example the upload_images.asp) and look for the line of code
<meta name="copyright" content="Copyright (C) 2001-2004 Bruce Corkhill" />
and enter after that <%L_Session%> thats it.
 
-----------------------
 
to trigger the languages, I entered some simple flags in the file  /includes/navigation_buttons_inc.asp (In the beginning of the second <td> )
 
  <a href="/forum_ru/default.asp?L=RU"><img src="/forum/forum_images/flags/flag_ru.gif" width="25" border="0"></a>
  <a href="/forum_de/default.asp?L=DE"><img src="/forum/forum_images/flags/flag_de.gif" width="25" border="0"></a>
  <a href="/forum_nl/default.asp?L=NL"><img src="/forum/forum_images/flags/flag_nl.gif" width="25" border="0"></a>
  <a href="/forum/default.asp?L=US"><img src="/forum/forum_images/flags/flag_usa.gif" width="25" border="0"></a>
-----------------------
 
Now you have done the basic setup. As you can see in the <a> tags above, i have setup 4 directories which connect to the same SQL Database. the only difference in the directories is the directory language_files, so its just copying 4 times the complete stuf into 4 diffrent directories like forum_nl and forum_de and so on.
 
-----------------------
 
I hope I did not forget anything, but that works, otherwise ask me.
 
I for myself made a litlle bit more complicated setup using virtual pathes except for the language_files directory, but to run that, you have to change in all forum/root asp files the pathes of the includes. This is a little more tricky, but it works.
 
You can take a look to a forum we have setup for testing purpose. If it runs well, we will pay for it next month. I think its worth paying for it.  http://www.3cgi.de/forum
 
Regards
 
Lingua
 


Edited by Lingua - 23 March 2005 at 9:56am
Back to Top
weipper2 View Drop Down
Newbie
Newbie


Joined: 18 March 2005
Location: Canada
Status: Offline
Points: 18
Post Options Post Options   Thanks (0) Thanks(0)   Quote weipper2 Quote  Post ReplyReply Direct Link To This Post Posted: 23 March 2005 at 9:49am
Everybody is asking for multi langual forum, i create my own multi-langual forum yesterday. Take a look to my testing forum : ISA

The forum contain two language : french and english. I decided to create 2 forums, one with french language files and buttons files, and i did samething for english, both connect to the same database.

where i changed the code to get my select option list, is includes/navigation_buttons_inc.asp files

At the end of this file, add :

'Else the user is not logged
Else
        'Display a welcome guset message with the option to login or register
        Response.Write ("&nbsp;&nbsp;<a href=""registration_rules.asp?FID=" & intForumID & """ target=""_self"" class=""nav""><img src=""" & strImagePath & "register_icon.gif"" alt=""" & strTxtRegister & """ border=""0"" align=""absmiddle"">" & strTxtRegister & "</a>")
        Response.Write ("&nbsp;&nbsp;<a href=""login_user.asp?FID=" & intForumID & """ target=""_self"" class=""nav""><img src=""" & strImagePath & "login_icon.gif"" alt=""" & strTxtLogin & """ border=""0"" align=""absmiddle"">" & strTxtLogin & "</a>")
End If

%></td>
    </tr>
    <tr>
    <td align="right" class="smText">
   
        <form action="functions/change_language.asp" method="get">
        Select language<br>
        <select name="choix" onchange="this.form.submit();" class="smText"><optgroup label="Language list" class="smText"><option value="-1" class="smText">Select one</option><option value="fra" class="smText">Français</option><option value="eng" class="smText">English</option></optgroup></select>
        </form>

    </td>
    </tr>

   </table>
  </td>
 </tr>
</table>


After, you have to create a new file functions/change_language.asp, and add this code :

<%
if request.querystring("choix")="fra" then

    dim strlink
    dim strlink2
    strlink = Request.ServerVariables("HTTP_Referer")
    arrlink = Split(strlink,"/")
    arrlink(4)="forum"
    For i = lbound(arrlink) to ubound(arrlink)
      if i = ubound(arrlink) then
    strlink2=strlink2&arrlink(i)
      else
        strlink2=strlink2&arrlink(i)&"/"
      end if
    Next
    Response.Redirect(strlink2)

elseif request.querystring("choix")="eng" then

    strlink = Request.ServerVariables("HTTP_Referer")
    arrlink = Split(strlink,"/")
    arrlink(4)="forumeng"
    For i = lbound(arrlink) to ubound(arrlink)
    if i = ubound(arrlink) then
    strlink2=strlink2&arrlink(i)
     else
        strlink2=strlink2&arrlink(i)&"/"
     end if
    Next
Response.Redirect(strlink2)

end if

%>

In bold, there is your both main forum, just change the name you give to the folder. So I hope it could help you, and I just wanna excuse my writting, i'm a french canadian and I suck in english :p.


Edited by weipper2 - 23 March 2005 at 2:26pm
Back to Top
weipper2 View Drop Down
Newbie
Newbie


Joined: 18 March 2005
Location: Canada
Status: Offline
Points: 18
Post Options Post Options   Thanks (0) Thanks(0)   Quote weipper2 Quote  Post ReplyReply Direct Link To This Post Posted: 23 March 2005 at 10:01am
Someone could help me to keep language selection in cookie or something like that? It would be nice for guest if they dont have to change always language each time they visit the forum.

Oh and i'm forgetying it, i'm working for redirecting to the last url when the language is selected, if someone can give me the command, i will appreciate that Wink. Because now, its always redirect to default.asp and its not cool Confused
Back to Top
dfrancis View Drop Down
Senior Member
Senior Member


Joined: 16 March 2005
Location: United States
Status: Offline
Points: 442
Post Options Post Options   Thanks (0) Thanks(0)   Quote dfrancis Quote  Post ReplyReply Direct Link To This Post Posted: 23 March 2005 at 10:41am
Everybody is asking for multi langual forum, i create my own multi-langual forum yesterday. Take a look to my testing forum : ISA

The forum contain two language : french and english. I decided to create 2 forums, one with french language files and buttons files, and i did samething for english, both connect to the same database.
 
great idea... I will watch closely.
 
I tried to select Enlish and received...
 
 

Microsoft VBScript compilation error '800a0400'

Expected statement

/isa/forumeng/functions/change_language.asp, line 5

"forum/"& Request.ServerVariables("URL")
^


Edited by dfrancis - 23 March 2005 at 10:42am
Back to Top
weipper2 View Drop Down
Newbie
Newbie


Joined: 18 March 2005
Location: Canada
Status: Offline
Points: 18
Post Options Post Options   Thanks (0) Thanks(0)   Quote weipper2 Quote  Post ReplyReply Direct Link To This Post Posted: 23 March 2005 at 1:43pm
oups sorry, i'm trying something for redirection in last url, just copy the code in my message, it work fine.
Back to Top
weipper2 View Drop Down
Newbie
Newbie


Joined: 18 March 2005
Location: Canada
Status: Offline
Points: 18
Post Options Post Options   Thanks (0) Thanks(0)   Quote weipper2 Quote  Post ReplyReply Direct Link To This Post Posted: 23 March 2005 at 2:21pm
OK i had the new code, the redirection works fine too, if you find some errors, let me know :)
Back to Top
 Post Reply Post Reply Page  123 5>

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.