Post by jasminej » Fri Nov 25, 2016 2:31 am

I have a website which already works on 2 languages ,russian and english(everything runs well in both languages), now i have added armenian language.
The Problem --- when i switch on the website into armenain language , i see ,for example,in breadcrumbs

text_home button_continue button_login ....

i have checked \catalog\language\armen\armenian.php file and noticed that values of this varables exist.
By the way ,when i add from armenian.php into ,for example, language/armen/common/header .php this code

Code: Select all

$_['text_home']             = 'arm_home';
it works , but thit means that i should add by hand in every single page this general variable...
i would like to have more optimal solution ...

from admin panel i set armenain as default language


Maybe ,i should edit system\library\language.php ???
Here is the structure

Code: Select all

<?php
class Language {
	private $default = 'en-gb';
	private $directory;
	private $data = array();

	public function __construct($directory = '') {
		$this->directory = $directory;
	}

	public function get($key) {
		return (isset($this->data[$key]) ? $this->data[$key] : $key);
	}
	
	public function set($key, $value) {
		$this->data[$key] = $value;
	}
	
	// Please dont use the below function i'm thinking getting rid of it.
	public function all() {
		return $this->data;
	}
	
	// Please dont use the below function i'm thinking getting rid of it.
	public function merge(&$data) {
		array_merge($this->data, $data);
	}
			
	public function load($filename, &$data = array()) {
		$_ = array();

		$file = DIR_LANGUAGE . 'english/' . $filename . '.php';
		
		// Compatibility code for old extension folders
		$old_file = DIR_LANGUAGE . 'english/' . str_replace('extension/', '', $filename) . '.php';
		
		if (is_file($file)) {
			require($file);
		} elseif (is_file($old_file)) {
			require($old_file);
		}

		$file = DIR_LANGUAGE . $this->default . '/' . $filename . '.php';

		// Compatibility code for old extension folders
		$old_file = DIR_LANGUAGE . $this->default . '/' . str_replace('extension/', '', $filename) . '.php';
		
		if (is_file($file)) {
			require($file);
		} elseif (is_file($old_file)) {
			require($old_file);
		}

		$file = DIR_LANGUAGE . $this->directory . '/' . $filename . '.php';

		// Compatibility code for old extension folders
		$old_file = DIR_LANGUAGE . $this->directory . '/' . str_replace('extension/', '', $filename) . '.php';
		
		if (is_file($file)) {
			require($file);
		} elseif (is_file($old_file)) {
			require($old_file);
		}


		$this->data = array_merge($this->data, $_);

		return $this->data;
	}
}

Thank you in advance

New member

Posts

Joined
Wed Nov 09, 2016 2:56 am

Post by jasminej » Sun Nov 27, 2016 2:24 am

Really ??? No help ??? :-[ ???

New member

Posts

Joined
Wed Nov 09, 2016 2:56 am

Post by cyclops12 » Sun Nov 27, 2016 2:40 am

sounds like a problem with the armenian language package

is it the correct version for your version of opencart ??

have you a link to where you got the language then somebody might check it for you

Active Member

Posts

Joined
Sun Sep 27, 2015 1:10 am

Post by jasminej » Tue Nov 29, 2016 12:05 am

https://opencartforum.com/files/file/50 ... uage-pack/


this is the link of armenian language package ,it's v1.5.3.1
Another newer version of this language package i didn't find , i've also compared it with default english language package and didn't find any differences ,maybe i'm something missing...or is there any way to create a newer language pack ???
I really don't know how to solve this ...???

New member

Posts

Joined
Wed Nov 09, 2016 2:56 am

Post by cyclops12 » Tue Nov 29, 2016 1:55 am

Just looked at that link you supplied and spotted this
language.JPG

language.JPG (95.77 KiB) Viewed 1414 times

Have you tried this one: https://crowdin.com/project/opencart-tr ... n-v2/hy-AM#

Active Member

Posts

Joined
Sun Sep 27, 2015 1:10 am

Post by jasminej » Fri Dec 02, 2016 10:23 pm

Thanks for your help, i've solved this problem

P.S. I have also 2 another questions ,can you have a look at them ,please... :) :)

New member

Posts

Joined
Wed Nov 09, 2016 2:56 am
Who is online

Users browsing this forum: No registered users and 3 guests