Title: CSS Class for font
Last modified: August 24, 2016

---

# CSS Class for font

 *  [Webonary](https://wordpress.org/support/users/webonary/)
 * (@webonary)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/css-class-for-font/)
 * On a multilingual dictionary we are using a language that requires a special 
   font. This font looks odd for the English interface (besides we don’t want to
   wait for the download of the font if we’re just using English).
 * It would be great if qTranslate would add a css class in the tag before the translation
   so that one could do something like this in the style sheet:
 * .languagename {
    font-family: SpecialFont; }
 * Philip
 * [https://wordpress.org/plugins/qtranslate-x/](https://wordpress.org/plugins/qtranslate-x/)

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [John Clause](https://wordpress.org/support/users/johnclause/)
 * (@johnclause)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/css-class-for-font/#post-6072857)
 * New feature request? Do you mean front-end or back-end? Please, describe the 
   specifications more accurately, preferably with specific examples.
 *  Thread Starter [Webonary](https://wordpress.org/support/users/webonary/)
 * (@webonary)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/css-class-for-font/#post-6072867)
 * Yes, I guess this is a feature request unless you know some other way around 
   this issue.
 * So at the moment I need to add a span-tag with the class in front of each post
   for that specific language that has it’s own font.
 * In this case I’m adding the class nuosu for the title (which will also appear
   as a menu item):
 * Screenshot: [http://i.imgur.com/nPo1mCr.gif](http://i.imgur.com/nPo1mCr.gif)
 * This is the nuosu class:
 * .nuosu {
    font-family: Nuosu SIL; }
 * Philip
 *  Plugin Author [John Clause](https://wordpress.org/support/users/johnclause/)
 * (@johnclause)
 * [11 years, 1 month ago](https://wordpress.org/support/topic/css-class-for-font/#post-6073024)
 * It seems to be a useful feature. I updated list [https://qtranslatexteam.wordpress.com/desirable/](https://qtranslatexteam.wordpress.com/desirable/)
   with this topic.
 * If you are a developer, you are welcome to implement this feature and submit 
   pull request at [GitHub](https://github.com/qTranslate-Team/qtranslate-x).
 *  Thread Starter [Webonary](https://wordpress.org/support/users/webonary/)
 * (@webonary)
 * [11 years ago](https://wordpress.org/support/topic/css-class-for-font/#post-6073099)
 * [@john](https://wordpress.org/support/users/john/) Clause: OK, I’ve given it 
   a go. This is a solution that should work for us, but you can judge much better
   if it will work generally for qTranslate X or if it needs more tweaking.
 * In qtranslate-core.php, in the function qtranxf_use_language I replaced the line
 *     ```
       return qtranxf_use_block($lang, $blocks, $show_available, $show_empty);
       ```
   
 * with
 *     ```
       return "<div class=lang-" . $lang . ">" . qtranxf_use_block($lang, $blocks, $show_available, $show_empty) . "</div>";
       ```
   
 * This will add a div tag with a language class in front of the translated text.
   E.g. <div class=lang-en>some text</div>
 * If that or something similar could be implemented, that would be awesome.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘CSS Class for font’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/qtranslate-x_f9f9f9.svg)
 * [qTranslate X](https://wordpress.org/plugins/qtranslate-x/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/qtranslate-x/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/qtranslate-x/)
 * [Active Topics](https://wordpress.org/support/plugin/qtranslate-x/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/qtranslate-x/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/qtranslate-x/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [Webonary](https://wordpress.org/support/users/webonary/)
 * Last activity: [11 years ago](https://wordpress.org/support/topic/css-class-for-font/#post-6073099)
 * Status: not a support question