0
votes

I am trying to get a multilingual site up according to this tutorial: http://nuts-and-bolts-of-cakephp.com/2008/11/28/cakephp-url-based-language-switching-for-i18n-and-l10n-internationalization-and-localization/

Things look good in terms that clicking on a switch-language link works. However, when you first come to the site, i would like it to go to the default language example.com/eng/ instaed of just being example.com/.

Basically, for SEO purposes, I don't want my site to have non-lingual content, should always have the language in the url.

How could I do that and also go through the function that saves the language in session/cookie?

thanx

1
were you able to successfully set-up a multilingual site with the above mentioned tutorial? Did you also have language content being fetches from database as well? Will you be able to share your code for internationalization?jagamot
What I did was a big mix of different things that finally got it going, but it was quite tough. If interested, I will share ... what, a zip of the cake installation?mgPePe
@mqPepe - a zip of cake installation would be very helpful!jagamot

1 Answers

0
votes

Looking at the article, all you should need is a simple check for the 'language' param in the URL:

function beforeFilter() {
    // check and perform a redirect
    if (empty($this->params['language'])) {
        $this->redirect(array('language' => 'eng'));
    }
    // the following method sets any cookies
    $this->_setLanguage();
}