Tomek Buszewski
Tomek Buszewski

Reputation: 7955

qTranslate ignores language in url

I want to create a website written in two languages. I used qTranslate and it seems to be working okay. But, I have couple of conditional elements in my theme, like:

<li><a href="/<?php if(qtrans_getLanguage()=='en') { ?>en<?php } else { ?>pl<?php } ?>></li>

Which detects if either language is pl or en and creates the link according to that. But, when I click the link http://localhost/en/something for example, it ommits en and loads http://localhost/something with default language. What can I do to change it?

edit: this happens only on custom post types.

Upvotes: 1

Views: 2814

Answers (2)

Mateus Ferreira
Mateus Ferreira

Reputation: 529

Came across this problem too. Adding / didn't make any difference.

Using ?setlang=no instead solved my problem.

Source: qTranslate-X FAQ

Upvotes: 0

Tomek Buszewski
Tomek Buszewski

Reputation: 7955

I solved the issue. Adding / at the end of the link helped.

Upvotes: 1

Related Questions