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.

Change language of user messages based on url?

January 30, 2013 10:28am

Subscribe [3]
  • #1 / Jan 30, 2013 10:28am

    juxtascott

    5 posts

    I have a multi language site in English and French.

    I have installed the French language pack and switching the site default language works correctly but I need to keep this English and only show it in French when the user is at a url with /fr/whatever-page.

    The only user activity is using the mailing list module so what I need is the language of those mailing list user templates to change based on the url.

    I am using the method where I have folders set up for /en and /fr and index.php and .htaccess in each with custom config values like so

    $assign_to_config['template_group'] = '';
    $assign_to_config['template'] = '';
    $assign_to_config['site_index'] = 'fr/index.php';
    $assign_to_config['site_404'] = '';
    $assign_to_config['global_vars'] = array(
        "country_code" => "fr",
        "language" => "french"
    ); // This array must be associative

    Is there a way to change that default language on the fly in code based on the url?

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

ExpressionEngine News!

#eecms, #events, #releases