WeakWiki


lib\lang.library.php

WeakWiki (WeakWiki Language support library: lang.library.php) Copyright (C) 2010 Alexander Lang This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, see . Project Home: http://weakwiki.robnet.wmweb.at/ Contact: robbiblubber@robnet.wmweb.at



/********************************************************************************
WeakWiki (WeakWiki Language support library: lang.library.php)
Copyright (C) 2010 Alexander Lang

This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation; either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this
program; if not, see .

Project Home: http://weakwiki.robnet.wmweb.at/
Contact:      robbiblubber@robnet.wmweb.at
********************************************************************************/



/** Path to language files.														*/
$GLOBALS['_lang_path']      = './lang/';

/** Default languge code.														*/
$GLOBALS['_lang_default']   = 'en';

/** Available languages.														*/
$GLOBALS['_lang_available'] = Array('en' => 'English',
                                    'de' => 'Deutsch');



/** Returns the language file for a given source file.
	@param $file	Source file name.
	@return			Language file path.											*/
function _lang($file)
{
	if(isset($_COOKIE['_lang_key']))
	{
		$f = $GLOBALS['_lang_path'] . $_COOKIE['_lang_key'] . '/' . $file . '.lang.php';
		
		if(file_exists($f))
		{
			return $f;
		} 
	}
	
	return $GLOBALS['_lang_path'] . $GLOBALS['_lang_default'] . '/' . $file . '.lang.php';
}

?>

WeakWiki