コード例 #1
0
ファイル: i18n.php プロジェクト: ajira86/movim
/**
 * Loads a .po file and adds the translations to the existing ones.
 * Conflicting translation strings will be rejected.
 */
function loadExtraLang($directory)
{
    global $translations;
    global $language;
    // Converting to unix path (simpler and portable.)
    $directory = str_replace('\\', '/', $directory);
    if ($directory[-1] != '/') {
        $directory .= '/';
    }
    $trans = parseLangFile($directory . $language . '.po');
    if (!$trans) {
        return false;
    }
    // Merging the arrays. The existing translations have priority.
    foreach ($trans as $msgid => $msgstr) {
        if (array_key_exists($msgid, $translations)) {
            continue;
        }
        $translations[$msgid] = $msgstr;
    }
    return true;
}
コード例 #2
0
ファイル: mud.php プロジェクト: christine-ho-dev/movim
function comploc()
{
    echo colorize("Locales compiler\n", 'green');
    $folder = CACHE_PATH . '/locales/';
    if (!file_exists($folder)) {
        $bool = mkdir($folder);
        if (!$bool) {
            echo colorize("The locales cache folder can't be created", 'red');
            exit;
        }
    } else {
        echo colorize("Folder already exist, don't re-create it\n", 'red');
    }
    $langs = loadLangArray();
    foreach ($langs as $key => $value) {
        $langarr = parseLangFile(DOCUMENT_ROOT . '/locales/' . $key . '.po');
        $out = '<?php global $translations;
        $translations = array(';
        foreach ($langarr as $msgid => $msgstr) {
            if ($msgid != '') {
                $out .= '"' . $msgid . '" => "' . $msgstr . '",' . "\n";
            }
        }
        $out .= ');';
        $fp = fopen($folder . $key . '.php', 'w');
        fwrite($fp, $out);
        fclose($fp);
        echo "- {$key} compiled\n";
    }
}
コード例 #3
0
ファイル: init.php プロジェクト: hungnv0789/vhtm
	define("ISC_CUSTOMER_ADDRESS_PER_PAGE", 10);
	define("ISC_SHIPMENTS_PER_PAGE", 20);
	define('ISC_VENDOR_PAYMENTS_PER_PAGE', 20);
	define('ISC_FORMFIELDS_PER_PAGE', 20);
	define('ISC_GROUPDISCOUNT_ITEMS_PER_PAGE', 50);
	define('ISC_EBAY_TEMPLATE_PER_PAGE', 10);
	define('ISC_EBAY_LISTING_PER_PAGE', 10);

	define("ISC_TINY_THUMB_SIZE", 48);

	$GLOBALS['SNIPPETS'] = "";

	parseLangFile(ISC_BASE_PATH.'/language/'.getConfig('Language').'/settings.ini');
	parseLangFile(ISC_BASE_PATH.'/language/'.getConfig('Language').'/common.ini');
	parseLangFile(ISC_BASE_PATH.'/language/'.getConfig('Language').'/admin/common.ini');
	parseLangFile(ISC_BASE_PATH.'/language/'.getConfig('Language').'/module_language.ini');

	$templatePath = ISC_BASE_PATH.'/admin/templates';

	// Control panel mobile interface is supported on the following devices:
	// iPhone, iPod Touch, Palm Pre and Android based devices
	$mobileDevice = getPortableDeviceType();
	$supportedDevices = array(
		'iphone',
		'ipod',
		'pre',
		'android'
	);
	if(is_array($mobileDevice) && in_array($mobileDevice['device'], $supportedDevices) && empty($_COOKIE['fullControlPanel'])) {
		if(!empty($_REQUEST['fullControlPanel'])) {
			ISC_SetCookie('fullControlPanel', 1);