Forum Archive - Change CSS Style with each language

Change CSS Style with each language
May 28, 2011 10:17 am by siliconstudio
In WordPress I have a fixed width menu and my original layout was optimized for English. Selecting some other languages forces my menus to over-run the menu area which doesn't look nice. What I want to do is to automatically change (CSS) style classes depending on the language chosen by the user, so that parameters like font-size and menu padding change on-the-fly and the menu remains in the menu area without over-running the fixed width menu area. Does anyone have any ideas on how to do this, most likely in PHP?
Re: Change CSS Style with each language
May 31, 2011 8:07 am by Edvard
You can try to modify the javascript doTranslate function and make your CSS changes there depending on the selected language.
Re: Change CSS Style with each language
Aug 8, 2012 10:36 pm by SteckInsights
SiliconStudio, did you have any luck with this? I've been messing around with trying to declare a custom body class depending on the URI returned by GTranslate, but for some reason that's not working. Did you figure out a solution by modifying "doTranslate"? I try to avoid modifying the functions directly because I don't want them to get erased on the next GTranslate update. Thanks, in advance!
Re: Change CSS Style with each language
Aug 13, 2012 9:10 pm by Edvard
You may also check for currently selected language. In Enterprise version it sets a header X-GT-Lang which you can access with $_SERVER['HTTP_X_GT_LANG']. To get the current language code in Pro you can read this: url-language-code-t320.html?hilit=glang


Large numbers of crawl errors with double language codeJan 24, 2019 1:43 amReplies: 1Post by: natastna2
Translate website to any specific language, on page loadJan 19, 2019 6:49 amReplies: 1Post by: Leaon7756
Graphic translation for every language is missingDec 19, 2018 7:54 amReplies: 1Post by: Daryl Dixon
How to remove mobile Language Select Button transparencyDec 5, 2018 10:06 pmReplies: 10Post by: JeffTR
Change language automaticallyNov 26, 2018 9:29 pmReplies: 3Post by: Antilb

Try GTranslate with a free 15 day trial