Exemple #1
0
function lang_get_failsave_custom_field($p_custom_field_name)
{
    if (lang_exists($p_custom_field_name, lang_get_current())) {
        $t_str = lang_get($p_custom_field_name);
    } else {
        $t_str = plugin_lang_get($p_custom_field_name);
    }
    return $t_str;
}
function lang_get($p_string)
{
    global $g_lang_strings;
    lang_ensure_loaded();
    # note in the current implementation we always return the same value
    #  because we don't have a concept of falling back on a language.  The
    #  language files actually *contain* English strings if none has been
    #  defined in the correct language
    //print_r($g_lang_strings);
    if (lang_exists($p_string)) {
        return $g_lang_strings[$p_string];
    } else {
        //trigger_error( ERROR_LANG_STRING_NOT_FOUND, E_USER_WARNING );
        return '';
    }
}
Exemple #3
0
/**
 * Get language:
 * - If found, return the appropriate string (as lang_get()).
 * - If not found, no default supplied, return the supplied string as is.
 * - If not found, default supplied, return default.
 * @param string $p_string
 * @param string $p_default
 * @param string $p_lang
 * @return string
 */
function lang_get_defaulted($p_string, $p_default = null, $p_lang = null)
{
    $t_lang = $p_lang;
    if (null === $t_lang) {
        $t_lang = lang_get_current();
    }
    # Now we'll make sure that the requested language is loaded
    lang_ensure_loaded($t_lang);
    if (lang_exists($p_string, $t_lang)) {
        return lang_get($p_string);
    } else {
        if (null === $p_default) {
            return $p_string;
        } else {
            return $p_default;
        }
    }
}
Exemple #4
0
    if(!$language) {

	$default_config = $_config = array();
	$default_configfile = './config/config_global_default.php';

	if(!file_exists(ROOT_PATH.$default_configfile)) {
		exit('config_global_default.php was lost, please reupload this  file.');
	} else {
		include ROOT_PATH.$default_configfile;
		$default_config = $_config;
	}

	$lang_list = $default_config['languages'];

	foreach($lang_list AS $id=>$l) {
		$lang_list[$id]['available'] = lang_exists($id) ? 1 : 0;
	}

	show_language($lang_list, $lng);



    } else {
	// Show the License
	transfer_ucinfo($_POST);
	show_license();
    }


} elseif($method == 'env_check') {