Slugs question
-
Thanks for your initiative on this new fork!
My main concern is getting the “category” slugs working for taxonomies or any taxonomy fields.
Or simply make a fix for “Qtranslate Slug” to work with qTranslate-X ??
Are you up to that
-
I’ve tried Qtranslate Slug to work with qTranslate-X
1. Find and open qtranslate-slug.php (in the folder for qtranslate-slug)
2. Search and replace all qtrans_ with xqtranxf_
3. On row 262, change
from
(!is_plugin_active(‘qtranslate/qtranslate.php’) &&
to
(!is_plugin_active(‘qtranslate-x/qtranslate.php’) &&Thanks a lot, I will take a look into that. It is a policy of WP not to have the same name for functions in different plugins, even if two plugins are not supposed to run together, that is why I had to rename all of them. I’ll see if I can put Qtranslate Slug code in, if people want that.
I would appreciate if you can take a look into that…
I almost got Qtranslate-X to work with the Qtranslate Slug with the hack in above post… (this works for Qtranslate Plus though.. with replacement ppqtrans_)
If you manage to get it to work… it would make the site url’s fully translatable all across the website.
Thanks!
Hi @erikv, qtanslate slug contacted me and we will hopefully figure out a way to make it work here too. We will let you know as soon as there is a progress.
Great John.. hope you and Pedro really can make it work… that would be awesome!
Wishing you both a very happy and prosperous new year!
From “zTranslate and qTranslate slug”:
However, if(function_exists()) can actually help, and I believe we are to employ that for our purpose.Hi John, thank you for your quick reply. I did not want to blame you at all. You did and do a wonderful job.
if(function_exists())
does not break the site and some qTranslate-related plugins use it. But then you may think the plugin works with qTranslate-X/Plus/z but it does not.Anyway. It is as it is.
Hi @hibr:
if(function_exists()) does not break the site and some qTranslate-related plugins use it. But then you may think the plugin works with qTranslate-X/Plus/z but it does not.
Yes, but once it runs, we now have an opportunity to instruct the users in a friendly way on what is going on through admin messages. We were exactly working on that lately and the latest version of qTranslate-X produces those deactivate/import/export relevant messages if other qTranslate/Plus/z/mq forks are active at the same time.
Hi guys,
I created a pull request to qtranslate-slug today that contains the functionality to make it work with qTranslate-X. You can find it here: Github repo. I hope it will get merged into the plugin. If not you can also download it from my repo (https://github.com/beheist/qtranslate-slug)
Hi beheist,
Thank you for your hard work providing this fix. I downloaded your version of the plugin and installed, and the slug appears when I activate the plugin. However, I can only switch from English to Spanish. When I try to switch back to English, the English label hangs in the list box for a few seconds while the page tries to refresh, and then reverts back to Spanish. The text on the page doesn’t change – still Spanish.
I’ll leave the plugin activated for awhile if it causes no other problems, so you can see for yourself:
Could this be a simple fix?
Thomas
Good morning Thomas,
I had a look and the behavior is in fact strange. When I visit https://www.foolsmission.org/, the page shows up as Spanish, so I assume that is the default language. However when I look at the language selection listbox, I see the following:
<option value="https://www.foolsmission.org">English</option> <option value="https://www.foolsmission.org/es" selected="selected">Espa?ol</option>
So the language selector seems to think that English is the default language, as it tries to send you to the root url. As a quick fix, you could try disabling the “Hide URL language information for default language” checkbox in the qTranslate-X advanced options. I will try to reproduce this issue in a local installation.
Yes, it is in fact reproducable with the following steps:
- Install WordPress, qTranslate-X and my version of qtranslate-slug
- Switch pretty permalinks on and set qTranslate-X to pre-path mode
- Add the language switcher
As I suspected, the bug can be circumvented by removing the “Hide URL language information for default language” checkbox.
I will investigate where this bug comes from. However not today – have to start preparations for tonight ??
Happy New Year, beheist! Your suggestion worked, and disabling the “Hide URL language” option did the trick.
FYI, the default language for the site is English. I’ve noticed that using the /en or /es codes in the URL to set the language manually appears to either reset the default language or identify me to the site as a user for the specified locale. Future page visits use the language that I most previously set. I hope this helps you with your investigation.
Good luck resolving the issue for the rest of your users, and enjoy your holiday!
Fool forever,
Thomas
Hi everyone. I’m testing @beheist pull request. The problem comes from qtranslate-x itself. It doesn’t set the default language ( which is you can see on the
<html lang="">
) when that setting is on “Hide URL language information for default language” checkbox and the user picks the default lang.otherwise, i’ve tested his pull request and it seems a go! Thanks @beheist!
Hi @pedro, are you going to release it soon? I assume it would not affect anyone who does not use qTranslate-X, is that right? I will see what is wrong with -X then. I got a few reports of unexpected behaviour, and yours is most likely related to the issues already reported. I am cleaning it up now and will test your slug problem after the next release of -X.
I’ll sneak it in during lunch hours tomorrow. @beheist code was flawless so i will just push it with a couple of bug fixes of our own. Do you have a github account for your plugin? Looked for it, but didnt find it. You have a extra
?>
at the options page and wanted to fixed it for you.
- The topic ‘Slugs question’ is closed to new replies.