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.

If statement error on multilingual website

November 08, 2012 6:57am

Subscribe [1]
  • #1 / Nov 08, 2012 6:57am

    milogdm

    4 posts

    Hi I run an installation of EE 2.5.3 using the multilingual trick where I configure the country code in the global vars using the index.php file for each language as described in the wiki:

    $assign_to_config['global_vars'] = array(
      "country_code" => "en",
      "language" => "english"
     );

    Everything works fine for all the languages I have defined, but recently I tried to add to my header a meta-tag for the language, so I added this to my header (it’s a partial template):

    {if country_code == "en"}
     <meta name="language" content="English" />
    {/if}
    
    {if country_code == "fr"}
     <meta name="language" content="French" />
    {/if}
    
    {if country_code == "zh"}
     <meta name="language" content="Chinese" />
    {/if}
    
    {if country_code == "de"}
     <meta name="language" content="German" />
    {/if}

    The if structure it’s very similar to the one I have used inside the others templates. The output I get it’s an error for French and Chinese, but works fine for English and German.
    English it’s on the main folder of the installation.

    This is my error:
    Parse error: syntax error, unexpected T_ENDIF in /home/example/public_html/system/expressionengine/libraries/Functions.php(680) : eval()‘d code on line 5

    I don’t get this error in any other place of the website.

    Thanks for your help.

     

  • #2 / Nov 08, 2012 3:48pm

    Dan Decker

    7338 posts

    Hi milogdm,

    Sorry for your trouble here!

    I did some quick tests to make sure there wasn’t an obscure bug with “de” or “zh” and everything checked out for me.

    What I suggest is going back into those 2 index.php files and double checking that the array is properly formatted.

    If everything checks out, I’d like us to get a look at it.

    Cheers,

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

ExpressionEngine News!

#eecms, #events, #releases