Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Multi-language website, default spanish, displays english only


Reply


1772 Views

Avatar
dsriedel

Community Member, 1 Post

4 February 2009 at 11:37pm

Edited: 04/02/2009 11:55pm

Hi all!

We have a problem with a multi-language website, that, by default, should display the spanish contents, but displays the english translated content when opening the site and does not switch to the spanish version.

Here our environment:

Windows Hosting Environment using WAMPSERVER 2.0 with
- PHP 5.2.8
- MySQL 5.1.30
- Apache 2.2.11

Silverstripe Version: 2.2.3

MySite _config.php:

<?php

global $project;
$project = 'mysite';

global $databaseConfig;
$databaseConfig = array(
   "type" => "MySQLDatabase",
   "server" => "localhost",
   "username" => "myuser",
   "password" => "mypassword",
   "database" => "mydatabase",
);

// Sites running on the following servers will be
// run in development mode. See
// http://doc.silverstripe.com/doku.php?id=devmode
// for a description of what dev mode does.
/* Director::set_dev_servers(array(
   'localhost',
   '127.0.0.1',
)); */

HTTP::set_cache_age(0);

i18n::enable();
i18n::set_default_lang('es');
i18n::set_locale('es_ES');
Translatable::enable();
Translatable::set_default_lang('es_ES');
?>

When loading the website, it is displayed in english although the default language is configured as spanish and the original page tree was created in spanish. When editing content in the CMS, the english translation presents the spanish original below the input fields.
The website contains a link to switch the language using "/?lang=es" to switch to spanish or "/?lang=en" to switch to english. But wherever on the website you try to switch to the spanish version, it just jumps to the english home (jumping to home is ok).

Additional comment:
After reviewing the documentation [url=http://doc.silverstripe.org/doku.php?id=multilingualcontent]multilanguagecontent[/url] we tried "Please make sure to rebuild the database-schema by calling http://<mysite>/db/build ". Some changes appeared in the log (screen) and when calling the website again, it displayed some old information and pages that had been removed in the past. The meta information or content (title, navigation title) seem to have changed, displaying the english texts instead of the original spanish ones. Anyway, switching between languages does not work and the english page is displayed by default.