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

Possible bug in class i18n?


Go to End


2 Posts   1324 Views

Avatar
Krigu

Community Member, 7 Posts

9 June 2010 at 7:21am

Hi all

I'm trying to translate my forum module and the admin in german. But it did not translate at all...

In my _config.php i changed:

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

But it still did not work.. After a debug session i changed the method _t in the class i18n and everything works find now.. I changed the line

f(!isset($lang[$locale])) i18n::include_by_locale($locale);

to

if(!isset($lang[$locale][$class])) i18n::include_by_locale($locale);

and now it includes the language file and the strings are translated. I think the variable $lang[$locale] is always assigned, but not the $lang[$localte][$class].. The variable $class represents the name of the module (e.g. 'Forum')

Is this a possible bug or have i just configured something wrong?

Greetings
Krigu

Avatar
Willr

Forum Moderator, 5523 Posts

9 June 2010 at 5:51pm

Sounds like a bug. Make a ticket on open.silverstripe.org and one of the core devs will get back to you.