Post by burrito » Fri Feb 26, 2010 8:06 pm

to tackle the problems with google and multi-lingual shizzle, I have copied the system files for my shop into 2 folders, EN and NL, the codes for the 2 languages I use. Now I have made the EN folder default by making the NL folder look at some of the files in EN... just split enough to be able to run seperate languages.

I have also modified the language selector in the header to switch between the folders.

Now, the biggest thing is that I want to hardcode each folder onto a language, for this I guess I need to adapt

system\library\language.php

I also think it'll be somewhere here?

Code: Select all

public function load($filename) {
		$_ = array();
		
		// Get the current default filename (eg: english.php or cart.php)
		$dfn = ($filename == $this->languages[$this->code]['directory'])?D_LANG.'.php':$filename.'.php';
		
		// Include the default language first
		$dfile = DIR_LANGUAGE.D_LANG.DIRECTORY_SEPARATOR.$dfn;
		if (file_exists($dfile)) { include($dfile); }
		
		// Then include the specified language to override if exists
		//$file = $directory.$this->languages[$this->code]['directory'].DIRECTORY_SEPARATOR.$filename;
		$file = DIR_LANGUAGE . $this->languages[$this->code]['directory'] . '/' . $filename . '.php';
		// Check it's not the same as the default, and it exists, then include
		if (($dfile != $file) && file_exists($file)) { include($file); }
		
		// We have no languages, exit
		//if (empty($_)) { exit(sprintf(E_LANG,$filename)); }
		if (empty($_)) { echo sprintf(E_LANG,$filename); }
		
		$this->data = array_merge($this->data, $_);
  	}
Can anyone help me here? All I want to is to hardcode this to english, I can then modify it for Dutch and upload seperately...

I know this is a VERY crude work-around... but we are missing so many visitors and orders due to this issue that I need to have some sort of solution asap... and this is all I can think of....

again, the best solution would be for the country_code to be in the URL by default as a virtual folder or ?lang=xx this last part is available as a mod but that only ALLOWS the use of it, it doesn't always use it, this again, makes it impossible for google bots to read all languages.

Image
Opencart specialist | Our website | Our modules


User avatar
Active Member

Posts

Joined
Tue Dec 15, 2009 6:10 pm
Location - Amsterdam, The Netherlands
Who is online

Users browsing this forum: No registered users and 17 guests