Welcome! Log In Create A New Profile

Advanced

WB12 - AWP-Mode and Nation()

Posted by Peter Holemans 
Peter Holemans
WB12 - AWP-Mode and Nation()
July 09, 2008 12:38PM
Hi,

Did anybody get a multilanguage site in AWP up and running?
I'm passing the language as a parameter to AWP pages and based on this parameter I set the nation() accordingly in the project intialisation code. The directory used remains however the default project language directory: /WBSITE_WEB/DEFAULTPROJECTLANGUAGE/WebPage.awp?Language=LanguageCode and this isn't changed by using the nation() statement in the project initialisation code.

Can anybody shed a light on this or provide a best practice?
I noticed there are quiet some issues on the french forums as well on this.

Thanks,
Hi,

I found an example that could help me get it to work. It concerns www_iPhone (Showing use of WebDev for iPhone and Blackberry) where a neat trick in the project initialisation code would allow me to get this to work. However, when using ScriptDisplay in the project initialisation code, it is run over and over again in my project, but it isn't in the iPhone project. Here's some code of the project initialization:
//Project variables
GLOBAL
	gstr_AWPSessionApplicationMode is string  //Manages the type of application: Travel GiftLists or Honeymoons (Identical apps except for execution languages NL/212 FR/205 UK/203)
	gstr_AWPSessionLanguage is string //Manages the languages
	//###############################################################
	//AWP Mode
	//###############################################################
	IF InAWPMode() THEN
		//Manage context variables used by pages in AWP mode
		ConfigureAWPContext(ctxDisk,ctxIDCookieURL)
		IF NOT DeclareAWPContext(gstr_AWPSessionLanguage) THEN gstr_AWPSessionLanguage = "NL"				//Dutch is default language
		IF NOT DeclareAWPContext(gstr_AWPSessionApplicationMode) THEN gstr_AWPSessionApplicationMode = "HNM"//Honeymooners is default mode (HNM <> GFT)
		//Check if a parameter is passed to the AWP page, then cookie, then default
		gstr_AWPSessionLanguage=PageParameter("Language")
		IF gstr_AWPSessionLanguage~="" THEN
			gstr_AWPSessionLanguage = CookieRead("UHM_LANGUAGE")
			IF gstr_AWPSessionLanguage ~= "" THEN 
				gstr_AWPSessionLanguage = "NL"
				CookieWrite("UHM_LANGUAGE","NL",90)
			END
		END
		gstr_AWPSessionApplicationMode=PageParameter("ApplicationMode")
		IF gstr_AWPSessionApplicationMode~="" THEN
			gstr_AWPSessionApplicationMode = CookieRead("UHM_APPLICATIONMODE")
			IF gstr_AWPSessionApplicationMode ~= "" THEN 
				gstr_AWPSessionApplicationMode = "HNM"
				CookieWrite("UHM_APPLICATIONMODE","HNM",0)
			END
		END
		//Now set the execution language for the AWP pages
		//Detect the requested page
		sCurrentPage is string = SysEnvironment("SCRIPT_NAME")
		sCurrentPage = fExtractPath(Replace(sCurrentPage, "/", "\"), fFileName+fExtension)
		SWITCH gstr_AWPSessionApplicationMode
			CASE "GFT"
				SWITCH gstr_AWPSessionLanguage
					CASE "NL"
						ScriptDisplay("../L212/" + sCurrentPage + ["?"] + Replace(SysEnvironment("QUERY_STRING"),"QUERY_STRING=","",SansCasse))
					CASE "FR"
						ScriptDisplay("../L205/" + sCurrentPage + ["?"] + Replace(SysEnvironment("QUERY_STRING"),"QUERY_STRING=","",SansCasse))
					CASE "EN"
						ScriptDisplay("../L203/" + sCurrentPage + ["?"] + Replace(SysEnvironment("QUERY_STRING"),"QUERY_STRING=","",SansCasse))
					OTHER CASE
						ScriptDisplay("../L212/" + sCurrentPage + ["?"] + Replace(SysEnvironment("QUERY_STRING"),"QUERY_STRING=","",SansCasse))
				END
			OTHER CASE
				SWITCH gstr_AWPSessionLanguage
					CASE "NL"
						ScriptDisplay("../NL/" + sCurrentPage + ["?"] + Replace(SysEnvironment("QUERY_STRING"),"QUERY_STRING=","",SansCasse))
					CASE "FR"
						ScriptDisplay("../FR/" + sCurrentPage + ["?"] + Replace(SysEnvironment("QUERY_STRING"),"QUERY_STRING=","",SansCasse))
					CASE "EN"
						ScriptDisplay("../UK/" + sCurrentPage + ["?"] + Replace(SysEnvironment("QUERY_STRING"),"QUERY_STRING=","",SansCasse))
					OTHER CASE
						ScriptDisplay("../NL/" + sCurrentPage + ["?"] + Replace(SysEnvironment("QUERY_STRING"),"QUERY_STRING=","",SansCasse))
				END
		END
	ELSE
	//###############################################################
	//CLASSIC DYNAMIC MODE
	//###############################################################
		//Declare objects to store session and caddy info
		gobj_Session is objSession
		gobj_Caddy is objCaddy
		//Now make sure a language and application mode is set
		IF gstr_AWPSessionLanguage~="" THEN
...

Anybody some ideas?
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: