Reputation: 2329
I have this strange problem when i created in my wordpress admin a page with 2 languages arabic and english (titles and contents) but when i go to page link this
http://site.com/ar/page
it redirect me to default language link
http://site.com/page
I thought the solution the i have to include both titles name in the link so it can work
http://site.com/page_en_title-page_ar_title
But it is just an assumption i don't think it's correct
So is there something missing i should have done ??
Upvotes: 0
Views: 5797
Reputation: 1
From my personal experience, I was wrong using the option "Pre-route" (by default, adds "/es/" before the URL) in Advanced Settings inside qTranslate Options. So, using bloginfo('template_url') every link always took me to the default language...
Now that I just changed to the 3rd option in Avanced Settings, (add in the end ?lang=xx) everything works fine because I can use bloginfo with my subpage adding in the end the current language:
href="<?php bloginfo('template_url'); ?>/mysubpage/?lang=<?php echo qTranslate_GetLanguage(); ?>"
Hope this helps!
Upvotes: 0
Reputation: 11
Hi I had the same problem. Its all about the '/' in the end of the link.
I hardcoded some links in my header.php and this works:
<a href="<?php echo get_bloginfo('url') ?><?php if(qtrans_getLanguage() == "en") echo ('/en/cooperation/'); else echo ('/cooperation'); ?>" style="color:#fff;"/>Cooperation</a>
This doesnt work:
<a href="<?php echo get_bloginfo('url') ?><?php if(qtrans_getLanguage() == "en") echo ('/en/cooperation'); else echo ('/cooperation'); ?>" style="color:#fff;"/>Cooperation</a>
Notice that the only thing ive changed is the '/' after cooperation in the link URL. Hope this helps!
Upvotes: 1
Reputation: 6359
So ar is default language and when you go to http://site.com/ar/page it redirects you to http://site.com/page?
If that is the case, go to Settings > Languages and under Advanced Settings you have the following option:
If selected, deselect that option.
Upvotes: 1