ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Solution to default language problem with Multi language site alternative

May 18, 2011 2:08pm

Subscribe [2]
  • #1 / May 18, 2011 2:08pm

    Ivan Waumans

    7 posts

    I wrote an extension that sets the language (of an anonymous users) to the value stored in the ‘language’ variable inside the global variables (defined in the index.php file).

    This is done by setting a cookie on the ‘sessions_start’ hook. This way the user messages (all system messages) will show up in the language the anonymous user is visiting.

    Works for EE 2.x

    Make sure you have the ‘language’ variable defined like this:

    $assign_to_config['global_vars'] = array(
        "lang_code" => "nl",
        "language" => "dutch"
    );
  • #2 / May 18, 2011 6:47pm

    Lisa Wess

    20502 posts

    Hi, Ivan -

    Thanks for putting this together!  Unfortunately, I did need to remove the extension when I shifted this up to Community News.  Please review our Guidelines which has recommendations for where you can host your add-on.

    Thank you!

  • #3 / Sep 27, 2012 6:34am

    outline4

    271 posts

    I wrote an extension that sets the language (of an anonymous users) to the value stored in the ‘language’ variable inside the global variables (defined in the index.php file).

    This is done by setting a cookie on the ‘sessions_start’ hook. This way the user messages (all system messages) will show up in the language the anonymous user is visiting.

    Works for EE 2.x

    Make sure you have the ‘language’ variable defined like this:

    $assign_to_config['global_vars'] = array(
        "lang_code" => "nl",
        "language" => "dutch"
    );

    hi Ivan,
    I really love to see your solution, since I am struggeling with the default language problem…

    cheers
    stefan

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases