CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> GotoCode Archive

 Multi language site, any tips?

Print topic Send  topic

Author Message
Rene
Posted: 03/19/2002, 5:50 AM

Hi,

I'm trying to build a multi language site. Does anyone have tips? Should I copy all my database tables for the specific languages? Add a languafe field to all tables and wrestle my way through sql? please, any suggestions will help. (there are four languages involved)

Thanks alot.

Rene
Nicole
Posted: 03/19/2002, 6:14 AM

Rene,
it can be done in Template version only and require some manual coding. All captions on the form (FormCaption and field captions), should be defined in curl braces, like {FormCaption}. And all button captions, navigator captions should be defined the same way.
Then in Open event of the form you should get the selected language and define all captions. E.g. for English:
ASP
if GetParam("language") = "eng" then
SetVar "FormCaption", "Results"
SetVar "Fiels1caption"m "Name"
' other captions
SetVar "insert_button", "Insert"
'other buttons
SetVar "Previous", Previous
'other navigator captions
end if
Pedro
Posted: 03/19/2002, 9:39 AM

You have to name the captions in the forms like this :

Instead of Name use {var_name}
Instead of Day Phone use {var_day_phone}

Modify in the templateobj.asp and save as newtemplateobj.asp

Function ProceedTpl(sTpl)
Dim regEx, sMatch, oMatches, sName, sTTpl

sTTpl = sTpl
sMatch = getNextPattern(sTTpl, 1)
while len(sMatch) > 0
sName = mid(sMatch, 2, len(sMatch) - 2)
if left(lcase(sName),6)="var_" then
sTTpl = replace(sTTpl, sMatch, GetTranlationfor(mid(sName,5)),session("Lang"))
else
if ParsedBlocks.Exists(sName) then
sTTpl = replace(sTTpl, sMatch, ParsedBlocks(sName))
else
sTTpl = replace(sTTpl, sMatch, DBlocks(sName))
end if
end if
sMatch = getNextPattern(sTTpl, 1)
wend
ProceedTpl = sTTpl
End Function



Add a new function to NewTemplateObj.asp

Function GetTranslation(word,lang)
'You can make your own code to read the info from a SQL table and maybe cache it into application variables.

End Function


In the modules, edit the event common and replace templateobj with newtemplateobj.



Good Luck

Pedro
Wilfred
Posted: 03/21/2002, 11:38 AM

Hi there,

This is abacadabra for me, I also struggle with a multilanguage site and I'm new with codecharge.
Is there maybe any exsample file (ccs) for me to see what you're talking about so I can use this as a frame work for my multilanguage-portal wich I'm trying to build.

Thanks
Wilfred

   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.