Forums | Mahara Community

Support /
Problem with languages


anonymous profile picture
Deleted user
Posts: 90

21 July 2010, 7:02 AM

Hi everybody,

i'm just upgrade mahara to 1.2.5 from 1.1.6. I have installed the news language packs for 1.2 version for spanish and catalan in the langpacks directory, that have 777 permissions, and the directories of languages have 755 and files 644.

But mahara shows me the listbox of the languages but when a change the language don't work and only works in english.

Anybody knows a possible reason?

Thanks in advance.

anonymous profile picture
Deleted user
Posts: 7

21 July 2010, 8:19 AM

I have exactly the same problem with the German language pack.

A hint would be great.

Thanks

 

anonymous profile picture
Deleted user
Posts: 2

21 July 2010, 8:26 AM

I have the same problem in 1.2.5 AND 1.3 beta2

(dutch)

anonymous profile picture
Deleted user
Posts: 2

21 July 2010, 8:26 AM

I have the same problem in 1.2 AND 1.3

(dutch)

anonymous profile picture
Deleted user
Posts: 808

21 July 2010, 5:44 PM

It sounds like we need to track this problem down soon if everyone's getting it, but it's not happening for me yet.  Did you install the language packs into dataroot under the langpacks directory, or are you unzipping them straight into the mahara code directory?

Iñaki Arenaza's profile picture
Posts: 253

21 July 2010, 5:41 PM

Hi Antonio,

I've just tried it on a local test install with current 1.2.x (from git) with both Spanish and Basque language packs, and they work as expected.

Do you get any diagnostics in your PHP error logs? (make sure you have developer debug settings enabled in config.php ;-))

Saludos.
Iñaki.

anonymous profile picture
Deleted user
Posts: 90

22 July 2010, 2:14 AM

Function current_language() from 1.2.4 version works well in 1.2.5 version and languages works well

---- function version 1.2.4 in mahara.php file

function current_language() {
    global $USER, $CFG, $SESSION;
    if ($USER instanceof User) {
        $lang = $USER->get_account_preference('lang');
        if ($lang !== null && $lang != 'default') {
            if (language_installed($lang)) {
                return $lang;
            }
            $USER->set_account_preference('lang', 'default');
        }
    }

    if (is_a($SESSION, 'Session')) {
        $sesslang = $SESSION->get('lang');
        if (!empty($sesslang) && $sesslang != 'default') {
            return $sesslang;
        }
    }

    if (!empty($CFG->lang)) {
        return $CFG->lang;
    }
    return 'en.utf8';
}

 

but Function current_language() of 1.2.5 version don't works ok

---- function version 1.2.5 in mahara.php file

function current_language() {
    global $USER, $CFG, $SESSION;

    static $lang;

    if (!empty($lang)) {
        return $lang;
    }

    if ($USER instanceof User) {
        $userlang = $USER->get_account_preference('lang');
        if ($userlang !== null && $userlang != 'default') {
            if (language_installed($userlang)) {
                $lang = $userlang;
            }
            else {
                $USER->set_account_preference('lang', 'default');
            }
        }
    }

    if (empty($lang) && is_a($SESSION, 'Session')) {
        $sesslang = $SESSION->get('lang');
        if (!empty($sesslang) && $sesslang != 'default') {
            $lang = $sesslang;
        }
    }

    if (empty($lang)) {
        $lang = !empty($CFG->lang) ? $CFG->lang : 'en.utf8';
    }

    // Set locale.  We are probably being called from get_string_location.
    // $lang had better be non-empty, or it will call us again.
    if ($args = split(',', get_string_location('locales', 'langconfig', array(), 'raw_langstring', $lang))) {
        array_unshift($args, LC_ALL);
        call_user_func_array('setlocale', $args);
    }

    return $lang;
}

 

cheers

anonymous profile picture
Deleted user
Posts: 808

22 July 2010, 5:28 PM

Antonio,

That's entirely possible.  I rewrote that function between 1.2.4 and 1.2.5 to get the server locale setting to change.

Without that setting it wasn't possible to get month names generated by php to be translated properly on a multi-language site.

What is your php version and OS?  Can I ask you to help with some debugging on your server?  I can't reproduce your problem on mine.

Richard.

anonymous profile picture
Deleted user
Posts: 808

12 August 2010, 6:33 PM

Hi Antonio,

Did you get any further with this problem?  Is there any chance you could try commenting out that line that sets the locale:

  call_user_func_array('setlocale', $args);

and see if that fixes the problem?

And if that does work, could you try uncommenting it again, and adding a locales string into the langconfig.php file for your language pack, and see if that helps?  Something like this:

 $string['locales'] = 'es_ES.UTF-8,spanish';
anonymous profile picture
Deleted user
Posts: 4

27 August 2010, 8:46 AM

This 2 solutions arn't working for me...

 

Eric

24 results