Title: Set lang in shortcode
Last modified: August 22, 2016

---

# Set lang in shortcode

 *  Resolved [ste_yeu](https://wordpress.org/support/users/ste_yeu/)
 * (@ste_yeu)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/set-lang-in-shortcode/)
 * Hi,
 * I’m using this great plugin but I need to translate my website in 2 languages,
   so Pie-Register should be translated in each specific page of each specific language.
 * How can I add lang in shortcode?
 * Generally most of plugins use this in their shortcodes:
 * `[pie_register_form lang="en"]`
 * `[pie_register_form lang="it"]`
 * `...`
 * I’ll translate all the plugin in my language (italian) and after I’ll upload 
   it in GitHub… but first I need your help, please! 🙂
 * Thanks in advance.
 * [https://wordpress.org/plugins/pie-register/](https://wordpress.org/plugins/pie-register/)

Viewing 1 replies (of 1 total)

 *  Thread Starter [ste_yeu](https://wordpress.org/support/users/ste_yeu/)
 * (@ste_yeu)
 * [11 years, 9 months ago](https://wordpress.org/support/topic/set-lang-in-shortcode/#post-5278528)
 * I resolved by myself.
 * First of all, I suggest to use the plugin called “Polylang”, a great plugin to
   translate any part of your site.
 * With Polylang you can create a page for each language and after you can “connect”
   every specific page in every specific language.
 * So, you can put the shortcode of Pie Register in each registration page (one 
   for each language):
 * `[pie_register_form]`
 * Then you need to translate every label field, example:
 * “Your Name” > “Il tuo Nome”.
 * To do this you can use _if else_ in php to change css display=inherit/none.
 * So, in WP backend go to Form Editor, create your form and use <span> for each
   text, example:
 * <span>Last Name</span><span>Cognome</span>
 * <span>English text</span><span>Testo Italiano</span>
 * Then go to header.php of your theme and put this code in tag <head>:
 *     ```
       <?php
   
       		$url = 'http://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']; // url page
   
       			if (false !== strpos($url,'en')) { // find str 'en' in url
           			echo '<style type="text/css">
       				label span:nth-child(1) { display:inherit; }
       				label span:nth-child(2) { display:none; }
       				</style>';
       		} else {
       			echo '<style type="text/css">
       				label span:nth-child(1) { display:none; }
       				label span:nth-child(2) { display:inherit; }
       				</style>';
       			}
       	?>
       ```
   
 * Now you’ll see the specific text for each language. 🙂
 * Sorry for my English, I hope it’s clear.

Viewing 1 replies (of 1 total)

The topic ‘Set lang in shortcode’ is closed to new replies.

 * ![](https://ps.w.org/pie-register/assets/icon-256x256.png?rev=2467686)
 * [Pie Register – User Registration, Profiles & Content Restriction](https://wordpress.org/plugins/pie-register/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/pie-register/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/pie-register/)
 * [Active Topics](https://wordpress.org/support/plugin/pie-register/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/pie-register/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/pie-register/reviews/)

## Tags

 * [lang](https://wordpress.org/support/topic-tag/lang/)
 * [shortcode](https://wordpress.org/support/topic-tag/shortcode/)

 * 1 reply
 * 1 participant
 * Last reply from: [ste_yeu](https://wordpress.org/support/users/ste_yeu/)
 * Last activity: [11 years, 9 months ago](https://wordpress.org/support/topic/set-lang-in-shortcode/#post-5278528)
 * Status: resolved