how to see only one language with qTranslate
-
How i can see my web page in English and to have option to translate that page with qTranslate in some other language. I want to see page in default language and when i click the language option in my header to see page on some other language
I used this trick and add this in my header.php
<?php echo qtrans_generateLanguageSelectCode(text); ?>
-
in the qtranslate setting, you can choose your default language, select the language you wih and it’s done.
ok, ok, i get now… i missundestood you
I guess you should inert code manually, not with function. Can you post a linmk to your site so we can help you?
Now i have two options in my header, but i want to have only one, for example when i open my page i want to see web site in english only and to have in my have option to change to some other language for example spanish,franch or some other language
in a brief inspect on ypur web sourcecode i find a solution….
If i undrestood you want the “actual” language button don’t be shown ?it’s ok? so…
You shoukld download Custom CSS Manager plugin, it allows you to create and add your changes to CSS file… You also can edit your css file directly, but any change will be lost on theme update… Use the plugin is a better option.
In your source code can see there is a well formatted structure to “active language” button…
<ul class="qtrans_language_chooser" id="qtranslate-chooser" <li class="lang-en active"> <a href="https://dis.ijs.si/e-pedius/index.php?lang=en" hreflang="en" title="English"> <span>English</span></a> </li> <li class="lang-si"> <a href="https://dis.ijs.si/e-pedius/index.php" hreflang="si" title="Slovenian"><span>Slovenian</span></a> </li> </ul>
So you can create a css selector to it…
.qtrans_language_chooser .active { }
any CSS rule will be applied to active language link (whatever this language be). Just make it be non visible using “display: none”
.qtrans_language_chooser .active { display:none !important; }
The !important attribute is to ensure this will be applied even if there is some other display mode apllied to selector, than could mess with it.
I hope it be usefull to you.
thank you very much. I have one more question i you have time of course, how to move that button to be right align, not like now
Actually it’s right aligned (i supose) your page must have some wrapper with a fixed width to avoid the page become too wide if is viewed in a big screen…
It’s like a “invisible box” than contains all site’s elements…
By the way, if you want keep it aligned in the right of browser (instead of the right of wrapper) there’s a way, unsing position:absolute…
inspecting your code your Language buttons are in a div with .forma class
<div class="forma"> <ul class="qtrans_language_chooser" id="qtranslate-chooser" <li class="lang-en active" <a href="https://dis.ijs.si/e-pedius/index.php?lang=en" hreflang="en" title="English"><span>English</span></a> </li> <li class="lang-si"> <a href="https://dis.ijs.si/e-pedius/index.php" hreflang="si" title="Slovenian"><span>Slovenian</span></a> </li> </ul> </div>
Using again the Custom CSS Manager you could try add this rule
.forma { positon:absolute !important; top:XXpx; right:YYpx; }
Where XXpx is the number of px you want of distance to top of browser viewport area (for example, an top:117px is equivalent to its place right now) and yy the pixels distance to right;
Something like:
.forma { positon:absolute !important; top:117px; right:0px; }
But if you try this… The lanhguage button will be in the same place! Cause is inside a wrappper marked as “position:relative” to explain it fast… A position:relative parent element affect to child elements when using position:absolute… Making it absolute to parent element instead of browser.
To it working need remove “postion:relative” from parents… And inspecting the code there are 3 “relative” parent elements ( .cf, #header-container and #contentwrap ). So you should replace with position:inherit; Like this…
.cf, #header-container, #contentwrap { position:inherit; }
An apply the style to .forma container (contains your language buttons)… All put together should look like this
.cf, #header-container, #contentwrap { position:inherit; } .forma { positon:absolute !important; top:117px; right:0px; }
By the way it can affect to another elements, so use the Custom CSS Manager plugin to you can revert changes easy if mess something
sorry but nothing has changed. i put
.cf, #header-container, #contentwrap { position:inherit; } .forma { positon:absolute !important; top:117px; right:0px; }
in my style.css at the end but now my language button is next to the menu items, now at the right side of my menu
If you want i can put my style.css file here
Sorry, i mispelled position… I wrote postion
.cf, #header-container, #contentwrap { position:inherit; } .forma { position:absolute !important; top:117px; right:0px; }
Try this
Hey, man… It works now?
Hey i didn’t try that, because i don’t have access on that page anymore. I will try that on monday. And if i want to put items from the menu line , for example Domov,Novice,Podatki projekta,… i have to make the same, just find their parent element/class and do the same like .forma(just left 0px ) right ?
If you have some time please see if this is the right parent class
.menu-navigation-container {And thank you anyway for your time and work
It looks like if something is messi here… So, i tried the code now and don’t work propertle (so menu looks in right place now… I think the better is revert all CSS position cahnges and look what’s going bad)
See u monday, man ?? it’s weekend at last!
i tried your code
.cf, #header-container, #contentwrap { position:inherit; } .forma { position:absolute !important; top:117px; right:0px; }
but now i cannot see my eng option on the screen. Is there any other trick to move eng button to the right and menu items to the left,i mean left to the left end, not like now
i know… it worked first time i try… but later, something changed, cause your menu appears now properly aligned in the wrapper (first time i seen the webm it wasn’t there, it was aligned to the right of browser.)
Something is wrong, but is hard to say without cen see the whole code… Today i’ve been terribly bussy in work, i’ll take a look tomorrow….
But, as i said, the best optoino, by now, il remove the changes of “position” in wrappers and begin again
- The topic ‘how to see only one language with qTranslate’ is closed to new replies.