Jump to:

23370 Posts in 18160 Topics by 2864 members

General Questions

SilverStripe Forums » General Questions » Multi-language website, default spanish, displays english only

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

Page: 1
Go to End
Author Topic: 1698 Views
  • dsriedel
    Avatar
    Community Member
    1 Post

    Multi-language website, default spanish, displays english only Link to this post

    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 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.

    1698 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.