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.

Blog Module /

Discuss the Blog Module.

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

blog module in other languages


Reply


3 Posts   2197 Views

Avatar
jmperea

Community Member, 5 Posts

3 August 2009 at 11:52pm

Hello:

I have installed blog module blog-v0.2.1, in my _config.php i put this:

i18n::enable();
i18n::set_default_lang('es');
i18n::set_locale('es_ES');

In the top of the file of translation, es_ES.php,

there are this sentence:

i18n::include_locale_file('modules: blog', 'en_US')

This code generate this error:

Warning: array_key_exists() [function.array-key-exists]: The second argument should be either an array or an object in /var/www/virtual/alhaurinjoven.com/htdocs/prueba/SilverStripe-v2.3.2/blog-v0.2.1/lang/es_ES.php on line 19

if i change the las last code, and i put this:

i18n::include_locale_file('blog-v0.2.1', 'en_US');

The cms don´t have any error, but not translate in spanish.

The variable $lang contains the array es_Es, because if i do print_r(es_Es);

example: [es_ES] => Array ( [ArchiveWidget] => Array ( [DispBY] => .........

I put in /mysite/_config.php,

i18n::enable();
i18n::set_locale('es_ES');
i18n::set_default_lang('es');

cms/_config.php,

i18n::enable();
i18n::set_locale('es_ES');

sapphire/_config.php

i18n::set_locale('es_ES');

And the blog module doesn`t traslate in spanish, i need help to do this.

Tank you.

Sorry for my english.

bye

Avatar
baba-papa

Community Member, 279 Posts

23 August 2009 at 8:51pm

Hi jmperea,

if you install any module you have the change the folders name. The folder "blog-v0.2.1" must be renamed to just "blog". The same with all other modules.

Avatar
dacar

Community Member, 168 Posts

13 October 2009 at 11:12am

hi, i have got the same problem. the warning is really a problem, because it increases the size of the error.log file very much.

in php5_error.log it says:

[13-Oct-2009 00:05:28] PHP Warning: array_key_exists() [<a href='function.array-key-exists'>function.array-key-exists</a>]: The second argument should be either an array or an object in /home/31/xyz/silverstripe/blog/lang/de_DE.php on line 13

Here is the code from /blog/lang/de_DE.php:

i18n::include_locale_file('modules: blog', 'de_DE');

global $lang;

if(array_key_exists('de_DE', $lang) && is_array($lang['de_DE'])) {
   $lang['de_DE'] = array_merge($lang['en_US'], $lang['de_DE']);
} else {
   $lang['de_DE'] = $lang['en_US'];
}

_config.php:

i18n::enable();
i18n::set_locale('de_DE');
i18n::set_default_lang('de');
//Object::add_extension('SiteTree', 'Translatable');
//Translatable::set_default_locale('de_DE');

Hope anybody can help.