public function getAllLanguages() {
		
		if (is_array($this->alllanguages)) {
			return $this->alllanguages;
		}
		
		// find languages file in a locales path
		$langfile = $this->localespath.'languages.txt';

		if (!file_exists($langfile)) {
			// if no in locales then use default from this package
			$langfile = dirname(__FILE__).'/languages.txt';
		}

		if (!file_exists($langfile)) {
			// if not found then show error or return empty array
			if ($this->errorondatamissed) {
				throw new \Exception('No languages file found');
			}
			return array();
		}
		
		// load a file
		$list = @file_get_contents($langfile);
		
		if (!$list) {
			// if somethign went wrong throw error or return empty array
			if ($this->errorondatamissed) {
				throw new \Exception('Can not load languages list');
			}
			return array();
		}
		
		$languages = array();
		
		foreach (preg_split('!\\r?\\n!',$list) as $line) {
			
			list ($code,$name) = explode('=',$line);
			
			$code = trim($code);
			$name = trim($name);
			
			if ($code == '' || $name == '') {
				continue;
			}
			
			$origname = $name;
			$tags = array();
			
			$splitsettings = explode(':',$name,3);
			
			if (count($splitsettings) > 1) {
				$name = $splitsettings[0];
				$origname = $splitsettings[1];
				
				if (isset($splitsettings[2]) && $splitsettings[2] != '') {
					$tags = explode(',',$splitsettings[2]);
				}
			}
			
			$flagfile = $this->localespath.'flags/small/'.$code.'.png';
			
			$hasflag = file_exists($flagfile);
			
			$languages[$code] = array(
				'code'=>$code,
				'name'=>$name,
				'origname'=>$origname,
				'hasflag'=>$hasflag,
				'tags' => $tags
				);
		}
		return $languages;
	}