function newlanguage(&$renderer, &$request) { $locales = getlocales(); $header = T_('Language') . ' : <small>' . T_('New language') . '</small>'; $renderer->addvar('header', $header); $renderer->addvar('locales', $locales['locales']); $renderer->addvar('territories', $locales['territories']); $renderer->addvar('codesets', $locales['codesets']); $renderer->addvar('dateformats', $locales['dateformats']); $renderer->addvar('directions', $locales['directions']); $renderer->addvar('plural_forms', $locales['plural_forms']); $renderer->addvar('content', $renderer->fetch('langform.tpl.php')); }
<?php if (!function_exists("gettext")) { echo "gettext is not installed\n"; echo getlocales(); } else { echo "gettext is supported\n"; } ?> <ul> <li><a href="setlocale.php">setlocale</a> <li><a href="putenv.php">putenv</a> </ul>
function getlocale($locale = "") { return in_array($locale, getlocales()) ? $locale : app()->getlocale(); }