AbanteCart Community

eCommerce construction => Installation and Configuration => Configuration => Topic started by: DJCyxapuk on October 28, 2012, 12:42:24 PM

Title: Russian language
Post by: DJCyxapuk on October 28, 2012, 12:42:24 PM
Установка проходит успешно, отключаю другие языки и ставлю русский по умолчанию. Ничего не меняется. Версия 1.1.1   устанавливал 1.0.1 тоже не помогло решить проблему

Installation is successful, disconnect other languages ​​and put the Russian default. Nothing changes. Version 1.1.1 installed 1.0.1 did not help solve the problem of a successful installation, turn off other languages, and put Russian default. Nothing changes. Version 1.1.1 installed 1.0.1 does not solve the problem, what to do?
Title: Re: Russian language
Post by: abantecart on October 28, 2012, 06:06:03 PM
I just discovered small bug in case if only 1 non English language is available. It was fixed in next version 1.1.2

For version 1.1.1 you can fix it in file public_html/core/lib/language.php

Open file and locate line #181. It reads:
Code: [Select]
foreach ( $this->available_languages as $lng ) {
$languages[ $lng['code'] ] = $lng;
}
Replace with:
Code: [Select]
foreach ( $this->getActiveLanguages() as $lng ) {
$languages[ $lng['code'] ] = $lng;
}

also replace method getActiveLanguages()

by this

Code: [Select]
public function getActiveLanguages() {
        $active_languages = array();
        foreach ($this->available_languages as $result) {
            if ($result['status'] == 1) {
                $active_languages[] =  array(
                    'language_id'   => $result['language_id'],
                    'name'  => $result['name'],
                    'filename'  => $result['filename'],
                    'code'  => $result['code'],
                    'image' => $result['image']
                );
            }
        }
        return $active_languages;
    }