Title: Widget content and css
Last modified: November 5, 2017

---

# Widget content and css

 *  Resolved [Iara](https://wordpress.org/support/users/iara-chan/)
 * (@iara-chan)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/widget-content-and-css/)
 * Hello!
 * I’m migrating to this plugin, but it seems that it does not support widget content
   translation? What about css content?
 * Like:
 *     ```
       font-family: "[:en]font1[:ja]font2[:]";
       font-size: [:en]19px[:ja]12px[:];
       ```
   
 * Thank you!

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

 *  [VaLeXaR](https://wordpress.org/support/users/valexar/)
 * (@valexar)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/widget-content-and-css/#post-9652782)
 * Hi [@iara-chan](https://wordpress.org/support/users/iara-chan/)
    Widget content
   is translating.
 * All content is translating, not partial.
 * If You added in text widget this:
 *     ```
       font-family: "[:en]font1[:ja]font2[:]";
       font-size: [:en]19px[:ja]12px[:];
       ```
   
 * It not be translated.
 * You need add translation for each language
 * for `en`:
 *     ```
       font-family: "font1";
       font-size: 19px;
       ```
   
 * for `ja`:
 *     ```
       font-family: "font2";
       font-size: 12px;
       ```
   
 *  Thread Starter [Iara](https://wordpress.org/support/users/iara-chan/)
 * (@iara-chan)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/widget-content-and-css/#post-9715708)
 * Hello!
 * I guess I did not explain it well. What I wanted was to add two fonts to the 
   same class in style.css of my child theme to be used for each language.
 * I found a solution that worked, I’ll add it here for anyone who needs it.
    Must
   be added in theme.php’s theme or child theme.
 * Thank you very much for the support and for creating this plugin! We would be
   lost without this tool! 😀
 *     ```
       function change_font_by_language() {
       	if(strpos($_SERVER['REQUEST_URI'], 'jp') !== false){		
       		$style = '<style>
       		.my_custom_class {
       		   font-family: "myjapanesefont" !important;
       			font-size: 12px !important;
       		}
       		</style>';
       		echo $style;
       	} 
       	elseif(strpos($_SERVER['REQUEST_URI'], 'en') !== false){		
       		$style = '<style>
       		.my_custom_class {
       		   font-family: "myenglishfont" !important;
       			font-size: 19px !important;
       		}
       		</style>';
       		echo $style;
       	}
       	else{		
       		$style = '<style>
       		.my_custom_class {
       		   font-family: "myenglishfont" !important;
       			font-size: 19px !important;
       		}
       		</style>';
       		echo $style;
       	}
   
       }
       add_action( 'wp_head', 'change_font_by_language' );
       ```
   

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

The topic ‘Widget content and css’ is closed to new replies.

 * ![](https://ps.w.org/wp-multilang/assets/icon-256x256.png?rev=1760406)
 * [WP Multilang - Translation and Multilingual Plugin](https://wordpress.org/plugins/wp-multilang/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-multilang/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-multilang/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-multilang/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-multilang/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-multilang/reviews/)

## Tags

 * [css](https://wordpress.org/support/topic-tag/css/)
 * [widget](https://wordpress.org/support/topic-tag/widget/)

 * 2 replies
 * 2 participants
 * Last reply from: [Iara](https://wordpress.org/support/users/iara-chan/)
 * Last activity: [8 years, 6 months ago](https://wordpress.org/support/topic/widget-content-and-css/#post-9715708)
 * Status: resolved