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

anyone know a lot about language packs and global variables?

Development and Programming

phoebe_reed's avatar
phoebe_reed
82 posts
15 years ago
phoebe_reed's avatar phoebe_reed

Hi,

We’re still struggling to have system error messages (“your search did not return any results”) appear in different languages, based not on user login preference, but on a global variable carried on the site.

I wanted to know if anyone knows if there is a way I can set my site to use the language pack indicated by my global variable.. either always, or especially for users who are not logged in.

Has anyone created a multi lingual site with EE? If so, how did you handle the error messages? Does your site work only for logged in users? I know there must be a solution, but I don’t see it yet….

Thanks for any help or ideas…..

Phoebe

Moved to Development and Programming by Moderator

       
Brandon Jones's avatar
Brandon Jones
5,500 posts
15 years ago
Brandon Jones's avatar Brandon Jones

Hi Phoebe,

I believe the system messages will respect the Default Language specified in Admin › System Preferences › General Configuration for guests if the language pack correctly defines these. Logged in users can always change their default language.

Which language pack are you using (link?) and which version and build of EE 1.x?

       
phoebe_reed's avatar
phoebe_reed
82 posts
15 years ago
phoebe_reed's avatar phoebe_reed

Yes, the language packs will do everything you describe. Our challenge is: for NOT logged in or registers users, how can we have the language pack switch for them? An anonymous user is on the site in english, and they switch to spanish, all my content and template selection switched, but I have yet to find out how to switch a language pack. Any ideas?

Versions are 1.6.8, and 1.6.9 (dev and live are not synced yet, problem exists on both) Language packs I downloaded from EE site.. not sure which ones, but they are the standard system packs. They work great. Just can’t connect a global variable to a language pack selection. Lang Pack selection seems to require login.

       
Greg Salt's avatar
Greg Salt
3,988 posts
15 years ago
Greg Salt's avatar Greg Salt

Hi Phoebe,

That’s correct, the language selection is saved in the member session. This would require some development I think. You might do this by setting a cookie based upon the language chosen by the guest and then create your own global variable based upon the value of that cookie. You would need to check the cookie within an extension (maybe using the session_start or end hook). Global variables can be created like this:

global $IN;
$IN->global_vars['your_var_name'] = '';

Shall I move this thread to the Development forum so you can get some community input?

Cheers

Greg

       
phoebe_reed's avatar
phoebe_reed
82 posts
15 years ago
phoebe_reed's avatar phoebe_reed

Yes, please move it wherever you think best.

Can you give me a few examples of websites that use EE with multiple languages? I’m sure they have solved this issue… I’d like to ask them how they did it! 😊 Thanks very much,

Phoebe

       
Sue Crocker's avatar
Sue Crocker
26,054 posts
15 years ago
Sue Crocker's avatar Sue Crocker

Phoebe, did you look at:

http://www.slideshare.net/vinnyio/multilanguage-websites-in-expressionengine

Moving to the Developer Forum

       

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.