Using qTranslate with WordPress 3.9++
I've been a long time fan of Qian Qin's qTranslate plugin, which allows you to translate just about everything you need to have a multilinugal website running on WordPress.
Unfortunately, he seems to have fallen off the face of the earth since WordPress Version 3.9 came out, so installing the plugin will result in its automatic deactivation, as the only available qTranslate version has not been officially tested with any WordPress version newer than WP 3.8.1
I've been waiting for an update for months now, and I have come to the realization that I may have to wait a lot longer. So, I decided to see what I can do with this plugin to make it work again. Turns out, there are two simple file modifications needed in order to make qTranslate work with WordPress 3.9.1, which is the newest WP version that is available while I am writing this post.
Should there be a newer version available than WordPress Version 3.9.1, please write a comment. I will reply with a status report asap!
qTranslate WordPress 3.9 Fix
Short Question: So, what is there to do?
Short Answer: You have to modify two files in the /qtranslate/ plugin folder (via ftp).
1. Modify qtranslate.php
change this:
define('QT_SUPPORTED_WP_VERSION', '3.8.1');
to this:
define('QT_SUPPORTED_WP_VERSION', '3.9.1');
You could also do this:
define('QT_SUPPORTED_WP_VERSION', $wp_version);
2. Modify qtranslate_core.php
change this:
function qtrans_dateFromPostForCurrentLanguage($old_date, $format ='', $before = '', $after = '') {
global $post;
return qtrans_strftime(qtrans_convertDateFormat($format), mysql2date('U',$post->post_date), $old_date, $before, $after);
}
to this:
function qtrans_dateFromPostForCurrentLanguage($old_date, $format ='') {
global $post;
return qtrans_strftime(qtrans_convertDateFormat($format), mysql2date('U',$post->post_date), $old_date);
}
And that's already all there is to it!
Enjoy!
p.s. You may want to add this to your functions.php, it will increase the width of menu items in the admin… these tiny input fields drove me insane!
add_action('admin_head', 'my_custom_fonts');
function my_custom_fonts() {
echo '<style>
.menu-item-bar .menu-item-handle {
width: 582px;
}
.description-thin {
width: 550px;
}
.menu-item-settings {
width: 602px;
</style>';
}
Sources:
http://wordpress.org/support/topic/the-qtranslate-editor-has-disabled-itself-because-it-hasnt-been-tested-with-you
http://alexander.kirk.at/2014/04/17/fix-qtranslate-with-wordpress-3-9/
http://css-tricks.com/snippets/wordpress/apply-custom-css-to-admin-area/
1585
Great!! Thnkx!!