slug translation implemented, needs review

Any suggestions on how to improve qTranslate? Post here!

Re: slug translation implemented, needs review

Postby sprutniks » Sat Jun 05, 2010 7:14 pm

just to add some detail to debug:

WP version - 2.9.2
Blog URL - http://127.0.0.1/wordpress
Permalink - /blog/%postname%

OK http://127.0.0.1/wordpress/blog/postslug
OK http://127.0.0.1/wordpress/en/blog/postslug
OK http://127.0.0.1/wordpress/en/blog/postslugEN

OK http://127.0.0.1/wordpress/pageslug
OK http://127.0.0.1/wordpress/en/pageslug
NO http://127.0.0.1/wordpress/en/pageslugEN

after checking karine's blog, where slug translation runs effectively even with pages and not only with posts, I did notice its particular permalink structure, then after changing my permalinks to
/blog/%post_id%-%postname%
I believe I finally got it work.

So, I guess the qTranslateSlug_filter_request, when dealing with pages, could need some further review
sprutniks
 
Posts: 12
Joined: Mon Apr 26, 2010 9:36 pm

Re: slug translation implemented, needs review

Postby karine » Sat Jun 05, 2010 11:06 pm

I couldn't help with your problem, but yes, now that you mention it!

I couldn't get it to work with a category/subcategory permalink structure. If the post was in one category, it worked, but if in a category & child category, the link was broken.

So I changed my permalinks to : /%postid%/%postname%

And after reading a few blog articles about permalinks structure, it seems that this is one of the best permalink option so it's alright I guess :)
- Thank you for the plugin!
DarineKo.com
karine
 
Posts: 17
Joined: Tue Jun 01, 2010 7:20 pm
Location: Paris

Re: slug translation implemented, needs review

Postby sprutniks » Mon Jun 07, 2010 4:12 pm

Hello, your blog design looks awesome!
Now I'm looking to the language selection behaviour:
even in your site, from a page or post located 'http://darineko.com/fr/ID/slugFR',
the english switch link displays 'http://darineko.com/ID/slugFR', but when clicked it takes to ''http://darineko.com/ID/slugEN'.
The browser URL is correctly set only that way, and not on the opposite.

In my case, it's only possible to do viceversa (from 'ID/slugEN' to 'it/ID/slugIT', without the browser URL being updated as it happens to you), since from a 'http://localhost/it/ID/slugIT' page I can click a 'http://localhost/ID/slugIT' switcher but it takes to a 404: slug hasn't been translated nor in the browser URL, nor in the processed query.

I'm using a normal version of the plugin, I've tried to embed qTranslateSlug_generateLanguageSelectCode() into my theme sidebar instead of the default widget, but it doesn't work. I'm wondering where the difference could lie:
Wordpress version 3 vs 2.9.2? Online vs Localhost? As every other slug translation feature IS working, have you embedded the language selection in a particular way? Or is there any further specific setting about permalinks to be trimmed?

However, everyone is invited to report how well the plugin runs. If someone, as well as Fabio84 the author itself, is interested on debugging and improving the PHP code against these issues, we could merge the efforts.
sprutniks
 
Posts: 12
Joined: Mon Apr 26, 2010 9:36 pm

Re: slug translation implemented, needs review

Postby karine » Mon Jun 07, 2010 4:43 pm

Hello,
I hope you can find a solution soon!
Here are some more infos:

I have tested a local install, and the redirect works as in my online installation (slug is translated in adress bar) so I don't think the problem is online vs. local.
I am using the default widget for the language chooser
I have Wordpress installed at the root of my servers

Have you installed wordpress in a subfolder ?
So the only other thing left is WordPress version, or maybe an other plugin conflicting ? Are you using something else that redirects URL, etc.?


In my case, it's weird that the slug translates from french to english but not the other way... However, when we try to share the URL with the sociable plugin, the URL is correct. Oh well... ^^;
- Thank you for the plugin!
DarineKo.com
karine
 
Posts: 17
Joined: Tue Jun 01, 2010 7:20 pm
Location: Paris

Re: slug translation implemented, needs review

Postby sprutniks » Tue Jun 08, 2010 12:09 am

Thanks for your help,
after some debugging stress, even if still unable to find an effective workaround, at least I've managed to track the cause of the problem.
With the same settings and plugins activated on a fresh local install of WP version 3.0RC2, slug translation redirect WORKS just like in your site.

So, the good thing is that we're going to have already tested an even better compatibility with newer versions, on the other hand for a full backward compliance the functions qTranslateSlug_getSelfUrl and then qTranslateSlug_generateLanguageSelectCode should be reviewed to succesfully translate the slug.

I would like to prepare and release a widget-ready version of the plugin (to get rid of the need to manually add the code into the template), but as fabio84 clearly stated in the code comments, the main URL conversion basically "corresponds to qtrans_convertURL, but for now it doesn't check if the url contains translatable slugs". So the language chooser, provided from qTranslateSlug, unfortunately seems to be quite useless.

Hope to have updates soon

EDIT: it seems that the language select code slug translation (qTranslateSlug_generateLanguageSelectCode) is running almost perfectly on one of the latest works done by fabio's company with WP 2.9.2. I guess I could keep trying to get it work on the same platform, but I'm wondering if meanwhile the plugin has been upgraded. Fabio, are you still with us?

ANOTHER EDIT: now using
Code: Select all
if ( function_exists('qTranslateSlug_generateLanguageSelectCode') ) {qTranslateSlug_generateLanguageSelectCode('both', 'qtrans_language_chooser');}
in my sidebar.php, it appears to perform well on both WP 2.9.2 & 3.0RC2... I believe that something was wrong with my permalink structure before this hard work!
sprutniks
 
Posts: 12
Joined: Mon Apr 26, 2010 9:36 pm

Re: slug translation implemented, needs review

Postby fraincs » Thu Jun 17, 2010 7:52 pm

Hi and thanks for all the hard work. I am trying to get the translated slugs to work. As of now I've translated all my slugs. everything wokrs when I type the full path in my broswer. The problem that I have is I haven't figured how to get the links to work . I have a header with links to different pages what should I put in my <a href="">?

my qtranslate setting is set to ?lang=fr / ?lang=en
I can provide more information as needed
fraincs
 
Posts: 1
Joined: Thu Jun 17, 2010 7:46 pm

Re: slug translation implemented, needs review

Postby kiwus » Wed Jul 28, 2010 12:09 pm

Can anyone tell me where do i put
Code: Select all
qTranslateSlug_getSelfUrl($lang)

inside my theme?

Another thing, which i see has happened to others is that I get 404 when trying to run page on language custom slug f.e.:
www.domain.com/collection/struktury/ is default page url and works fine. For english the slug is 'structures' and
www.domain.com/collection/structures/ returns 404

Can anyone advise me on these issues?
Thanks in advance ;)
kiwus
 
Posts: 1
Joined: Wed Jul 28, 2010 12:07 pm

Re: slug translation implemented, needs review

Postby Thomas Krüger » Fri Oct 01, 2010 11:38 am

Got it working! Quite simple with a modification in the database.

1. Install the plugin http://wordpress.org/extend/plugins/qtr ... th-widget/
2. Manual rename of the table qtranslate_slug in your wordpress database if you are using a prefix like wp_ for your tables with phpMyAdmin.
see "How to rename a table using phpMyAdmin " at http://support.lunarpages.com/knowledge ... rticle/289
Thomas Krüger
 
Posts: 34
Joined: Sat Sep 19, 2009 5:31 am

Re: slug translation implemented, needs review

Postby theycallmediddy » Sat Oct 16, 2010 9:48 pm

sprutniks wrote:ANOTHER EDIT: now using
Code: Select all
if ( function_exists('qTranslateSlug_generateLanguageSelectCode') ) {qTranslateSlug_generateLanguageSelectCode('both', 'qtrans_language_chooser');}
in my sidebar.php, it appears to perform well on both WP 2.9.2 & 3.0RC2... I believe that something was wrong with my permalink structure before this hard work!


I use this code and my permalink structure is "/%postname%/". Links are shown correctly with translated URLs but I get a 404 error when I click them.
Any help on this? Thanks so much!
theycallmediddy
 
Posts: 6
Joined: Sat Oct 16, 2010 9:46 pm

Re: slug translation implemented, needs review

Postby baga » Sun Oct 31, 2010 6:50 pm

theycallmediddy wrote:
sprutniks wrote:ANOTHER EDIT: now using
Code: Select all
if ( function_exists('qTranslateSlug_generateLanguageSelectCode') ) {qTranslateSlug_generateLanguageSelectCode('both', 'qtrans_language_chooser');}
in my sidebar.php, it appears to perform well on both WP 2.9.2 & 3.0RC2... I believe that something was wrong with my permalink structure before this hard work!


I use this code and my permalink structure is "/%postname%/". Links are shown correctly with translated URLs but I get a 404 error when I click them.
Any help on this? Thanks so much!


You should set your permalink structure like this: /%postid%/%postname%/
baga
 
Posts: 14
Joined: Sat Apr 03, 2010 1:07 pm

PreviousNext

Return to qTranslate Suggestions Forum

Who is online

Users browsing this forum: No registered users and 3 guests