Skip to content

Commit

Permalink
2.9.8.1 pre-release
Browse files Browse the repository at this point in the history
  • Loading branch information
johnclause committed Jan 31, 2015
1 parent c8bb955 commit e228f9a
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 4 deletions.
4 changes: 2 additions & 2 deletions qtranslate.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Plugin Name: qTranslate-X
Plugin URI: http://wordpress.org/plugins/qtranslate-x/
Description: Adds user-friendly and database-friendly multilingual content support into WordPress.
Version: 2.9.8.0
Version: 2.9.8.1
Author: John Clause based on original code by Qian Qin
Author URI: http://qtranslatexteam.wordpress.com/about
Tags: multilingual, multi, language, admin, tinymce, Polyglot, bilingual, widget, switcher, professional, human, translation, service, qTranslate, zTranslate, mqTranslate, qTranslate Plus, WPML
Expand Down Expand Up @@ -101,7 +101,7 @@
define( 'QTRANSLATE_FILE', __FILE__ );
}

define('QTX_VERSION','2.9.8.0');
define('QTX_VERSION','2.9.8.1');

/* DEFAULT CONFIGURATION PART BEGINS HERE */

Expand Down
9 changes: 8 additions & 1 deletion qtranslate_frontend.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,14 @@ function qtranxf_wp_get_nav_menu_items( $items, $menu, $args )
$itemsmodified=true;
continue;
}
$item->title=$item_title;
$item->title = $item_title;
if($item->object == 'custom' && !empty($item->url)){
if(strpos($item->url,'setlang=no')===FALSE){
$item->url = qtranxf_convertURL($item->url,$language);
}else{
$item->url = remove_query_arg('setlang',$item->url);
}
}
}
//qtranxf_dbg_echo('passed item: '.$item->title.'; p='.$item->menu_item_parent);

Expand Down
5 changes: 4 additions & 1 deletion qtranslate_hooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,13 @@ function qtranxf_checkCanonical($redirect_url, $requested_url) {
return $redirect_url;
}

/*
//no longer needed since we adjusted home_url()
function qtranxf_fixSearchForm($form) {
$form = preg_replace('#action="[^"]*"#','action="'.trailingslashit(qtranxf_convertURL(get_home_url())).'"',$form);
return $form;
}
*/

function qtranxf_fixAdminBar($wp_admin_bar) {
global $wp_admin_bar;
Expand Down Expand Up @@ -243,7 +246,7 @@ function qtranxf_wpseo_replacements($replacements){
add_filter('tag_feed_link', 'qtranxf_convertURL');
add_filter('get_pagenum_link', 'qtranxf_convertURL');

add_filter('get_search_form', 'qtranxf_fixSearchForm', 10, 1);
//add_filter('get_search_form', 'qtranxf_fixSearchForm', 10, 1);//no longer needed since we adjusted home_url()
add_filter('wp_list_pages_excludes', 'qtranxf_excludePages');

add_filter('comment_notification_text', 'qtranxf_useCurrentLanguageIfNotFoundUseDefaultLanguage');
Expand Down
9 changes: 9 additions & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,10 @@ The following query options can be typed in the field "URL" of "Language Menu" c

We understand that this is not a very user-friendly way to adjust the options, but it works, and we will provide a better in-editor interface to specify them in the future.

= How can I prevent URL of a custom menu item from being converted =

URL of a custom menu item gets converted to a URL for active language according to option "URL Modification Mode", unless query argument 'setlang=no' is added to the URL typed in. Such a query argument is removed when the item gets rendered.

= Can I enable Language Switching Buttons on my plugin custom page? =

Yes, enter the relevant and distinctive part of your page URL into "Custom Pages" configuration option. When page is loaded, two Java scripts will be added, "admin/js/common.js" and "admin/js/edit-custom-page.js", from which you may figure out how it works. The Language Switching Buttons will control fields listed in "Custom Fields" option. Those fields will now store the input for all enabled languages. It is up to the theme and other relevant plugins, if those field values will show up translated on the front-end. Some theme and plugins pass the values through `__()` translation function and then values are translated. They might use `apply_filters` method, and then name of that filter can be listed in "Custom Filters" configuration option, in order to get the field translated on the front-end.
Expand Down Expand Up @@ -164,8 +168,13 @@ One can find the original qTranslate FAQ [here](https://wordpress.org/plugins/qt

== Changelog ==

= 2.9.8.1 alpha =
* URL of a custom menu item gets converted to active language, unless query argument 'setlang=no' is added.
* filter 'get_search_form' is no longer need, since we adjusted home_url() [issue #8](https://github.com/qTranslate-Team/qtranslate-x/issues/8)

= 2.9.8.0 alpha =
* [plugin integration design](https://wordpress.org/support/topic/plugin-integration-1)
* po/mo files are updated. Translators needed.

= 2.9.7.9 beta =
* more fixes for [issue #5](https://github.com/qTranslate-Team/qtranslate-x/issues/5).
Expand Down

0 comments on commit e228f9a

Please sign in to comment.