Undefined index in /lib/language.php:303

Hi,

I get the following PHP notice after upgrading to 1.0.1 from 0.9.7:

Notice: Undefined index: fr in /www/statusnet/lib/language.php on line 303

I checked the line and it appears that the problems lies here:
$all_languages = common_config('site', 'languages');

I added the following lines into my config file:

$config['site']['languages'] = array(
'en' => array('q' => 1, 'lang' => 'en', 'name' => 'English', 'direction' => 'ltr'),
'fr' => array('q' => 1, 'lang' => 'fr', 'name' => 'French', 'direction' => 'ltr'),
);

and this made the trick.

That said, I think it's a bug: if no [site][languages] parameter is set, this notice shouldn't appear. There's something missing here.

Cheers!

Comments

  • Probably cause by the function is_rtl, will look into this.
  • I can confirm the bug still exists I tried the above (throwing error on en_GB)

    The following additions to config.php worked for me :

    $config['site']['languages'] = array(
    'en-us' => array('q' => 1, 'lang' => 'en', 'name' => 'English (US)', 'direction' => 'ltr'),
    'en-gb' => array('q' => 1, 'lang' => 'en_GB', 'name' => 'English (British)', 'direction' => 'ltr'),
    'en_GB' => array('q' => 1, 'lang' => 'en_GB', 'name' => 'English (British)', 'direction' => 'ltr'),
    'en' => array('q' => 1, 'lang' => 'en', 'name' => 'English (US)


    When I didnt have the :

    'en_GB' => array('q' => 1, 'lang' => 'en_GB', 'name' => 'English (British)', 'direction' => 'ltr'),

    line it still threw an error
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Google Sign In with OpenID