Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » Set start Language

Our old forums are still available as a read-only archive.

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

Page: 1 2
Go to End
Author Topic: 3788 Views
  • vispi
    Avatar
    Community Member
    3 Posts

    Set start Language Link to this post

    Hello,

    how can i set a new standard Language for user in a multilanguage environment?

    via ?lang=de and ?lang=en works, but on first visit its english not german?

    i18n::set_default_lang('de'); // for German not work

    Kind Regards

  • cliersch
    Avatar
    Community Member
    75 Posts

    Re: Set start Language Link to this post

    Hi vispi,
    try this in the mysite/_config.php
    i18n::set_locale('de_DE');
    setlocale (LC_ALL, 'de_DE@euro', 'de_DE', 'de', 'ge');

    but...
    ...does anybody knows how to change the meta tag content language
    <meta http-equiv="Content-Language" content="en">

    I couldn't find any settings how to switch the content language.

  • cerelac
    Avatar
    Community Member
    34 Posts

    Re: Set start Language Link to this post

    Hi.

    vispi, try putting this in your "_config.php" file:

    i18n::enable();
    i18n::set_default_lang('de_DE');

    tiga, I think that if you use this code in your native language, your problem will be solved.

    Best Regards

  • vispi
    Avatar
    Community Member
    3 Posts

    Re: Set start Language Link to this post

    hi,

    _config.php includes now

    i18n::enable();
    i18n::set_default_lang('de_DE'); // for German
    i18n::set_locale('de_DE');
    setlocale (LC_ALL, 'de_DE@euro', 'de_DE', 'de', 'ge');
    HTTP::set_cache_age(0);

    But Visit Start-Languageare english and CMS Languages now German (Germany) = English Version and German = German Version.

    <meta http-equiv="Content-Language" content="de"> not work.

    Best Regards

  • cerelac
    Avatar
    Community Member
    34 Posts

    Re: Set start Language Link to this post

    vispi, try removing this code in your "_config.php" file:

    setlocale (LC_ALL, 'de_DE@euro', 'de_DE', 'de', 'ge');
    HTTP::set_cache_age(0);

    Best Regards

  • cliersch
    Avatar
    Community Member
    75 Posts

    Re: Set start Language Link to this post

    Thank you cerelac! That works perfectly )

  • vispi
    Avatar
    Community Member
    3 Posts

    Re: Set start Language Link to this post

    sorry, but it's not work.

    _config.php:

    i18n::enable();
    i18n::set_default_lang('de_DE');
    i18n::set_locale('de_DE');

    Content was english but Security/login = German?

    Strange.

  • cerelac
    Avatar
    Community Member
    34 Posts

    Re: Set start Language Link to this post

    vispi, I forgot to tell you to remove this line:

    i18n::set_locale('de_DE');

    Best Regards

    3788 Views
Page: 1 2
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.