News Update :
Home » » Translate a website with WPML - PHP code in the theme

Translate a website with WPML - PHP code in the theme

By: Unknown on Wednesday, 25 February 2015 | 16:27

If you wish to translate a website with WordPress , WPML is a very good solution for the design of multilingual site.

Web-site-translated-WordPress-WPMLFirst, it is important to understand that WordPress is designed in English, then translated from English into another language.

 


 So if we want to build a theme that can be translated , we will put the content in English and wrap a tag that will allow us to translate it later in the desired language.

Here is the PHP code to wrap the HTML you want to translate:


1
<?php _e('English HTML content','theme-text-domain');?>
Ex:


1
<div id="booking"><?php echo _e('<a href="#">My Links</a>','theme-text-domain');?></div>
theme-text-domain must be changed to the name of your theme, you can find the name of the template in your style.css sheet

location-the-theme-wpmlThen go to the dashboard:

WPML / theme Location and extension modules

Click  Apply below Translate with .mo file

WPML will search for new PHP tag inserted in the theme.

Translation-de-strings-wpmlGo to  WPML / chains Translation

You are now ready to translate from English to French.
 
Contact Us | Privacy policy | Term of use | Advertise with Us | Site map
Copyright © 2011. Blogging Brain . All Rights Reserved.
Design Template by Blogging Brain | | Powered by Blogger