Loaded Commerce Community

Banner


Board index » CRE Loaded Support » CRE Loaded 6.2

All times are UTC - 5 hours




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: where is $language defined in the code?
PostPosted: Wed Aug 31, 2011 2:26 am 
Offline
CRE Newbie

Joined: Wed Aug 24, 2011 7:45 am
Posts: 26
Hi everyone,

as the title says, where is the language variable predefined??? on my system, when i'm using "echo $language", the result is always english, I'm just wondering where the system defined the variable?? because i'm working on multiple languages now, and i need to know where to find it. I know there's a page called languages.php, but I don't think $language is only defined there. it seems that $language comes from a session or somewhere.

please help.

Thanks


Top
 Profile  
 
 Post subject: Re: where is $language defined in the code?
PostPosted: Wed Aug 31, 2011 2:57 am 
Offline
CRE Legend
User avatar

Joined: Thu Jun 12, 2008 6:39 am
Posts: 2405
Location: New Zealand
/includes/application_top.php

simon

_________________
www.codemehappy.com
For Cre Loaded tips, how-to articles and more


Top
 Profile  
 
 Post subject: Re: where is $language defined in the code?
PostPosted: Wed Aug 31, 2011 3:18 am 
Offline
CRE Newbie

Joined: Wed Aug 24, 2011 7:45 am
Posts: 26
thanks for your reply soundsgood2, do you mean it's defined here? but unfortunately this part of code wasn't being used since the IF statement wasn't true. I still get the result english when i'm "echo $language" even after i commented this part out. but "echo $language" didn't work before tep_session_start();, so i guess it's from a session??

// set the language
if (!tep_session_is_registered('language') || isset($HTTP_GET_VARS['language'])) {
if (!tep_session_is_registered('language')) {
tep_session_register('language');
tep_session_register('languages_id');
}

include(DIR_WS_CLASSES . 'language.php');
$lng = new language();

if (isset($HTTP_GET_VARS['language']) && tep_not_null($HTTP_GET_VARS['language'])) {
$lng->set_language($HTTP_GET_VARS['language']);
} else {
$lng->get_browser_language();
}

$language = $lng->language['directory'];
$languages_id = $lng->language['id'];
}


Top
 Profile  
 
 Post subject: Re: where is $language defined in the code?
PostPosted: Wed Aug 31, 2011 3:27 am 
Offline
CRE Legend
User avatar

Joined: Thu Jun 12, 2008 6:39 am
Posts: 2405
Location: New Zealand
Yes it's from a session - how else would you get multilanguage ability? So you'd have a selector on the frontpage of your store where language is chosen by customer.

If you're just looking at hardcoding the store to a non-english language then there are a bunch of other things you can do to achieve this, one step is as per the other thread you posted the same question on.

Your first main hurdle of course would be making sure you had non-english language translations for all the language defines in the cart.

Simon

_________________
www.codemehappy.com
For Cre Loaded tips, how-to articles and more


Top
 Profile  
 
 Post subject: Re: where is $language defined in the code?
PostPosted: Wed Aug 31, 2011 3:43 am 
Offline
CRE Newbie

Joined: Wed Aug 24, 2011 7:45 am
Posts: 26
Hi Simon,

thanks, i got it. $language is actually defined in application_top.php and it was in that part of code i posted. it was me didn't pay enough attention and asking dumb questions :). because i only removed cookies when i'm testing the code, but not the session, that's why the $language = english was always there.

thanks for your help.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

Board index » CRE Loaded Support » CRE Loaded 6.2

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
It is currently Wed May 23, 2012 8:49 pm
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

Login

Forums Latest Activity

Top Listing

1. Cart2Cart - Shopping...
    Category: Shopping Cart Database Conversion Scripts
    
2. Points & Rewards PLUS!...
    Category: Add-Ons
    
3. Configuration Server...
    Category: Fixes
    
4. Credit Card with CCV
    Category: Payment Modules
    
5. CC7333_ATS
    Category: Templates
    
Show more...

© CRE Loaded is a product of Chain Reaction Ecommerce, Inc. Usage & Privacy Policy