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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

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

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

[Solved] Set meta "Content-Language" for singla language site


Go to End


4 Posts   1891 Views

Avatar
derralf

Community Member, 28 Posts

15 May 2009 at 7:05am

Edited: 16/05/2009 4:49am

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

Avatar
Cem

Community Member, 31 Posts

15 May 2009 at 9:21am

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.

Avatar
martimiz

Forum Moderator, 1391 Posts

15 May 2009 at 9:10pm

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

Avatar
derralf

Community Member, 28 Posts

16 May 2009 at 4:48am

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

ralf