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
<?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).
After reviewing the documentation multilanguagecontent 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.