From b1bf3aa54cd80c93bfbaa3a5f28ac5e471c627e2 Mon Sep 17 00:00:00 2001 From: spleen1981 <43221199+spleen1981@users.noreply.github.com> Date: Tue, 31 Aug 2021 00:13:52 +0200 Subject: [PATCH] Raw merge of qtranslate-slug 1.1.8 as qtranslate-xt module Initial merge with minimal modifications to both qtranslate-xt core and qtranslate-slug to incorporate the latter as a module. Module can be enabled through a checkbox in qtranslate-xt advanced settings. Heavy code cleanup and harmonization yet to be performed. Settings page also to be incorporated in qtranslate-xt page --- admin/qtx_admin_modules.php | 4 +- admin/qtx_admin_settings.php | 39 + modules/qtx_modules_handler.php | 21 +- modules/slugs/assets/css/qts-default.css | 16 + modules/slugs/assets/css/qts-default.min.css | 1 + modules/slugs/assets/css/qts-settings.css | 53 + modules/slugs/assets/js/qts-nav-menu-min.js | 1 + modules/slugs/assets/js/qts-nav-menu.js | 167 + .../slugs/assets/js/qts-settings-upgrade.js | 69 + modules/slugs/assets/js/qts-settings.js | 19 + .../includes/class-qtranslate-slug-widget.php | 62 + .../slugs/includes/class-qtranslate-slug.php | 2722 +++++++++++++++++ .../qtranslate-slug-settings-options.php | 179 ++ .../includes/qtranslate-slug-settings.php | 815 +++++ modules/slugs/includes/termmeta-core.php | 226 ++ modules/slugs/languages/qts-es_ES.mo | Bin 0 -> 5991 bytes modules/slugs/languages/qts-es_ES.po | 142 + modules/slugs/languages/qts-pt_PT.mo | Bin 0 -> 8618 bytes modules/slugs/languages/qts-pt_PT.po | 343 +++ modules/slugs/languages/qts.pot | 313 ++ modules/slugs/readme.txt | 296 ++ modules/slugs/slugs.php | 182 ++ modules/slugs/version.txt | 162 + qtranslate_core.php | 5 - qtranslate_options.php | 1 + 25 files changed, 5830 insertions(+), 8 deletions(-) create mode 100644 modules/slugs/assets/css/qts-default.css create mode 100644 modules/slugs/assets/css/qts-default.min.css create mode 100644 modules/slugs/assets/css/qts-settings.css create mode 100644 modules/slugs/assets/js/qts-nav-menu-min.js create mode 100644 modules/slugs/assets/js/qts-nav-menu.js create mode 100644 modules/slugs/assets/js/qts-settings-upgrade.js create mode 100644 modules/slugs/assets/js/qts-settings.js create mode 100644 modules/slugs/includes/class-qtranslate-slug-widget.php create mode 100644 modules/slugs/includes/class-qtranslate-slug.php create mode 100644 modules/slugs/includes/qtranslate-slug-settings-options.php create mode 100644 modules/slugs/includes/qtranslate-slug-settings.php create mode 100644 modules/slugs/includes/termmeta-core.php create mode 100644 modules/slugs/languages/qts-es_ES.mo create mode 100644 modules/slugs/languages/qts-es_ES.po create mode 100644 modules/slugs/languages/qts-pt_PT.mo create mode 100644 modules/slugs/languages/qts-pt_PT.po create mode 100644 modules/slugs/languages/qts.pot create mode 100644 modules/slugs/readme.txt create mode 100644 modules/slugs/slugs.php create mode 100644 modules/slugs/version.txt diff --git a/admin/qtx_admin_modules.php b/admin/qtx_admin_modules.php index eae9ec15..b38c4cb7 100644 --- a/admin/qtx_admin_modules.php +++ b/admin/qtx_admin_modules.php @@ -63,7 +63,9 @@ public static function check_module( $module_def, $func_is_active = 'is_plugin_a break; } } - } else { + } else if (is_bool($integration_plugin)){ + $active = $integration_plugin; + } else { $active = call_user_func( $func_is_active, $integration_plugin ); } diff --git a/admin/qtx_admin_settings.php b/admin/qtx_admin_settings.php index 7fe5fb39..63a0b652 100644 --- a/admin/qtx_admin_settings.php +++ b/admin/qtx_admin_settings.php @@ -244,6 +244,8 @@ private function add_configuration_inspector() { } private function add_sections( $nonce_action ) { + global $q_config; + $admin_sections = array(); $admin_sections['general'] = __( 'General', 'qtranslate' ); $admin_sections['advanced'] = __( 'Advanced', 'qtranslate' ); @@ -256,6 +258,10 @@ private function add_sections( $nonce_action ) { $admin_sections['integration'] = __( 'Integration', 'qtranslate' ); $admin_sections['import'] = __( 'Import', 'qtranslate' ) . '/' . __( 'Export', 'qtranslate' ); $admin_sections['languages'] = __( 'Languages', 'qtranslate' ); + + if ($q_config['slugs_enabled']) + $admin_sections['slugs'] = __( 'Slugs', 'qtranslate' ); + $admin_sections['troubleshooting'] = __( 'Troubleshooting', 'qtranslate' ); ?> @@ -272,6 +278,10 @@ private function add_sections( $nonce_action ) { $this->add_general_section(); $this->add_advanced_section(); $this->add_integration_section(); + + if ($q_config['slugs_enabled']) + $this->add_slugs_section(); + $this->add_troubleshooting_section(); // Allow to load additional services do_action( 'qtranslate_configuration', $this->options_uri ); @@ -693,6 +703,17 @@ private function add_advanced_section() { printf( __( 'The color in use is taken from your profile option %s, the third color.', 'qtranslate' ), '"' . qtranxf_translate_wp( 'Admin Color Scheme' ) . '"' ) ?>
++ |
+ here.', 'qtranslate' ), get_admin_url().'options-general.php?page=qtranslate-slug-settings' ) ?> + |
+
---|
'+_response.message+'
'); + upgrade_box.delay(2500).fadeTo(1300, 0, function(){ upgrade_box.remove(); }); + break; + case 2: + var data_ = ' '; + data_ += ''; + + upgrade_form.prepend(data_); + + break; + } + }, + start_upgrade = function(_event) { + _event.preventDefault(); + + notice_status('updated'); + block_form(true); + + var package_ = {}; + package_.action = $('#qts-upgrade-action').val(); + package_.nonce = $('#qts-upgrade-nonce').val(); + if ( $('#qts-slug-type').length ) + package_.type = $('#qts-slug-type').val(); + + $.post(ajaxurl, package_, check_types); + }; + + upgrade_button.bind('click', start_upgrade); +}); \ No newline at end of file diff --git a/modules/slugs/assets/js/qts-settings.js b/modules/slugs/assets/js/qts-settings.js new file mode 100644 index 00000000..56caa3e1 --- /dev/null +++ b/modules/slugs/assets/js/qts-settings.js @@ -0,0 +1,19 @@ +/*############### Error messages ######################*/ +jQuery(function(){ + + var error_msg = jQuery("#message p[class='setting-error-message']"); + // look for admin messages with the "setting-error-message" error class + if (error_msg.length != 0) { + // get the title + var error_setting = error_msg.attr('title'); + + // look for the label with the "for" attribute=setting title and give it an "error" class (style this in the css file!) + jQuery("label[for='" + error_setting + "']").addClass('error'); + + // look for the input with id=setting title and add a red border to it. + jQuery("input[id='" + error_setting + "']").attr('style', 'border-color: red'); + } + + + +}); \ No newline at end of file diff --git a/modules/slugs/includes/class-qtranslate-slug-widget.php b/modules/slugs/includes/class-qtranslate-slug-widget.php new file mode 100644 index 00000000..f2727fd1 --- /dev/null +++ b/modules/slugs/includes/class-qtranslate-slug-widget.php @@ -0,0 +1,62 @@ + 'qts_widget', 'description' => __('Allows your visitors to choose a Language.','qts') ); + parent::__construct('qtranslateslug', __('Language selector (QTS)', 'qts'), $widget_ops); + } + + function widget($args, $instance) { + extract($args); + + echo $before_widget; + $title = empty($instance['title']) ? __('Language', 'qts') : apply_filters('widget_title', $instance['title']); + $hide_title = empty($instance['hide-title']) ? false : 'on'; + $type = $instance['type']; + $short_text = ($instance['short_text'] == 'on') ? true : false ; + + if( $type!='text' && $type!='image' && $type!='both' && $type!='dropdown' ) $type='text'; + + if( $hide_title!='on') + echo $before_title . $title . $after_title; + + qts_language_menu($type, array( 'id' => $this->id, 'short' => $short_text ) ); + + echo $after_widget; + } + + function update($new_instance, $old_instance) { + $instance = $old_instance; + $instance['title'] = $new_instance['title']; + $instance['hide-title'] = $new_instance['hide-title']; + $instance['type'] = $new_instance['type']; + $instance['short_text'] = $new_instance['short_text']; + + return $instance; + } + + function form($instance) { + $instance = wp_parse_args( (array) $instance, array( 'title' => '', 'hide-title' => false, 'type' => 'text' ) ); + $title = $instance['title']; + $hide_title = $instance['hide-title']; + $type = $instance['type']; + $short_text = isset($instance['short_text']) ? $instance['short_text'] : ''; + ?> + + + + + + + + + + lang) ? $this->lang : $this->current_lang; + } + + /** + * return the current / temp language + * we store and use it all the way! + * @since 1.1.9 + */ + private function get_currentlang() { + return $this->current_lang; + } + + /** + * return the enabled languages + * we store and use it all the way! + * @since 1.1.9 + */ + private function get_enabled_languages() { + return $this->enabled_languages; + } + + /** + * return the enabled languages + * we store and use it all the way! + * @since 1.1.9 + */ + private function get_url_path_mode() { + return $this->url_path_mode; + } + + /** + * getter: options + * @since 1.0 + */ + public function get_options() { + $this->set_options(); + return $this->options; + } + + /** + * Returns the correct prefix for the function names of the different supported translation plugins. + * Will return 'qtranxf_' if qtranslate-x is used, 'qtrans_' otherwise. + * + * @return string the function name prefix for translation functions from other plugins + * @since 1.1.9 + */ + + private function get_plugin_prefix(){ + + return $this->plugin_prefix; + } + + + /** + * setter: options | permalink_structure + * + * @since 1.0 + */ + public function set_options() { + + if (empty($this->options)) { + $this->options = get_option(QTS_OPTIONS_NAME); + } + + if (!$this->options) { + add_option(QTS_OPTIONS_NAME, array()); + } + + if (is_null($this->permalink_structure)) { + $this->permalink_structure = get_option('permalink_structure'); + } + } + + /** + * Sets the prefix for the active fork. See get_plugin_prefix + * @since 1.1.9 + * + */ + private function set_plugin_prefix(){ + if ('' === $this->plugin_prefix){ + if (is_plugin_active('qtranslate-x/qtranslate.php') || defined( 'QTRANSLATE_FILE' ) ){ + $this->plugin_prefix = 'qtranxf_'; + } else { + $this->plugin_prefix = 'qtrans_'; + } + } + } + + /** + * Sets the url path mode based on the qtranslate or fork settings. + * + */ + + private function set_url_path_mode(){ + if ('' === $this->url_path_mode){ + if (is_plugin_active('qtranslate-x/qtranslate.php') || defined( 'QTRANSLATE_FILE' ) ){ + $this->url_path_mode = QTX_URL_PATH; + } else { + $this->url_path_mode = QT_URL_PATH; + } + } + } + + /** + * setter: options | permalink_structure + * + * @since 1.0 + */ + public function save_options($new_options = false) { + if (!$new_options || empty($new_options)) { + return; + } + + if (count($this->options) != count($new_options)) { + return; + } + + update_option(QTS_OPTIONS_NAME, $new_options); + $this->options = $new_options; + } + + + + /** + * getter: meta key + * + * @since 1.0 + */ + public function get_meta_key( $force_lang = false ) { + + $lang = $this->get_lang(); + + if ($force_lang) { + $lang = $force_lang; + } + + return sprintf($this->meta_key, $lang); // returns: _qts_slug_en + } + + + + /** + * check dependences for activation + * + * @since 1.0 + */ + static function block_activate() { + global $wp_version; + include_once( ABSPATH . 'wp-admin/includes/plugin.php' ); + return ( + version_compare($wp_version, "4.0", "<" ) || + !( defined( 'QTRANSLATE_FILE' ) || + ( is_plugin_active('qtranslate/qtranslate.php') || + is_plugin_active('qtranslate/qtranslate-x.php') || + is_plugin_active('mqtranslate/mqtranslate.php') || + is_plugin_active('qtranslate-x/qtranslate.php')) ) + ); + } + + + + + /** + * check if exists qtranslate and do the installation, support multisite + * + * @since 1.0 + */ + public function install() { + global $wpdb; + + /*if ( self::block_activate() ) { + if (is_admin()) { + add_action('admin_notices', array(&$this, 'notice_dependences')); + } + }*/ + + if ( function_exists('is_multisite') && is_multisite() ) { + + if (isset($_GET['networkwide']) && ($_GET['networkwide'] == 1)) { + + $old_blog = $wpdb->blogid; + $blogids = $wpdb->get_col($wpdb->prepare("SELECT blog_id FROM $wpdb->blogs")); + foreach ($blogids as $blog_id) { + switch_to_blog($blog_id); + $this->activate(); + } + switch_to_blog($old_blog); + return; + } + } + + $this->activate(); + } + + + + /** + * activates and do the installation + * + * @since 1.0 + */ + private function activate() { + global $wp_rewrite; + + $this->set_options(); + + $qts_version = get_option('qts_version'); + + // checks version and do the installation + if ( !$qts_version || $qts_version != QTS_VERSION ) { + + // install termmeta table using functions from Simple-Term-Meta + // ( http://wordpress.org/extend/plugins/simple-term-meta/ ) + install_term_meta_table(); + + // update installed option + update_option('qts_version', QTS_VERSION); + } + + // regenerate rewrite rules in db + add_action( 'generate_rewrite_rules', array(&$this, 'modify_rewrite_rules') ); + flush_rewrite_rules(); + } + + + + /** + * register front end styles and enqueue + * + * @since 1.1.7 + */ + public function register_plugin_styles() { + wp_register_style( 'qts_front_styles', plugins_url( '/assets/css/qts-default.css', dirname(__FILE__ ) ) ); + wp_enqueue_style( 'qts_front_styles' ); + } + /** + * register minified front end styles and enqueue + * 43LC: easier duplicating the function :| + * @since 1.1.8 + */ + public function register_plugin_styles_min() { + wp_register_style( 'qts_front_styles', plugins_url( '/assets/css/qts-default.min.css', dirname(__FILE__ ) ) ); + wp_enqueue_style( 'qts_front_styles' ); + } + + + + /** + * print front end styles + * + * @since 1.1.7 + */ + public function print_plugin_styles() { + + $css_path = dirname(__FILE__).'/assets/css/qts-default.css'; + + if (!file_exists($css_path) || !is_readable($css_path)) { + return; + } + + $default_css_file = file_get_contents($css_path, FILE_USE_INCLUDE_PATH); + + $css = "\n"; + echo $css; + } + + + + /** + * actions when deactivating the plugin + * + * @since 1.0 + */ + public function deactivate() { + global $wp_rewrite; + + // regenerate rewrite rules in db + remove_action( 'generate_rewrite_rules', array(&$this, 'modify_rewrite_rules') ); + $wp_rewrite->flush_rules(); + } + + + + /** + * admin notice: update your old data + * + * @since 1.0 + */ + function notice_update(){ + global $current_screen; + + if ($current_screen->id != 'settings_page_qtranslate-slug-settings') { + + echo "Qtranslate Slug:
" . PHP_EOL; + printf("%s %s
", __('Please update your old data to the new system.', 'qts'), add_query_arg(array('page' => 'qtranslate-slug-settings'), 'options-general.php'), __('upgrade now', 'qts')) . PHP_EOL; + echo "Qtranslate Slug:
' . PHP_EOL; + echo ''; + printf(__('This plugin requires at least %s and either %s, or %s, or %s', 'qts'), + 'WordPress 4.0', + 'qTranslate-X (2.9 '.$ornewer.')', + 'mqTranslate (2.6.2.4 '.$ornewer.')', + 'qTranslate (2.5.8 '.$ornewer.')'); + echo '
' . PHP_EOL; + echo '" . PHP_EOL; + echo " | " . PHP_EOL; + echo " |
---|
" . PHP_EOL; + echo " |
---|
'; + foreach($q_config['enabled_languages'] as $id => $language) { + $checked = ($language == $q_config['language']) ? ' checked="checked"' : ''; + echo '
'; + echo '
'; + } + echo ''; + echo '
'; + echo ''; + } + + + + /** + * Language select function for templating + * + * @param $type (string) choose the type of menu: 'text', 'image', 'both', 'dropdown' + * @param $args (array) some args for draw the menu: array( 'id', 'class', 'short' ); + * + * @since 1.0 + */ + public function language_menu( $type = "text", $args = array() ) { + global $q_config; + + + // default arguments + $defaults = array( + 'id' => "qts-lang-menu", + 'class' => "qts-lang-menu", + 'short' => false + ); + $args = wp_parse_args( $args, $defaults ); + + $languages = call_user_func($this->get_plugin_prefix() . 'getSortedLanguages'); + + // every type + switch ( $type ) { + + case 'image': + case 'text': + case 'both': + + $baseurl = dirname(plugins_url()); + $num_languages = count($languages); + echo "http://example.org/%s/some-%s/
', 'qts' ), $post_type->name, $post_type->name),
+ 'class' => 'qts-slug',
+ "type" => "multi-text",
+ "choices" => get_multi_txt_choices( $post_type->name),
+ "std" => ""
+ );
+
+ endforeach;
+ // end each post type
+
+ $options[] = array(
+ "section" => "taxonomies",
+ "id" => QTS_PREFIX . "taxonomy_category",
+ "title" => __( 'Categories', 'qts' ),
+ "desc" => __( 'http://example.org/category/some-category/
', 'qts' ),
+ "type" => "multi-text",
+ 'class' => 'qts-slug',
+ "choices" => get_multi_txt_choices('category'),
+ "std" => ""
+ );
+
+ $options[] = array(
+ "section" => "taxonomies",
+ "id" => QTS_PREFIX . "taxonomy_post_tag",
+ "title" => __( 'Tags', 'qts' ),
+ "desc" => __( 'http://example.org/tag/some-tag/
', 'qts' ),
+ "type" => "multi-text",
+ 'class' => 'qts-slug',
+ "choices" => get_multi_txt_choices('post_tag'),
+ "std" => ""
+ );
+
+
+ $taxonomies = get_taxonomies( array( 'public' => true, 'show_ui' => true, '_builtin' => false ), 'object' );
+
+ // each extra taxonomy
+ foreach ($taxonomies as $taxonomy):
+
+ $options[] = array(
+ "section" => "taxonomies",
+ "id" => QTS_PREFIX . "taxonomy_" . $taxonomy->name,
+ "title" => $taxonomy->labels->singular_name,
+ "desc" => sprintf( __( 'http://example.org/%s/some-%s/
', 'qts' ), $taxonomy->name, $taxonomy->name ),
+ "type" => "multi-text",
+ 'class' => 'qts-slug',
+ "choices" => get_multi_txt_choices( $taxonomy->name),
+ "std" => ""
+ );
+
+ endforeach;
+ // end each extra taxonomy
+
+
+ return $options;
+}
+
+
+
+/**
+ * Contextual Help
+ *
+ * @package Qtranslate Slug
+ * @subpackage Settings
+ * @version 1.0
+ *
+ */
+function qts_options_page_contextual_help() {
+
+
+ $text = "" . __('Contextual help goes here. You may want to use different html elements to format your text as you want.','qts') . "
"; + + return $text; +} \ No newline at end of file diff --git a/modules/slugs/includes/qtranslate-slug-settings.php b/modules/slugs/includes/qtranslate-slug-settings.php new file mode 100644 index 00000000..dbcc2d10 --- /dev/null +++ b/modules/slugs/includes/qtranslate-slug-settings.php @@ -0,0 +1,815 @@ + 'default_field', // the ID of the setting in our options array, and the ID of the HTML form element + 'title' => 'Default Field', // the label for the HTML form element + 'desc' => 'This is a default description.', // the description displayed under the HTML form element + 'std' => '', // the default value for this setting + 'type' => 'text', // the HTML form element to use + 'section' => 'main_section', // the section this setting belongs to must match the array key of a section in qts_options_page_sections() + 'choices' => array(), // (optional): the values in radio buttons or a drop-down menu + 'class' => '' // the HTML form element class. Is used for validation purposes and may be also use for styling if needed. + ); + + // "extract" to be able to use the array keys as variables in our function output below + extract( wp_parse_args( $args, $defaults ) ); + + // additional arguments for use in form field output in the function qts_show_form_field! + $field_args = array( + 'type' => $type, + 'id' => $id, + 'desc' => $desc, + 'std' => $std, + 'choices' => $choices, + 'label_for' => $id, + 'class' => $class + ); + + + + add_settings_field( $id, $title, 'qts_show_form_field', __FILE__, $section, $field_args ); + +} + + + +/** + * Register our setting, settings sections and settings fields + * + * @package Qtranslate Slug + * @subpackage Settings + * @version 1.0 + * + */ +function qts_register_settings(){ + + // get the settings sections array + $settings_output = qts_get_settings(); + $qts_option_name = $settings_output['qts_option_name']; + + //setting + register_setting($qts_option_name, $qts_option_name, 'qts_validate_options' ); + + //sections + if(!empty($settings_output['qts_page_sections'])){ + // call the "add_settings_section" for each! + foreach ( $settings_output['qts_page_sections'] as $id => $title ) { + add_settings_section( $id, $title, 'qts_section_fn', __FILE__); + } + } + + //fields + if(!empty($settings_output['qts_page_fields'])){ + // call the "add_settings_field" for each! + foreach ($settings_output['qts_page_fields'] as $option) { + qts_create_settings_field($option); + } + } + //style + if(!empty($settings_output['qts_page_styles'])){ + // call the "add_settings_field" for each + foreach ($settings_output['qts_page_styles'] as $styleoption) { + qts_create_settings_field($styleoption); + } + } +} +add_action( 'admin_init', 'qts_register_settings' ); + + + +/** + * Group scripts (js & css) + * + * @package Qtranslate Slug + * @subpackage Settings + * @version 1.0 + * + */ +function qts_settings_scripts() { + global $qtranslate_slug; + + wp_enqueue_style('qts_theme_settings_css', plugins_url( 'assets/css/qts-settings.css' , dirname(__FILE__) ) ); + wp_enqueue_script( 'qts_theme_settings_js', plugins_url( 'assets/js/qts-settings.js' , dirname(__FILE__) ), array('jquery')); + + /** + * @deprecated + */ + if ($qtranslate_slug->check_old_data()) { + wp_enqueue_script('qts_theme_settings_upgrade_js', plugins_url( 'assets/js/qts-settings-upgrade.js' , dirname(__FILE__) ), array('jquery') ); + } +} + +add_action( 'admin_head', 'qts_settings_scripts' ); + +/** + * The Admin menu page + * + * @package Qtranslate Slug + * @subpackage Settings + * @version 1.0 + * + */ +function qts_add_menu() { + global $current_screen; + + $settings_output = qts_get_settings(); + // collect our contextual help text + $qts_contextual_help = $settings_output['qts_contextual_help']; + + // Display Settings Page link under the "Appearance" Admin Menu + $qts_settings_page = add_options_page(__('Qtranslate Slug options', 'qts'), __('Slug options', 'qts'), 'manage_options', QTS_PAGE_BASENAME, 'qts_show_settings_page'); +} +add_action( 'admin_menu', 'qts_add_menu' ); + + + +//////////////////////////////////////////////////////////////////////////////////////// + +// Callback functions + + + +/** + * Section HTML, displayed before the first option + * + * @package Qtranslate Slug + * @subpackage Settings + * @version 1.0 + * + * @return echoes output + */ +function qts_section_fn($page_section = false) { + + if ( !$page_section || !isset($page_section['id']) ) return; + + switch ($page_section['id']) { + case 'post_types': + + echo "" . __('For example, the post_type books, in Spanish would be displayed as http://example.org/es/libros/post-type-name/
. If you leave this blank will use the default option when you registered the post_type.', 'qts') . "
" . __('For example, the taxonomy category, in Spanish would be displayed as http://example.org/es/categoria/taxonomy-name/
. If you leave this blank will use the default option when you registered the taxonomy (if you previously setup a base permastruct for categories or tags in permalinks page, these bases will be overwritten by the translated ones).', 'qts') . "
" . __('The default styles are very minimal, and you can include them or not.', 'qts') . "
\n"; + break; + } +} + + + +/** + * Form Fields HTML: all form field types share the same function + * + * @package Qtranslate Slug + * @subpackage Settings + * @version 1.0 + * + * @return echoes output + */ +function qts_show_form_field($args = array()) { + global $qtranslate_slug; + + extract( $args ); + + // get the settings sections array + $settings_output = qts_get_settings(); + $options = $qtranslate_slug->get_options(); + + // pass the standard value if the option is not yet set in the database + if ( !isset( $options[$id] ) && 'type' != 'checkbox' ) { + $options[$id] = $std; + } + + // additional field class. output only if the class is defined in the create_setting arguments + $field_class = ($class != '') ? ' ' . $class : ''; + + // switch html display based on the setting type. + switch ( $type ) { + case 'text': + $options[$id] = stripslashes($options[$id]); + $options[$id] = esc_attr( $options[$id]); + echo ""; + echo ($desc != '') ? "pretty permalinks, in this section you can translate the URLs bases for public post_types, categories, tags and taxonomies.', 'qts'); ?>
+ + +" . $set_errors[0]['message'] . "
", 'updated'); + + // have errors been found? + }else{ + // there maybe more than one so run a foreach loop. + foreach($set_errors as $set_error){ + // set the title attribute to match the error "setting title" - need this in js file + qts_show_msg(" ", 'error'); + } + } + } +} +add_action('admin_notices', 'qts_admin_msgs'); diff --git a/modules/slugs/includes/termmeta-core.php b/modules/slugs/includes/termmeta-core.php new file mode 100644 index 00000000..a0716df1 --- /dev/null +++ b/modules/slugs/includes/termmeta-core.php @@ -0,0 +1,226 @@ +supports_collation())//deprecated, was a reason for activation admin notice + if($wpdb->has_cap( 'collation' )) { + if(!empty($wpdb->charset)) $collate = "DEFAULT CHARACTER SET $wpdb->charset"; + if(!empty($wpdb->collate)) $collate .= " COLLATE $wpdb->collate"; + } + + $sql = "CREATE TABLE IF NOT EXISTS ". $wpdb->prefix . "termmeta" ." ( + `meta_id` bigint(20) NOT NULL AUTO_INCREMENT, + `term_id` bigint(20) NOT NULL DEFAULT '0', + `meta_key` varchar(255) NULL, + `meta_value` longtext NULL, + PRIMARY KEY id (`meta_id`), + KEY term_id (term_id), + KEY meta_key (meta_key($max_index_length)) + ) $collate;"; + $wpdb->query($sql); +} +endif; + + + +function simple_post_meta_define_table() { + global $wpdb; + $wpdb->termmeta = $wpdb->prefix . 'termmeta'; +} +add_action( 'init', 'simple_post_meta_define_table' ); + + + +/** + * Updates metadata cache for list of term IDs. + * + * Performs SQL query to retrieve the metadata for the term IDs and updates the + * metadata cache for the terms. Therefore, the functions, which call this + * function, do not need to perform SQL queries on their own. + * + * @param array $term_ids List of post IDs. + * @return bool|array Returns false if there is nothing to update or an array of metadata. + */ +if ( !function_exists('update_termmeta_cache') ): + function update_termmeta_cache($term_ids) { + return update_meta_cache('term', $term_ids); + } +endif; + + + +/** + * Add meta data field to a term. + * + * @param int $term_id Term ID. + * @param string $key Metadata name. + * @param mixed $value Metadata value. + * @param bool $unique Optional, default is false. Whether the same key should not be added. + * @return bool False for failure. True for success. + */ +if ( !function_exists('add_term_meta') ): + function add_term_meta( $term_id, $meta_key, $meta_value, $unique = false ) { + return add_metadata('term', $term_id, $meta_key, $meta_value, $unique); + } +endif; + + + +/** + * Remove metadata matching criteria from a term. + * + * You can match based on the key, or key and value. Removing based on key and + * value, will keep from removing duplicate metadata with the same key. It also + * allows removing all metadata matching key, if needed. + * + * @param int $term_id Term ID + * @param string $meta_key Metadata name. + * @param mixed $meta_value Optional. Metadata value. + * @return bool False for failure. True for success. + */ +if ( !function_exists('delete_term_meta') ): + function delete_term_meta( $term_id, $meta_key, $meta_value = '' ) { + return delete_metadata('term', $term_id, $meta_key, $meta_value); + } +endif; + + + +/** + * Retrieve term meta field for a term. + * + * @param int $term_id Term ID. + * @param string $key The meta key to retrieve. + * @param bool $single Whether to return a single value. + * @return mixed Will be an array if $single is false. Will be value of meta data field if $single + * is true. + */ +if ( !function_exists('get_term_meta') ): + function get_term_meta( $term_id, $key, $single = false ) { + return get_metadata('term', $term_id, $key, $single); + } +endif; + + + +/** + * Update term meta field based on term ID. + * + * Use the $prev_value parameter to differentiate between meta fields with the + * same key and term ID. + * + * If the meta field for the term does not exist, it will be added. + * + * @param int $term_id Term ID. + * @param string $key Metadata key. + * @param mixed $value Metadata value. + * @param mixed $prev_value Optional. Previous value to check before removing. + * @return bool False on failure, true if success. + */ +if ( !function_exists('update_term_meta') ): + function update_term_meta( $term_id, $meta_key, $meta_value, $prev_value = '' ) { + return update_metadata('term', $term_id, $meta_key, $meta_value, $prev_value); + } +endif; + + + +/** + * Delete everything from term meta matching meta key. + * + * @param string $term_meta_key Key to search for when deleting. + * @return bool Whether the term meta key was deleted from the database + */ +if ( !function_exists('delete_term_meta_by_key') ): + function delete_term_meta_by_key($term_meta_key) { + if ( !$term_meta_key ) + return false; + + global $wpdb; + $term_ids = $wpdb->get_col($wpdb->prepare("SELECT DISTINCT term_id FROM $wpdb->termmeta WHERE meta_key = %s", $term_meta_key)); + if ( $term_ids ) { + $termmetaids = $wpdb->get_col( $wpdb->prepare( "SELECT meta_id FROM $wpdb->termmeta WHERE meta_key = %s", $term_meta_key ) ); + $in = implode( ',', array_fill(1, count($termmetaids), '%d')); + do_action( 'delete_termmeta', $termmetaids ); + $wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->termmeta WHERE meta_id IN($in)", $termmetaids )); + do_action( 'deleted_termmeta', $termmetaids ); + foreach ( $term_ids as $term_id ) + wp_cache_delete($term_id, 'term_meta'); + return true; + } + return false; + } +endif; + + + +/** + * Retrieve term meta fields, based on term ID. + * + * The term meta fields are retrieved from the cache, so the function is + * optimized to be called more than once. It also applies to the functions, that + * use this function. + * + * @param int $term_id term ID + * @return array + */ +if ( !function_exists('add_term_meta') ): + function get_term_custom( $term_id ) { + $term_id = (int) $term_id; + + if ( ! wp_cache_get($term_id, 'term_meta') ) + update_termmeta_cache($term_id); + + return wp_cache_get($term_id, 'term_meta'); + } +endif; + + + +/** + * Retrieve meta field names for a term. + * + * If there are no meta fields, then nothing (null) will be returned. + * + * @param int $term_id term ID + * @return array|null Either array of the keys, or null if keys could not be retrieved. + */ +if ( !function_exists('get_term_custom_keys') ): + function get_term_custom_keys( $term_id ) { + $custom = get_term_custom( $term_id ); + + if ( !is_array($custom) ) + return; + + if ( $keys = array_keys($custom) ) + return $keys; + } +endif; + + + +/** + * Retrieve values for a custom term field. + * + * The parameters must not be considered optional. All of the term meta fields + * will be retrieved and only the meta field key values returned. + * + * @param string $key Meta field key. + * @param int $term_id Term ID + * @return array Meta field values. + */ +if ( !function_exists('get_term_custom_values') ): + function get_term_custom_values( $key = '', $term_id ) { + if ( !$key ) + return null; + + $custom = get_term_custom($term_id); + + return isset($custom[$key]) ? $custom[$key] : null; + } +endif; \ No newline at end of file diff --git a/modules/slugs/languages/qts-es_ES.mo b/modules/slugs/languages/qts-es_ES.mo new file mode 100644 index 0000000000000000000000000000000000000000..e702170fb22cb368758195da542b3bbd2b088a70 GIT binary patch literal 5991 zcmd6r&5s;M8O93|KH@+i0m4TDls5#~%FfJsjpJlkkK%0BiNzW_-gP2~gsGXXooTzL ztKHST>&X>?#05COi39QhiA4B-IDm2;E{Gc!Zb(Q7!T|~R0}#Krx_f5U_Budv$Y^(- z>F%kjx89HEeQN&r(7iuWybkmKDF0u0k5V0Q`MtdHdJ|j){|5HJNAFSUOW-Tu%is?{ z4ZaDU2JgF9sV{IJ}I<0i6iJYdOgDT}?=uS`vao#6TV^b^CMww1;8g<4()^UXNgrken3(XN7
z8YO%rbC!_utE{lB4WwkW^~LlC?49U{@olw5A$j_((Pb)pDpgpHr>`MV9mU1vj@flN
z4FH;&-W*!OF&|V9p(D=*$>JhgBg~*s7&kTtP9*c&Dqzd-o7k5u=-1l>tfqr*_{>ay
z;S$;87;?@Hb{Sd6kyZyBW!_r7ZpCQRD=1(* This plugin requires qTranslate to be installed and activated. Este plugin necesita qTranslate instalado y activado previamente.kI
http://example.org/%s/some-%s/
"
+msgstr "http://ejemplo.org/%s/algun-%s/
"
+
+# qtranslate-slug-settings-options.php
+msgid "http://example.org/category/some-category/
"
+msgstr "http://ejemplo.org/categoria/alguna-categoria/
"
+
+# qtranslate-slug-settings-options.php
+msgid "http://example.org/tag/some-tag/
"
+msgstr "http://ejemplo.org/etiqueta/alguna-etiqueta/
"
+
+# qtranslate-slug-settings.php
+msgid "Qtranslate Slug options"
+msgstr "Opciones de Qtranslate Slug"
+
+# qtranslate-slug-settings.php
+msgid "Slug options"
+msgstr "Opciones de URL"
+
+# qtranslate-slug-settings.php
+msgid "Save Changes"
+msgstr "Guardar cambios"
+
+# qtranslate-slug-settings.php
+msgid "Expecting a Numeric value! Please fix."
+msgstr "Se espera un valor numérico! Por favor, corrígelo."
+
+# qtranslate-slug-settings.php
+msgid "Expecting comma separated numeric values! Please fix."
+msgstr "Se esperan valores numéricos separados por coma! Por favor, corrígelo."
+
+# qtranslate-slug-settings.php
+msgid "Invalid email"
+msgstr "E-mail incorrecto"
+
+# qtranslate-slug-settings.php
+msgid "This setting field cannot be empty! Please enter a valid email address."
+msgstr "Este campo no puede estar vacío! Por favor introduce una dirección de e-mail válida."
+
+# qtranslate-slug-settings.php
+msgid "Please enter a valid email address."
+msgstr "Por favor introduce una dirección de e-mail válida."
+
+# qtranslate-slug-settings.php
+msgid "upgrade now"
+msgstr "actualizar ahora"
+
+# qtranslate-slug.php
+msgid "Please update your old data to the new system."
+msgstr "Por favor actualiza tu antiguo sistema de datos al nuevo."
+
+# qtranslate-slug-settings.php
+msgid "Upgrade your data"
+msgstr "Actualiza tus datos"
+
+# qtranslate-slug-settings.php
+msgid "There are slugs stored with old data system. Please upgrade your data pressing upgrade button:"
+msgstr "Hay slugs almacenados en el antiguo sistema. Por favor actualiza tus datos aprentando el botón actualizar:"
+
+# qtranslate-slug-settings.php
+msgid "Sorry, some error happened. Refresh this page and try again please."
+msgstr "Lo sentimos, algún tipo de error ha ocurrido. Por favor recarga esta página y prueba otra vez."
+
+# qtranslate-slug-settings.php
+msgid "Congratulations, your data has been upgraded, you are up to date."
+msgstr "Felicidades, tus datos se han actualizado, ahora estás al día."
+
+# qtranslate-slug-settings.php
+msgid "One step more, select what type of slug is this: %s"
+msgstr "Un paso más, selecction qué tipo de slug es este: %s"
+
+# qtranslate-slug-settings.php
+msgid "Post, Page or Custom post type"
+msgstr "Entrada, Página o Custom post type"
+
+# qtranslate-slug-settings.php
+msgid "Category, tag or custom taxonomy"
+msgstr "Categoria, tag o taxonomía"
+
+# qtranslate-slug.php
+msgid "This plugin requires at least Wordpress 3.3 and Qtranslate(2.5.8 or newer)"
+msgstr "Este plugin requiere al menos Wordpress 3.3 y Qtranslate(2.5.8 o mayor)"
+
+# qtranslate-slug-settings.php
+msgid "If you activated previously the pretty permalinks, in this section you can translate the URLs bases for public post_types, categories, tags and taxonomies."
+msgstr "Si has activado previamente los enlaces permanentes, en esta sección podrás traducir las bases de las URLs para post_types, categorías, etiquetas y taxonomias públicas."
+
+# qtranslate-slug-settings.php
+msgid "For example, the post_type books, in Spanish would be displayed as http://example.org/es/libros/post-type-name/
. If you leave this blank will use the default option when you registered the post_type."
+msgstr "Por ejemplo, para el post_type books en Español se mostraría como http://example.org/es/libros/post-type-name/
. Si dejas esto en blanco se usará la opción predeterminada cuando registraste el post_type."
+
+# qtranslate-slug-settings.php
+msgid "For example, the taxonomy category, in Spanish would be displayed as http://example.org/es/categoria/taxonomy-name/
. If you leave this blank will use the default option when you registered the taxonomy (if you previously setup a base permastruct for categories or tags in permalinks page, these bases will be overwritten by the translated ones)."
+msgstr "Por ejemplo, la taxonomia category, en Español se mostraría como http://example.org/es/categoria/taxonomy-name/
. Si dejas esto en blanco se usará la opción predeterminada cuando registraste la texonomia (si previamente configuraste la base de las estructuraas de categorías o tags en la página enlaces permanentes, estas bases serán reemplazadas por las traducidas)."
+
diff --git a/modules/slugs/languages/qts-pt_PT.mo b/modules/slugs/languages/qts-pt_PT.mo
new file mode 100644
index 0000000000000000000000000000000000000000..64c0c003a45b3f35332dfbc0f68d40afaf90872d
GIT binary patch
literal 8618
zcmd6sU5q5xRmX3P0cS!0Cni7$http://example.org/%s/some-%s/
"
+msgstr "http://exemplo.org/%s/qualquer-%s/
"
+
+#: ../includes/qtranslate-slug-settings-options.php:119
+msgid "Categories"
+msgstr "Categorias"
+
+#: ../includes/qtranslate-slug-settings-options.php:120
+msgid "http://example.org/category/some-category/
"
+msgstr "http://exemplo.org/categoria/qualquer-categoria/
"
+
+#: ../includes/qtranslate-slug-settings-options.php:130
+msgid "Tags"
+msgstr "Etiquetas"
+
+#: ../includes/qtranslate-slug-settings-options.php:131
+msgid "http://example.org/tag/some-tag/
"
+msgstr "http://exemplo.org/etiqueta/qualquer-etiqueta/
"
+
+#: ../includes/qtranslate-slug-settings-options.php:175
+msgid "Qtranslate Settings - Contextual Help"
+msgstr "Definições do Qtranslate - Ajuda contextual"
+
+#: ../includes/qtranslate-slug-settings-options.php:176
+msgid ""
+"Contextual help goes here. You may want to use different html elements to "
+"format your text as you want."
+msgstr ""
+"Isto é a ajuda contextual. Poderá utilizar diferentes elementos html para "
+"formatar o seu texto como desejar."
+
+#: ../includes/qtranslate-slug-settings.php:23
+msgid "Upgrade your data"
+msgstr "Actualize os seus dados"
+
+#: ../includes/qtranslate-slug-settings.php:24
+msgid ""
+"There are slugs stored with old data system. Please upgrade your data pressing "
+"upgrade button:"
+msgstr ""
+"Existem URLs com sistema de dados antigo. Por favor actualize os seus dados "
+"através do botão actualizar:"
+
+#: ../includes/qtranslate-slug-settings.php:77
+msgid "Sorry, some error happened. Refresh this page and try again please."
+msgstr ""
+"Lamentavelmente mas ocorreu um erro. Por favor refresque esta página e tente "
+"novamente."
+
+#: ../includes/qtranslate-slug-settings.php:84
+msgid "Congratulations, your data has been upgraded, you are up to date."
+msgstr ""
+"Parabéns, os seus dados foram actualizados e o sistema está agora actual."
+
+#: ../includes/qtranslate-slug-settings.php:90
+msgid "One step more, select what type of slug is this: %s"
+msgstr "Um passo mais, seleccione que tipo de URL é este: %s"
+
+#: ../includes/qtranslate-slug-settings.php:91
+msgid "Post, Page or Custom post type"
+msgstr "Artigo, página ou tipo de artigo personalizado"
+
+#: ../includes/qtranslate-slug-settings.php:91
+msgid "Category, tag or custom taxonomy"
+msgstr "Categoria, etiqueta ou taxonomia personalizada"
+
+#: ../includes/qtranslate-slug-settings.php:182
+#: ../includes/qtranslate-slug-settings.php:322
+msgid "Qtranslate Slug options"
+msgstr "Opções do Qtranslate Slug"
+
+#: ../includes/qtranslate-slug-settings.php:322
+msgid "Slug options"
+msgstr "Opções do URL"
+
+#: ../includes/qtranslate-slug-settings.php:359
+msgid ""
+"For example, the post_type books, in Spanish would be displayed as "
+"http://example.org/es/libros/post-type-name/
. If you leave this "
+"blank will use the default option when you registered the post_type."
+msgstr ""
+"Por exemplo, o tipo de artigo livros, em português seria mostrado "
+"como http://exemplo.org/pt/livros/nome-de-tipo-de-artigo/
. Se "
+"deixar isto em branco, será usada a opção por omissão registada no tipo de "
+"artigo."
+
+#: ../includes/qtranslate-slug-settings.php:364
+msgid ""
+"For example, the taxonomy category, in Spanish would be displayed "
+"as http://example.org/es/categoria/taxonomy-name/
. If you leave "
+"this blank will use the default option when you registered the "
+"taxonomy (if you previously setup a base permastruct for categories or "
+"tags in permalinks page, these "
+"bases will be overwritten by the translated ones)."
+msgstr ""
+"Por exemplo, a taxonomia categoria, em português seria mostrado "
+"como http://exemplo.org/pt/categoria/nome-de-taxonomia/
. Se "
+"deixar isto em branco, será usada a opção por omissão registada na "
+"taxonomia (se previamente configurou a base das ligações permanentes para "
+"categorias ou etiquetas na página ligações permanentes, estas bases serão sobrepostas pelas traduzidas)."
+
+#: ../includes/qtranslate-slug-settings.php:368
+msgid "The default styles are very minimal, and you can include them or not."
+msgstr "Os estilos padrão são mínimos, pode incluí-los ou não."
+
+#: ../includes/qtranslate-slug-settings.php:567
+msgid ""
+"If you activated previously the pretty "
+"permalinks, in this section you can translate the URLs bases for public post_types, categories, tags and taxonomies."
+msgstr ""
+"Se activou previamente as ligações "
+"permanentes, nesta secção poderá traduzir as bases das "
+"URLs para tipos "
+"de artigo, categorias, etiquetas e taxonomias públicas."
+
+#: ../includes/qtranslate-slug-settings.php:586
+msgid "If you selected \"none\", copy and use these styles as you see fit:"
+msgstr "Se escolher \"nenhum\", copie e utilize estes estilos como entender:"
+
+#: ../includes/qtranslate-slug-settings.php:589
+msgid "Save Changes"
+msgstr "Guardar alterações"
+
+#: ../includes/qtranslate-slug-settings.php:642
+msgid "Expecting a Numeric value! Please fix."
+msgstr "É necessário um valor numérico! Por favor, corrija."
+
+#: ../includes/qtranslate-slug-settings.php:655
+msgid "Expecting comma separated numeric values"
+msgstr "Valores numéricos separados por vírgulas"
+
+#: ../includes/qtranslate-slug-settings.php:665
+msgid "Expecting comma separated numeric values! Please fix."
+msgstr ""
+"São necessários valores numéricos separados por vírgulas! Por favor, corrija."
+
+#: ../includes/qtranslate-slug-settings.php:690
+msgid "Invalid email"
+msgstr "Email incorrecto"
+
+#: ../includes/qtranslate-slug-settings.php:692
+msgid "This setting field cannot be empty! Please enter a valid email address."
+msgstr ""
+"Este campo não pode estar vazio! Por favor introduza um endereço de email "
+"válido."
+
+#: ../includes/qtranslate-slug-settings.php:700
+msgid "Please enter a valid email address."
+msgstr "Por favor introduza um endereço de email válido."
+
+#: ../qtranslate-slug.php:150
+msgid "Settings"
+msgstr "Definições"
diff --git a/modules/slugs/languages/qts.pot b/modules/slugs/languages/qts.pot
new file mode 100644
index 00000000..cedf142d
--- /dev/null
+++ b/modules/slugs/languages/qts.pot
@@ -0,0 +1,313 @@
+# Copyright (C) 2012 qTranslate slug
+# This file is distributed under the same license as the qTranslate slug package.
+msgid ""
+msgstr ""
+"Project-Id-Version: qTranslate slug 1.0\n"
+"Report-Msgid-Bugs-To: http://wordpress.org/tag/qtranslate-slug\n"
+"POT-Creation-Date: 2015-01-23 14:23-0000\n"
+"PO-Revision-Date: 2015-01-23 14:23-0000\n"
+"Last-Translator: Pedro Mendonça http://example.org/%s/some-%s/
"
+msgstr ""
+
+#: ../includes/qtranslate-slug-settings-options.php:119
+msgid "Categories"
+msgstr ""
+
+#: ../includes/qtranslate-slug-settings-options.php:120
+msgid "http://example.org/category/some-category/
"
+msgstr ""
+
+#: ../includes/qtranslate-slug-settings-options.php:130
+msgid "Tags"
+msgstr ""
+
+#: ../includes/qtranslate-slug-settings-options.php:131
+msgid "http://example.org/tag/some-tag/
"
+msgstr ""
+
+#: ../includes/qtranslate-slug-settings-options.php:175
+msgid "Qtranslate Settings - Contextual Help"
+msgstr ""
+
+#: ../includes/qtranslate-slug-settings-options.php:176
+msgid ""
+"Contextual help goes here. You may want to use different html elements to "
+"format your text as you want."
+msgstr ""
+
+#: ../includes/qtranslate-slug-settings.php:23
+msgid "Upgrade your data"
+msgstr ""
+
+#: ../includes/qtranslate-slug-settings.php:24
+msgid ""
+"There are slugs stored with old data system. Please upgrade your data pressing "
+"upgrade button:"
+msgstr ""
+
+#: ../includes/qtranslate-slug-settings.php:77
+msgid "Sorry, some error happened. Refresh this page and try again please."
+msgstr ""
+
+#: ../includes/qtranslate-slug-settings.php:84
+msgid "Congratulations, your data has been upgraded, you are up to date."
+msgstr ""
+
+#: ../includes/qtranslate-slug-settings.php:90
+msgid "One step more, select what type of slug is this: %s"
+msgstr ""
+
+#: ../includes/qtranslate-slug-settings.php:91
+msgid "Post, Page or Custom post type"
+msgstr ""
+
+#: ../includes/qtranslate-slug-settings.php:91
+msgid "Category, tag or custom taxonomy"
+msgstr ""
+
+#: ../includes/qtranslate-slug-settings.php:182
+#: ../includes/qtranslate-slug-settings.php:322
+msgid "Qtranslate Slug options"
+msgstr ""
+
+#: ../includes/qtranslate-slug-settings.php:322
+msgid "Slug options"
+msgstr ""
+
+#: ../includes/qtranslate-slug-settings.php:359
+msgid ""
+"For example, the post_type books, in Spanish would be displayed as "
+"http://example.org/es/libros/post-type-name/
. If you leave this "
+"blank will use the default option when you registered the post_type."
+msgstr ""
+
+#: ../includes/qtranslate-slug-settings.php:364
+msgid ""
+"For example, the taxonomy category, in Spanish would be displayed "
+"as http://example.org/es/categoria/taxonomy-name/
. If you leave "
+"this blank will use the default option when you registered the "
+"taxonomy (if you previously setup a base permastruct for categories or "
+"tags in permalinks page, these "
+"bases will be overwritten by the translated ones)."
+msgstr ""
+
+#: ../includes/qtranslate-slug-settings.php:368
+msgid "The default styles are very minimal, and you can include them or not."
+msgstr ""
+
+#: ../includes/qtranslate-slug-settings.php:567
+msgid ""
+"If you activated previously the pretty "
+"permalinks, in this section you can translate the URLs bases for public post_types, categories, tags and taxonomies."
+msgstr ""
+
+#: ../includes/qtranslate-slug-settings.php:586
+msgid "If you selected \"none\", copy and use these styles as you see fit:"
+msgstr ""
+
+#: ../includes/qtranslate-slug-settings.php:589
+msgid "Save Changes"
+msgstr ""
+
+#: ../includes/qtranslate-slug-settings.php:642
+msgid "Expecting a Numeric value! Please fix."
+msgstr ""
+
+#: ../includes/qtranslate-slug-settings.php:655
+msgid "Expecting comma separated numeric values"
+msgstr ""
+
+#: ../includes/qtranslate-slug-settings.php:665
+msgid "Expecting comma separated numeric values! Please fix."
+msgstr ""
+
+#: ../includes/qtranslate-slug-settings.php:690
+msgid "Invalid email"
+msgstr ""
+
+#: ../includes/qtranslate-slug-settings.php:692
+msgid "This setting field cannot be empty! Please enter a valid email address."
+msgstr ""
+
+#: ../includes/qtranslate-slug-settings.php:700
+msgid "Please enter a valid email address."
+msgstr ""
+
+#: ../qtranslate-slug.php:150
+msgid "Settings"
+msgstr ""
diff --git a/modules/slugs/readme.txt b/modules/slugs/readme.txt
new file mode 100644
index 00000000..cbf1b227
--- /dev/null
+++ b/modules/slugs/readme.txt
@@ -0,0 +1,296 @@
+=== Qtranslate Slug ===
+Contributors: carlos_a_sanz, pedroghandi
+Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=GYS2L7627B4F8&lc=GB&item_name=Qtranslate%2dSlug%20Improvement%20Fund&item_number=qts%2dpaypal¤cy_code=EUR&bn=PP%2dDonationsBF%3abtn_donate_LG%2egif%3aNonHosted
+Tags: qtranslate, slug, multilanguage, widget
+Requires at least: 4.0
+Tested up to: 4.5
+Stable tag: 1.1.18
+License: GPLv2 or later
+License URI: http://www.gnu.org/licenses/gpl-2.0.html
+
+Adds support for permalink translations to QTranslate-X
+
+== Description ==
+
+[Qtranslate-X](http://wordpress.org/plugins/qtranslate-x/) is a nice plugin for Multilingual Websites. **Qtranslate Slug** is an addon to QTranslate, which adds support for permalinks translations.
+
+
+
+
+
+1.1.17 fixes a dangerous Security Exploit. Please update right now!
+
+= Requirements: =
+
+* Wordpress 4.0 (PHP 5.4 and MySQL 5)
+* mQtranslate 2.6.2.4 or Qtranslate 2.5.8 or qtranslate-x ( 2.9.1 )
+
+= New in 1.1.18 =
+
+* works with upcomming wp 4.5! thats new for a change!
+* widget is now compatible with wp 4.3. thanks to @adnanoner ( #111) and @gitmad (#112)
+* saving taxonomies wont print warning. thanks to @jmarceli ( #113)
+* saving post quick edit wont print warnings. thanks again to jmarceli ( #114 )
+* Code from wp.org is now been merged with the github account
+* Some notices are fixed. Thanks to @rafa-aguilar ( #89 )
+* custom post types are fixed! thanks to @MicheleBertoli ( #102 )
+* slug box now shows the utf8 chars instead of the enconded ones.
+* you can now toggle the default slug box, in case you want to edit it.
+* edit term has been re-worked, so no more errors and notices! ( hopefully!)
+* couple of other stuff has been fixed by me thanks to your awesome bug reports!
+
+= New in 1.1.17 =
+* Hability to filter the position of the Metabox
+* Fixed dangerous security exploit!
+
+= New in 1.1.16 =
+Minor fix for the language menu using qtranslate's function
+
+= New in 1.1.15 =
+* Fixes the duplicated hreflang links in
+
+= New in 1.1.14 =
+
+The menu widget didn't allow the visitors to change to the default language if qtranslate-x was being used. So, adjusted the Language Menu widget to play nice with qtranslate-x.
+Hope to bring some nice changes that were made in the github repository in the next version. For now, enjoy.
+
+= New in 1.1.13 =
+== Thanks to returning @pedro-mendonca for these commits: ==
+* Cleaned duplicated label in widget
+* Bug fix in "Slug (%s)" string translation
+* Changed text strings with no text-domain and with text-domain 'qtranlate' to text-domain 'qts'
+* pot catalog updated with current strings, including last found is "More information about".
+== Thanks to @johnclause for these : ==
+* Convenience links in notice_dependences
+* Menu compatibility with qTranslate-X
+* Fixed extra characters in widget
+### Thanks to vbkun for casting the much wanted function to get a slug based on an id and language
+* Added a global qts_get_slug( $id, $lang)
+### and sadly:
+* removed the menu admin box until better implementation
+
+
+See you next Version!
+
+
+**Advice: If you're using a multisite installation, you will must activate qtranslate plugins by separately on each site.**
+
+You can also check the [project website](http://not-only-code.github.com/qtranslate-slug/) hosted on [GitHub](http://not-only-code.github.com).
+Thanks for use this plugin!
+
+= Contributors =
+
+* [Pedro de Carvalho](https://github.com/LC43/)
+* [Risto Niinemets](https://github.com/RistoNiinemets)
+* [Pedro Mendonça](https://github.com/pedro-mendonca)
+* [codep0et](https://github.com/codep0et)
+* [Giraldi Maggio](https://github.com/bedex78)
+* [jinoOM](https://github.com/jinoOM)
+* [Juanfran](https://github.com/juanfran-granados)
+* [Arild](https://github.com/arildm)
+* [Rafa Aguilar](https://github.com/rafitaFCB)
+* [Bastian Heist](https://github.com/beheist)
+* [John Clause](https://github.com/johnclause)
+
+
+== Installation ==
+**This plugins requires [Qtranslate](http://wordpress.org/extend/plugins/qtranslate/) or [mqTranslate](https://wordpress.org/plugins/mqtranslate/) installed previously, if not, it will not activate.**
+
+1. Upload `qtranslate-slug` to the `/wp-content/plugins/` directory.
+1. Activate the plugin through the 'Plugins' menu in WordPress.
+1. That's all!
+
+= Changing base permastructs =
+
+1. In admin: navigate to *Settings/Slug options*.
+1. Set the base permastructs for **post types** and **taxonomies** (If you setup a base permastruct for *categories* or *tags* in *Settings/Permalinks*, these will be overwritten by the translated ones).
+1. Save settings and that's all!
+
+== Frequently Asked Questions ==
+
+= It works with posts and pages, but with other content type? =
+
+This plugin allows to translate slugs of: posts, pages, custom post types, categories, tags and custom taxonomies.
+
+= Do I have to configure anything? =
+
+If you want to translate also the base permastructs (ex. *category*, *tag*, etc). Visit the plugin settings page in the admin *Settings/Slug options*
+
+= How can i insert a language selector in my theme ? =
+
+You can choose to:
+* use **Qtranslate Slug Widget** in your sidebar.
+* place in your template ``. Options are: `dropdown`, `text`, `image`, and `both`.
+
+= Appears an error 404, what can i do? =
+
+In the admin go to *Settings/Permalinks* or *Settings/Slug options* and save.
+
+= I can't manage translations in Nav Menus. =
+
+That's because language selector metabox is hidden, if you are in admin *nav menus* screen, press the button **Screen options** (on top and right) and after, check the option *Languages*. It will appear a **Language** meta box on top of the left sidebar.
+
+= How to get the current url in a specific language? =
+
+You can use `qts_get_url()` or the awkwardly named `qTranslateSlug_getSelfUrl()` which is an alias for the first one.
+
+
+== Screenshots ==
+
+1. Edit page for: post / page / post_type, you can see the meta box for translated slugs on top and right.
+2. Add new taxonomy page
+3. Edit taxonomy page
+4. Qtranslate Slug options page for translate base permastructs of post_types and taxonomies.
+
+== Changelog ==
+
+
+= New in Versions 1.1.12 =
+
+* fixed warnings in settings
+* replace qtranslate with our own for taxonomies
+
+= New in Versions 1.1.10 and 1.1.11 =
+
+* Fixing wrong commit to wp.org
+* Clean deleted files
+= New in Version 1.1.9 =
+
+Lots of bug fixes! Thanks again to everyone that contributed to this project, with commits, bug reports and suggestions.
+
+* Compatibility with qtranslate-X! ( thanks @beheist, pull #85, fixing most of #80 )
+* More updates to the portuguese translation ( thanks pedro-mendonca, pull #86)
+* Corrected the link to language files ( thanks pedro-mendonca )
+* Added translation for some hardcoded texts ( thanks pedro-mendonca )
+* Corrected a link from 'qtranslate' to 'qts' language files ( thanks pedro-mendonca )
+* Fixed taxonomies slugs ( thanks to [eirikv's bug report](https://wordpress.org/support/topic/categories-slug-dont-work) )
+* Fixed many warnings ( thanks piffpaffpuff, issue #78 and to [pedrodu1](https://wordpress.org/support/topic/warnings-qtranslate-slugphp) )
+* Changed the behaviour of "Quick Edit", from the wp forums [1](https://wordpress.org/support/topic/categories-tags-and-quick-edit-dont-show-in-admin) [2](https://wordpress.org/support/topic/quick-edit-inhibited-by-qtranslate-slug-with-wp-41-mqtranslate) ( thanks everyone!! )
+* Fixed the menus! Now you can properly use one menu for every language. Use the dropdown section "Languages", and for each item, change the "Navigation Label" and "Title Attribute". Select "All languages", to make sure everything is awesome! All these features were a consequence of fixing all the warnings based on [Gery's bug report](https://wordpress.org/support/topic/qtranslate-slug-conflicting-with-ubermenu).
+* Minor fixes, etc.
+
+
+= New in Version 1.1.9 =
+
+Lots of bug fixes! Thanks again to everyone that contributed to this project, with commits, bug reports and suggestions.
+
+* Compatibility with qtranslate-X! ( thanks @beheist, pull #85, fixing most of #80 )
+* More updates to the portuguese translation ( thanks pedro-mendonca, pull #86)
+* Corrected the link to language files ( thanks pedro-mendonca )
+* Added translation for some hardcoded texts ( thanks pedro-mendonca )
+* Corrected a link from 'qtranslate' to 'qts' language files ( thanks pedro-mendonca )
+* Fixed taxonomies slugs ( thanks to [eirikv's bug report](https://wordpress.org/support/topic/categories-slug-dont-work)
+* Fixed many warnings ( thanks piffpaffpuff, issue #78 and to [pedrodu1](https://wordpress.org/support/topic/warnings-qtranslate-slugphp) )
+* Changed the behaviour of "Quick Edit", from the wp forums [1](https://wordpress.org/support/topic/categories-tags-and-quick-edit-dont-show-in-admin) [2](https://wordpress.org/support/topic/quick-edit-inhibited-by-qtranslate-slug-with-wp-41-mqtranslate) ( thanks everyone!! )
+* Fixed the menus! Now you can properly use one menu for every language. Use the dropdown section "Languages", and for each item, change the "Navigation Label" and "Title Attribute". Select "All languages", to make sure everything is awesome! All these features were a consequence of fixing all the warnings based on [Gery's bug report)[https://wordpress.org/support/topic/qtranslate-slug-conflicting-with-ubermenu).
+* Minor fixes, etc.
+
+See you next Version!
+
+
+= 1.1.8 =
+
+Many thanks to everyone that contributed to this update, for their commits, bug reports and for simply using it
+
+* Portuguese translation and fixed some translation bugs ( thanks pedro-mendonca )
+* removed mqtranslate switcher widget hook
+* Updated the plugin structure and coding style
+* solve some conflicts with search and pagination queries
+* Settings php errors, syntax indent and fixed settings assets url
+* Change titles when there is a click on pagination on show all pages tab ( thanks juanfran-granados )
+* Formatted dependency notice message ( thanks arildm )
+* Updated the deprecated jquery 'live' function and solve php strict standards error ( thanks rafitaFCB )
+* Fixed error showing if PHP was newer than 5.3 ( thanks rafitaFCB )
+* Strict standard advise prevented ( thanks rafitaFCB )
+* php notices are prevented in post edit, when using adding new translated tags ( thanks rafitaFCB )
+* fixed the hreflang issue! 'bout time!
+* As discussed in issue #25, the flags are now img tags, intead of background-url.
+* Added another option to include the css style in a minified file. ( and also showing in the option screen the styles we would use.)
+
+= 1.1.7 =
+* removed styles from html elements and added options to use .css file or print inline styles
+* fixed tag creation on post edit.
+* fixed earlier bad post slug introduced in 1.1.6
+
+= 1.1.6 =
+* compatible with mqtranslate
+* php5.4+ compatible
+
+= 1.1.5 =
+* bugfixes
+
+= 1.1 =
+* added multisite support
+* fixed some parse url bugs
+* fixed slug bases validation
+
+= 1.0 =
+* **works** with any permalink combination and qtranslate mode.
+* new branch, the plugin has been rewritten: now the code is commented and wrapped inside a class, much code has change and the performance has been increased (use caches).
+* data system changed, no ID for slug type, then it don't needs install `qtrasnlate_slug` table. That means slugs now are stored on meta tables and installation creates a termmeta table with some new *core functions* to access/save data, based on [simple term meta](http://wordpress.org/extend/plugins/simple-term-meta/). Upgrade process when the plugin updates from older versions.
+* the plugin generates translated slug automatically from title in empty cases.
+* the plugin checks if the slug already exists (per each language and `post_type`/`taxonomy`), and adds a progressive number in this case. Works on ajax requests for example when new taxonomies are created in edit post page.
+* possibility to translate the base of permastructs for *post_types* and *taxonomies*, uses [$wp_rewrite](http://codex.wordpress.org/Class_Reference/WP_Rewrite). New admin options page for save the base permastructs.
+* added some filters, see in [other notes](http://wordpress.org/extend/plugins/qtranslate-slug/other_notes/).
+* added plugin language textdomain (.pot file).
+* updated **Language selector Widget**, and some new conventions like accessible functions for templating.
+* some bug fixes.
+* some Qtranslate patches.
+
+= 0.9 =
+* some wordpress qTranslate bug fixes
+* adds a javascript solution for qTranslate Nav Menus
+
+= 0.8 =
+* added support por Categories
+* added support por Tags
+* added support por Taxonomies
+* added support por Custom Post Types
+
+= 0.7 = [Zapo](http://www.qianqin.de/qtranslate/forum/viewtopic.php?f=4&t=1049&start=50#p7499)
+* added suport for qTranslate TLD domain mode (en: domain.com | fr: domain.fr) visit
+
+= 0.5 and 0.6 enhanched by Marco Del Percio =
+
+== Upgrade Notice ==
+
+= 1.0 =
+Major version, the plugin has been rewritten. Better performance, and some enhancements.
+
+= 0.9 =
+This version fix some bugs and allow multilanguage in nav-menus.
+
+= 0.8 =
+A lot of slugs content allowed
+
+= 0.7 =
+This version allows TLD domain option for a different Qtranslate fork maded by Zappo
+
+
+== Other notes ==
+
+Plugin filters reference:
+
+= qts_validate_post_slug =
+filter to process the post slug before is saved on the database.
+`args: $post (object), $slug (string), $lang (string)`
+
+= qts_validate_term_slug =
+filter to process the term slug before is saved on the database.
+`args: $term (object), $slug (string), $lang (string)`
+
+= qts_url_args =
+filter to process the entire url after it has been generated.
+`args: $url (string), $lang (string)`
+
+= qts_permastruct =
+filter to process the permastruct, used for change the base.
+`args: $permastruct (string), $name (string)`
+
+
+= Todo =
+
+* detect Slug for each language and redirect accordingly in parse_query.
+* expand qtranslate for translate attachment names and descriptions ( useful for galleries )
+* translate other slugs like attachments.
+* qtranslate integration with other plugins like Jigoshop, e-commerce, etc. Addapt **$wp_rewrite**.
diff --git a/modules/slugs/slugs.php b/modules/slugs/slugs.php
new file mode 100644
index 00000000..927fa43a
--- /dev/null
+++ b/modules/slugs/slugs.php
@@ -0,0 +1,182 @@
+language_menu($type, $args);
+}
+
+/**
+ * Finds the translated slug of the given post by calling get_slug
+ * @param int $id the post id
+ * @param string $lang which language to look for
+ * @since 1.1.13
+ */
+
+function qts_get_slug( $id, $lang ) {
+ global $qtranslate_slug;
+ return $qtranslate_slug->get_slug($id, $lang);
+}
+
+
+/**
+ * Adds support for old plugin function
+ *
+ * @package Qtranslate Slug
+ * @subpackage Core
+ * @since 1.1.5
+ */
+function qTranslateSlug_getSelfUrl ($lang = false) { // bad naming, I'll keep just in case
+ return qts_get_url($lang);
+}
+
+function qts_get_url($lang = false) {
+ global $qtranslate_slug;
+
+ return $qtranslate_slug->get_current_url($lang);
+}
+
+
+
+/**
+ * Add a "Settings" link to the plugins.php page for Qtranslate Slug
+ *
+ * @package Qtranslate Slug
+ * @subpackage Settings
+ * @version 1.0
+ *
+ * @return calls qts_show_msg()
+ */
+function qts_add_settings_link( $links, $file ) {
+
+ if (QtranslateSlug::block_activate()) return $links;
+
+ $this_plugin = plugin_basename( __FILE__ );
+ if( $file == $this_plugin ) {
+ $settings_link = "" . __( 'Settings', 'qts' ) . '';
+ array_unshift($links, $settings_link);
+ }
+ return $links;
+}
+add_filter( 'plugin_action_links', 'qts_add_settings_link', 10, 2 );
+
+
+
+/**
+ * Delete plugin stored data ( options, termmeta table and postmeta data )
+ *
+ * @package Qtranslate Slug
+ * @subpackage Settings
+ * @version 1.0
+ *
+ */
+function qts_uninstall() {
+ global $q_config, $wpdb, $wp_version;
+
+ // options
+ delete_option(QTS_OPTIONS_NAME);
+ delete_option('qts_version');
+
+ // don't delete termmeta table as it will be used by wp beginning 4.4
+ if( version_compare($wp_version, "4.4", "<" ) ) {
+ $wpdb->query("DROP TABLE IF EXISTS $wpdb->termmeta");
+ }
+
+ // delete postmeta data
+ $meta_keys = array();
+ foreach ($q_config['enabled_languages'] as $lang) $meta_keys[] = sprintf("_qts_slug_%s", $lang);
+ $meta_keys = "'". implode( "','", $meta_keys ) . "'";
+ $wpdb->query("DELETE from $wpdb->postmeta WHERE meta_key IN ($meta_keys)");
+}
diff --git a/modules/slugs/version.txt b/modules/slugs/version.txt
new file mode 100644
index 00000000..cddff47e
--- /dev/null
+++ b/modules/slugs/version.txt
@@ -0,0 +1,162 @@
+= New in 1.1.18 =
+
+Let's start with what has been fixed:
+
+
+* widget is now compatible with wp 4.3. thanks to @adnanoner ( #111) and @gitmad (#112)
+* saving taxonomies wont print warning. thanks to @jmarceli ( #113)
+* saving post quick edit wont print warnings. thanks again to jmarceli ( #114 )
+* Code from wp.org is now been merged with the github account
+* Some notices are fixed. Thanks to @rafa-aguilar ( #89 )
+* custom post types are fixed! thanks to @MicheleBertoli ( #102 )
+* lots of other stuff has been fixed by me thanks to your awesome bug reports!
+
+
+
+and now, what isn't working:
+In QTS slug options you can change the bases for taxonomies and custom post types.
+
+So, for example, you can change /category/ for /category/ for english and /categoria/ for spanish version.
+But these won't work:
+* slug with UTF8 charactes in taxonomies bases: example: /類別/.. instead of /category/..
+ utf8 in taxonomies works just fine: /category_zh/魚/
+* slug with UTF8 charactes in custom post type bases : example: /圖書/.. instead of /books/..
+ utf8 in custom post slugs works just fine: /tushu/彩繪中國經典名著/
+* translating custom post types archives with custom base name /tushu/ isnt working. but using utf8 in the the default slug, as expected : /中國/
+
+
+
+
+
+
+Thanks for using, enjoy 1.1.18.
+
+If anything breaks, let me know!
+
+= New in 1.1.17 =
+* Fixed dangerous security exploit!
+* Hability to filter the position of the Metabox
+
+= New in 1.1.16 =
+Minor fix for the language menu using qtranslate's function
+
+= New in 1.1.15 =
+* Fixes the duplicated hreflang links in
+
+= New in 1.1.14 =
+
+The menu widget didn't allow the visitors to change to the default language if qtranslate-x was being used. So, adjusted the Language Menu widget to play nice with qtranslate-x.
+Hope to bring some nice changes that were made in the github repository in the next version. For now, enjoy.
+
+= 1.1.13 =
+== Thanks to returning @pedro-mendonca for these commits: ==
+* Cleaned duplicated label in widget
+* Bug fix in "Slug (%s)" string translation
+* Changed text strings with no text-domain and with text-domain 'qtranlate' to text-domain 'qts'
+* pot catalog updated with current strings, including last found is "More information about".
+== Thanks to @johnclause for these : ==
+* Convenience links in notice_dependences
+* Menu compatibility with qTranslate-X
+* Fixed extra characters in widget
+== Thanks to vbkun for casting this much wanted function ==
+* Added a global qts_get_slug( $id, $lang)
+== and sadly: ==
+* removed the menu admin box until better implementation
+
+= 1.1.12 =
+
+* fixed warnings in settings
+* replace qtranslate with our own for taxonomies
+
+= 1.1.10 and 1.1.11 =
+* Fixing wrong commit to wp.org
+* Clean deleted files
+
+= 1.1.9 =
+
+Lots of bug fixes! Thanks again to everyone that contributed to this project, with commits, bug reports and suggestions.
+
+* Compatibility with qtranslate-X! ( thanks @beheist, pull #85, fixing most of #80 )
+* More updates to the portuguese translation ( thanks pedro-mendonca, pull #86)
+* Corrected the link to language files ( thanks pedro-mendonca )
+* Added translation for some hardcoded texts ( thanks pedro-mendonca )
+* Corrected a link from 'qtranslate' to 'qts' language files ( thanks pedro-mendonca )
+* Fixed taxonomies slugs ( thanks to [eirikv's bug report](https://wordpress.org/support/topic/categories-slug-dont-work) )
+* Fixed many warnings ( thanks piffpaffpuff, issue #78 and to [pedrodu1](https://wordpress.org/support/topic/warnings-qtranslate-slugphp) )
+* Changed the behaviour of "Quick Edit", from the wp forums [1](https://wordpress.org/support/topic/categories-tags-and-quick-edit-dont-show-in-admin) [2](https://wordpress.org/support/topic/quick-edit-inhibited-by-qtranslate-slug-with-wp-41-mqtranslate) ( thanks everyone!! )
+* Fixed the menus! Now you can properly use one menu for every language. Use the dropdown section "Languages", and for each item, change the "Navigation Label" and "Title Attribute". Select "All languages", to make sure everything is awesome! All these features were a consequence of fixing all the warnings based on [Gery's bug report](https://wordpress.org/support/topic/qtranslate-slug-conflicting-with-ubermenu).
+* Minor fixes, etc.
+
+See you next Version!
+
+= 1.1.8 =
+
+Many thanks to everyone that contributed to this update, both for their commits and bug reports )
+
+* Portuguese translation and fixed some translation bugs ( thanks pedro-mendonca )
+* removed mqtranslate switcher widget hook
+* Updated the plugin structure and coding style
+* solve some conflicts with search and pagination queries
+* Settings php errors, syntax indent and fixed settings assets url
+* Change titles when there is a click on pagination on show all pages tab ( thanks juanfran-granados )
+* Formatted dependency notice message ( thanks arildm )
+* Updated the deprecated jquery 'live' function and solve php strict standards error ( thanks rafitaFCB )
+* Fixed error showing if PHP was newer than 5.3 ( thanks rafitaFCB )
+* Strict standard advise prevented ( thanks rafitaFCB )
+* php notices are prevented in post edit, when using adding new translated tags ( thanks rafitaFCB )
+* fixed the hreflang issue! 'bout time!
+* As discussed in issue #25, the flags are now img tags, intead of background-url.
+* Added another option to include the css style in a minified file. ( and also showing in the option screen the styles we would use.)
+
+= 1.1.7 =
+* removed styles from html elements and added options to use .css file or print inline styles
+* fixed tag creation on post edit.
+* fixed earlier bad post slug introduced in 1.1.6
+
+= 1.1.6 =
+* compatible with mqtranslate
+* php5.4+ compatible
+
+= 1.1.5 =
+* bugfixes
+
+= 1.1 =
+* added multisite support
+* fixed some parse url bugs
+* fixed slug bases validation
+
+= 1.0 =
+* new branch, the plugin has been rewrited: now the code is commented and wrapped inside a class, also all code has change and the performance has been increased.
+* structural changes:
+ * no ID for slug type, then don't install qtrasnlate_slug table.
+ * slugs now are stored on meta tables, installation creates a termmeta table with some new 'core functions' to access/save data, based on [simple term meta](http://wordpress.org/extend/plugins/simple-term-meta/).
+* some automation:
+ * the plugin generates translated slug automatically from title in empty cases (like wordpress).
+ * the plugin checks if the slug already exists (per each language and type / taxonomy), and adds a progressive number in this case (like wordpress).
+ * works on ajax requests like creatig new taxonomies on edit post page.
+* possibility to translate the base of permastructs for 'post_types' and 'taxonomies' (uses $wp_rewrite).
+* added some filters:
+ * 'qts_validate_post_slug' : args( $post (object), $slug (string), $lang (string) ) / filter to process the post slug before is saved on the database.
+ * 'qts_validate_term_slug' : args( $term (object), $slug (string), $lang (string) ) / filter to process the term slug before is saved on the database.
+ * 'qts_current_url' : args ( $url (string), $lang (string) ) / filter to process the entire url after it has been generated.
+ * 'qts_permastruct' : args ( $permastruct (string), $name (string) ) / filter to process the permastruct, used for change the base.
+* added plugin language textdomain (.pot file)
+* new admin options page for save the base permastructs.
+* import process when the plugin updates older versions.
+* some bug fixes.
+* some Qtranslate patches.
+
+= 0.9 =
+* some wordpress qTranslate bug fixes
+* adds a javascript solution for qTranslate Nav Menus
+
+= 0.8 =
+* added support por Categories
+* added support por Tags
+* added support por Taxonomies
+* added support por Custom Post Types
+
+= 0.7 ( enhanced by Zapo (http://www.qianqin.de/qtranslate/forum/viewtopic.php?f=4&t=1049&start=50#p7499) ) =
+* added suport for qTranslate TLD domain mode (en: domain.com | fr: domain.fr) visit
+
+= 0.5 and 0.6 enhanched by Marco Del Percio =
\ No newline at end of file
diff --git a/qtranslate_core.php b/qtranslate_core.php
index 30a235df..9359ce53 100644
--- a/qtranslate_core.php
+++ b/qtranslate_core.php
@@ -61,11 +61,6 @@ function qtranxf_init_language() {
}
}
- // TODO fix qtranslate-slug still using 'original_url' field and remove it from here, this has no sense!
- if ( defined( 'QTS_VERSION' ) ) {
- $url_info['original_url'] = $_SERVER['REQUEST_URI'];
- }
-
$url_info['language'] = qtranxf_detect_language( $url_info );
$q_config['language'] = apply_filters( 'qtranslate_language', $url_info['language'], $url_info );
diff --git a/qtranslate_options.php b/qtranslate_options.php
index 1342903b..dfb3f03d 100644
--- a/qtranslate_options.php
+++ b/qtranslate_options.php
@@ -86,6 +86,7 @@ function qtranxf_set_default_options( &$ops ) {
'hide_default_language' => true, // hide language tag for default language in urls
'use_secure_cookie' => false,
'header_css_on' => true,
+ 'slugs_enabled' => false,
);
// single line options