Viewing file: lib-languages.inc.php (1.57 KB) -rwxr-xr-x Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php // $Revision: 1.1 $
/************************************************************************/
/* phpAdsNew 2 */
/* =========== */
/* */
/* Copyright (c) 2001 by the phpAdsNew developers */
/* http://sourceforge.net/projects/phpadsnew */
/* */
/* 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 2 of the License. */
/************************************************************************/
/*********************************************************/
/* Returns available languages as array */
/*********************************************************/
function phpAds_AvailableLanguages()
{
$languages = array();
$langdir = opendir("../language/");
while ($langfile = readdir($langdir))
{
if (is_dir("../language/$langfile"))
{
if (ereg("^([a-z0-9-]+)(_[a-z0-9-]+)?$", $langfile, $matches))
{
$languages[$langfile] = str_replace("- ", "-",
ucwords(str_replace("-", "- ", $matches[1]))).
(empty($matches[2]) ? '' : ' ('.ucwords(substr($matches[2], 1)).')');
}
}
}
closedir($langdir);
asort($languages, SORT_STRING);
return $languages;
}
?>
|