Jump to:

23361 Posts in 18124 Topics by 2862 members

General Questions

SilverStripe Forums » General Questions » [Solved] Set meta "Content-Language" for singla language site

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: 1346 Views
  • derralf
    Avatar
    Community Member
    24 Posts

    [Solved] Set meta "Content-Language" for singla language site Link to this post

    hi

    can anyone tell me how to set content language (de) in meta tags for a single language site? (SS 2.3.1)

    Where to change and when to change.
    I read something like "when you started with en you can't change to another language". So i deleted all Pages, even deleted database.

    I think i Tried everything i found in the forum. Nothing wotked for me.

    please!

    thanks in advance,
    ralf

  • Cem
    Avatar
    Community Member
    31 Posts

    Re: [Solved] Set meta "Content-Language" for singla language site Link to this post

    Try to put the below in your mysite/config.php,

    i18n::set_locale('de_DE');

    if it doesn't work try the same with the 2.3.2 beta version.

  • martimiz
    Avatar
    Forum Moderator
    1067 Posts

    Re: [Solved] Set meta "Content-Language" for singla language site Link to this post

    Version 2.3.1 has some language issues that will be solved in 2.3.2. I have the same issue. A quick and dirty temporary solution without tampering with existing code:

    Override the MetaTags() function from the SiteTree class: just copy this entire function to your Page class and then adapt where it says

    $tags .= "<meta http-equiv=\"Content-Language\" content=\"". Translatable::current_lang() ."\"/>\n";

    to

    $tags .= "<meta http-equiv=\"Content-Language\" content=\"de\"/>\n";

    If anyone knows a better way please tell...

  • derralf
    Avatar
    Community Member
    24 Posts

    Re: [Solved] Set meta "Content-Language" for singla language site Link to this post

    i tried the override suggestion - seems to work well.
    great. thank you both!

    ralf

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