Support » Plugin: qTranslate X » Qtranslate-x Custom CSS Per Language

  • Resolved Switch0x

    (@switch0x)


    Dear Qtranslate-x Team,

    Plugin is more than perfect.. i’ve been using it to make all of my clients multilingual

    but the main issue that i am facing with qtranslate-x is i am not to able to set a custom CSS Code (Font-family) to be specific per language

    Meaning that i want to set a custom font on arabic language without effecting the font-family used in the language language

    i tried multiple methods to achieve this without reaching to anything … i am using Custom CSS plugin for wordpress to set any CSS codes to my websites

    i tried setting body.rtl and the {font-family: Cusotmfont;} even with !important attribute to force overwrite the css and it worked but the font used in the english language was effected

    i also tried putting get_translatex() class beside the body tag in the header.php file .. and then used body.ar {font-family: Custom Font}; but also it didn’t work out beside it caused most of my sites to crush

    So can any one help with this !!!
    it will be really appreciated !

Viewing 2 replies - 1 through 2 (of 2 total)
  • @switch0x

    Try this:

    Make your CSS files. Example, for German language and give the name as styles-de.css for English language styles-en.css
    Place these files in the same folder where your CSS file for your theme is.

    In de file functions.php from your theme put this code at the end.

    function mytheme_language_scripts() {
        $langcode = qtranxf_getLanguage();
        wp_enqueue_style( 'lang-style', get_bloginfo('stylesheet_directory').'/styles-'.$langcode.'.css' );
    }
    
    add_action( 'wp_enqueue_scripts', 'mytheme_language_scripts' );
    Plugin Author John Clause

    (@johnclause)

    I am sorry for your trouble. We currently do not have resources to answer support questions for free and rely on the community to provide a possible solution, which seems to work well in many cases. Many thanks to our active community members who take a good time to answer people’s problems!

    Most of the problems should be resolvable with https://qtranslatexteam.wordpress.com/integration/ and https://qtranslatexteam.wordpress.com/troubleshooting/.

    We need to figure out a way to monetize the support and further development. We would highly appreciate if you take about 5 minutes of your time to respond to the survey linked here: https://wordpress.org/support/topic/what-is-the-future-of-qtranslate-x/

    Any ideas and additional input are also welcome, use the same thread linked above for everyone to see your thoughts.

    Thanks a lot!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Qtranslate-x Custom CSS Per Language’ is closed to new replies.