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

Question About Multi Language in EE 2.9.10

How Do I?

restos's avatar
restos
54 posts
9 years ago
restos's avatar restos

Hi,

I want to start make the changes to add one additional language. I’ve created a new directory for additional spanish language (/es/) with a copy of main index.php file plus this code:

$assign_to_config['global_vars']['language'] = 'Spanish';
$assign_to_config['global_vars']['language_code'] = 'es';

The url of spanish version is: website.com/es/

Then in templates I’m using:

{if language_code =="es"}

spanish text
{if:else}
english text
{/if}

The home of website is working fine with this method, if I visit myhomepage.com/es/ it shows the spanish version, ok that’s fine.

The problem I’ve is the categories and entries… I can’t access the entries or categories in spanish language using the following url structure: myhomepage.com/es/cat or myhomepage.com/es/entry, a page not found is the server response.

These urls are working fine in english version myhomepage.com/cat and myhomepage.com/entry, so the issue is the es directory in url.

So I’m doing anything wrong, can anybody give me some directions?

Thank you very much.

       
restos's avatar
restos
54 posts
9 years ago
restos's avatar restos

Hi,

I’ve found the solution putting this code (index.php)

$assign_to_config[‘site_url’] = ‘http://mysite/es/’;

Thanks.

       
Robin Sowell's avatar
Robin Sowell
13,159 posts
9 years ago
Robin Sowell's avatar Robin Sowell

Thanks for sharing the fix, restos. And you’re dead on- if you’re using the subdirectory/subdomain to separate out by language, tweaking the site url in the index.php is the way to get the links working correctly.

       

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.