function ppqtrans_loadConfig()
{
    global $q_config;
    // Load everything
    $language_names = get_option('ppqtranslate_language_names');
    $enabled_languages = get_option('ppqtranslate_enabled_languages');
    $default_language = get_option('ppqtranslate_default_language');
    $flag_location = get_option('ppqtranslate_flag_location');
    $flags = get_option('ppqtranslate_flags');
    $locales = get_option('ppqtranslate_locales');
    $na_messages = get_option('ppqtranslate_na_messages');
    $date_formats = get_option('ppqtranslate_date_formats');
    $time_formats = get_option('ppqtranslate_time_formats');
    $use_strftime = get_option('ppqtranslate_use_strftime');
    $ignore_file_types = get_option('ppqtranslate_ignore_file_types');
    $url_mode = get_option('ppqtranslate_url_mode');
    $detect_browser_language = get_option('ppqtranslate_detect_browser_language');
    $hide_untranslated = get_option('ppqtranslate_hide_untranslated');
    $auto_update_mo = get_option('ppqtranslate_auto_update_mo');
    $term_name = get_option('ppqtranslate_term_name');
    $hide_default_language = get_option('ppqtranslate_hide_default_language');
    // default if not set
    if (!is_array($date_formats)) {
        $date_formats = $q_config['date_format'];
    }
    if (!is_array($time_formats)) {
        $time_formats = $q_config['time_format'];
    }
    if (!is_array($na_messages)) {
        $na_messages = $q_config['not_available'];
    }
    if (!is_array($locales)) {
        $locales = $q_config['locale'];
    }
    if (!is_array($flags)) {
        $flags = $q_config['flag'];
    }
    if (!is_array($language_names)) {
        $language_names = $q_config['language_name'];
    }
    if (!is_array($enabled_languages)) {
        $enabled_languages = $q_config['enabled_languages'];
    }
    if (!is_array($term_name)) {
        $term_name = $q_config['term_name'];
    }
    if (empty($ignore_file_types)) {
        $ignore_file_types = $q_config['ignore_file_types'];
    }
    if (empty($default_language)) {
        $default_language = $q_config['default_language'];
    }
    if (empty($use_strftime)) {
        $use_strftime = $q_config['use_strftime'];
    }
    if (empty($url_mode)) {
        $url_mode = $q_config['url_mode'];
    }
    if (!is_string($flag_location) || $flag_location === '') {
        $flag_location = $q_config['flag_location'];
    }
    $detect_browser_language = ppqtrans_validateBool($detect_browser_language, $q_config['detect_browser_language']);
    $hide_untranslated = ppqtrans_validateBool($hide_untranslated, $q_config['hide_untranslated']);
    $auto_update_mo = ppqtrans_validateBool($auto_update_mo, $q_config['auto_update_mo']);
    $hide_default_language = ppqtrans_validateBool($hide_default_language, $q_config['hide_default_language']);
    // url fix for upgrading users
    $flag_location = trailingslashit(preg_replace('#^wp-content/#', '', $flag_location));
    // check for invalid permalink/url mode combinations
    $permalink_structure = get_option('permalink_structure');
    if ($permalink_structure === "" || strpos($permalink_structure, '?') !== false || strpos($permalink_structure, 'index.php') !== false) {
        $url_mode = QT_URL_QUERY;
    }
    // overwrite default values with loaded values
    $q_config['date_format'] = $date_formats;
    $q_config['time_format'] = $time_formats;
    $q_config['not_available'] = $na_messages;
    $q_config['locale'] = $locales;
    $q_config['flag'] = $flags;
    $q_config['language_name'] = $language_names;
    $q_config['enabled_languages'] = $enabled_languages;
    $q_config['default_language'] = $default_language;
    $q_config['flag_location'] = $flag_location;
    $q_config['use_strftime'] = $use_strftime;
    $q_config['ignore_file_types'] = $ignore_file_types;
    $q_config['url_mode'] = $url_mode;
    $q_config['detect_browser_language'] = $detect_browser_language;
    $q_config['hide_untranslated'] = $hide_untranslated;
    $q_config['auto_update_mo'] = $auto_update_mo;
    $q_config['hide_default_language'] = $hide_default_language;
    $q_config['term_name'] = $term_name;
    do_action('ppqtranslate_loadConfig');
}
function qs_load()
{
    global $q_config, $qs_public_key;
    $ppqtranslate_services = get_option('ppqtranslate_ppqtranslate_services');
    $ppqtranslate_services = ppqtrans_validateBool($ppqtranslate_services, $q_config['ppqtranslate_services']);
    $q_config['ppqtranslate_services'] = $ppqtranslate_services && qs_isOpenSSLAvailable();
    if ($q_config['ppqtranslate_services'] && is_string($qs_public_key)) {
        $qs_public_key = openssl_get_publickey(join("\n", explode("|", $qs_public_key)));
    }
}