We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

EE2 Can I change the session language from php from a tempate?

Development and Programming

FaithX's avatar
FaithX
120 posts
13 years ago
FaithX's avatar FaithX

Dear joanmcapera!

I did tried this. But I’ve got error message:

A PHP Error was encountered Severity: Notice Message: Undefined variable: _SESSION Filename: core/EE_Lang.php Line Number: 46

I’ve put the language setting line into my index template file. Did You put it elsewhere? It looks, like it was not definied.

       
outline4's avatar
outline4
271 posts
13 years ago
outline4's avatar outline4

hi there, I didn’t read the thread in full, but I was looking for the same thing at the same time. maybe I’m completely off…

try this in your index.php files:

Below

* --------------------------------------------------------------------
 *  CUSTOM CONFIG VALUES
 * --------------------------------------------------------------------

add this

// sets the default language (use the name of the language folder)
$assign_to_config['deft_lang'] = 'deutsch';

this will change the language according the /en or /fr url and trigger the language specific errors etc…

it works like a charm! cheers stefan

       
joanmcapera's avatar
joanmcapera
3 posts
13 years ago
joanmcapera's avatar joanmcapera
Dear joanmcapera! I did tried this. But I’ve got error message: A PHP Error was encountered Severity: Notice Message: Undefined variable: _SESSION Filename: core/EE_Lang.php Line Number: 46 I’ve put the language setting line into my index template file. Did You put it elsewhere? It looks, like it was not definied.

Im not good at php, but the isset conditional should protect against that error. Anyway, i think next answer is better than my solution.

       
1 2

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.