Beispiel #1
0
function seChangeLocale()
{
    setLocalePath(dirname(__FILE__) . SLASH . 'locale', 'search_engine');
    _('ACTIVATE');
    _('HOST');
    _('LOGIN');
    _('PASSWD');
    _('BASE');
    _('PREFIX');
}
Beispiel #2
0
<?php

session_start();
include '../../../core/config.inc.php';
require SITE_PATH . 'core/lib/lib_functions.php';
require SITE_PATH . 'core/lib/lib_error.php';
if (isConnected()) {
    if (isset($_GET['action']) || isset($_POST['action'])) {
        require SITE_PATH . 'core/lib/pplugindir.php';
        require SITE_PATH . 'core/lib/ppage.php';
        require SITE_PATH . 'core/lib/localization.php';
        setLocalePath(dirname(__FILE__) . '/../locale', 'search_engine');
        $action = isset($_GET['action']) ? $_GET['action'] : $_POST['action'];
        switch ($action) {
            case 'initdatabase':
                if (!init()) {
                    printFatalHtmlError();
                }
                break;
            default:
                printFatalHtmlError('Action Unknown');
                break;
        }
    }
} else {
    printFatalHtmlError('You are not connected', 505);
}
die;
function init()
{
    require 'lib.searchengine.php';
Beispiel #3
0
<?php

if (!defined("LIB_LOCALIZATION")) {
    define("LIB_LOCALIZATION", 1);
    include SITE_PATH . 'core/config.inc.php';
    require SITE_PATH . 'vendors/php/phpgettext/gettext.inc.php';
    function setLocalePath($strPath = false, $strDomain = false)
    {
        $strDomain = !$strDomain ? 'messages' : $strDomain;
        $strPath = !$strPath ? SITE_PATH . 'core/locale' : $strPath;
        if (!is_dir($strPath)) {
            return setError(sprintf('Can not change the local path to %s. Directory not exists'), $strPath);
        }
        global $configFile;
        $locale = $configFile->getDirectParam('USER_LANGUAGE');
        T_setlocale(LC_ALL, $locale);
        bindtextdomain($strDomain, $strPath);
        // bind_textdomain_codeset is supported only in PHP 4.2.0+
        if (function_exists('bind_textdomain_codeset')) {
            bind_textdomain_codeset($strDomain, 'utf-8');
        }
        textdomain($strDomain);
        return true;
    }
    function mygetText($strWord)
    {
        return _($strWord);
    }
    setLocalePath();
}
//end define