0% found this document useful (0 votes)
102 views

Change Language Dynamically

The document discusses dynamically changing the language of a website based on user preferences. It describes storing the user's preferred language in a database and loading pages in that language by passing the language code as a URL parameter. The poster is trying to change the language on certain pages but is having issues changing all field captions and seeks advice on the best way to dynamically set the language globally.

Uploaded by

Sinan Yıldız
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
102 views

Change Language Dynamically

The document discusses dynamically changing the language of a website based on user preferences. It describes storing the user's preferred language in a database and loading pages in that language by passing the language code as a URL parameter. The poster is trying to change the language on certain pages but is having issues changing all field captions and seeks advice on the best way to dynamically set the language globally.

Uploaded by

Sinan Yıldız
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

www.hkvforums.

com
Skip to content

Board index ‹ PHPMaker ‹ General Discussion (PHPMaker)


Change font size
Print view

FAQ
Register
Login

Change Language dynamically


Post a reply
3 posts • Page 1 of 1

Change Language dynamically

by cruzz » Thu Jul 19, 2012 4:03 am

HI
I wanna know how i can change language dynamiclly.

I have an application in 2 Lang (English and French)

When a user loggin in the system... the language change by that was setting by default for the user (I keep
Language in a table user->language)

but i some cases I have to change the language for the other one at the momento to call a particulare page

function ListOptions_Rendered() {

$userLang = ew_ExecuteRow("
SELECT *
FROM user
WHERE pk_id = " . $user->pk_id->CurrentValue);

if ($userLang['language']=='FR'){$lang = 'fr';}
else {$lang = 'en';}

if ( $_SESSION[EW_SESSION_LANGUAGE_ID] == 'en') {

$this->ListOptions->Items["printCard"]->Body = "<a href='./it2Dusercardview.php?


export=html&lang=".$lang."&pk_id=".urlencode(strval($user->pk_id->CurrentValue))."' class='tip'
onclick=\"return hs.htmlExpand(this, {objectType: 'iframe', width: '740', height: '650', outlineType: 'rounded-
white', transitions: ['easing'], allowWidthReduction: false, allowHeightReduction: false, wrapperClassName:
'highslide-wrapper drag-header', outlineWhileAnimating: true, preserveContent: false } )\"><img
style='border:0; padding-left: 10px;' src='images/card.png'></a>";

} else {

$this->ListOptions->Items["imprimerCarte"]->Body = "<a href='./it2Dusercardview.php?


export=html&lang=".$lang."&pk_id=".urlencode(strval($user->pk_id->CurrentValue))."' class='tip'
onclick=\"return hs.htmlExpand(this, {objectType: 'iframe', width: '740', height: '650', outlineType: 'rounded-
white', transitions: ['easing'], allowWidthReduction: false, allowHeightReduction: false, wrapperClassName:
'highslide-wrapper drag-header', outlineWhileAnimating: true, preserveContent: false } )\"><img
style='border:0; padding-left: 10px;' src='images/card.png'></a>";

Basiqlly I need to load the next page /it2Dusercardview.php?


export=html&lang=".$lang."&pk_id=".urlencode(strval($user->pk_id->CurrentValue)).

in the language that i am sending in my URL $lang

I was trying to change the language doing in my PAGE_LOAD() event and Page_DataRendering () event
with out success :(

global $Language, $gsLanguage

$lang = $_GET['lang'];

$Language->Languageid = $lang;
or
$gsLanguage = $lang

I can change some texts But not all my FIELD CAPTIONS

Please... How I can do it??

Thank you :)

cruzz

Top

Re: Change Language dynamically


by Webmaster » Thu Jul 19, 2012 10:07 am

Try use language=xx (not lang=xx) in the URL.

Webmaster

Posts: 11683
Joined: Fri Aug 06, 2004 5:59 pm

Top

Re: Change Language dynamically

by cruzz » Fri Jul 20, 2012 5:20 am

Cool!!! Works!! thank you :)

cruzz
Top

Display posts from previous: All posts Sort by Post time Ascending Go

Post a reply
3 posts • Page 1 of 1

Return to General Discussion (PHPMaker)

Board index
Delete all board cookies • All times are UTC + 8 hours

Powered by phpBB® Forum Software © phpBB Group

You might also like