Title: Translate shortcode text
Last modified: August 20, 2016

---

# Translate shortcode text

 *  Resolved [jasonsweb](https://wordpress.org/support/users/jasonsweb/)
 * (@jasonsweb)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/translate-shortcode-text/)
 * Hi,
 * Is it possible to add a translation/text domain to a shortcode?
    In my theme 
   I use the standard code to translate a line, like: `<?php _e('Hello, this is 
   text', 'domain'); ?>`
 * But how can I implement this into my shortcode with a domain?
    Like:
 *     ```
       $shortcode .= '<span>Hello, this text should be translated.</span>';
       return $shortcode;
       ```
   
 * Thanks in advance.

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

 *  [shahar](https://wordpress.org/support/users/shahar/)
 * (@shahar)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/translate-shortcode-text/#post-3269916)
 * Hi jasonsweb, you can do it like this:
 *     ```
       $shortcode .= '<span>' . __( 'Hello, this text should be translated', 'domain' ) . '</span>';
       return $shortcode;
       ```
   
 *  Thread Starter [jasonsweb](https://wordpress.org/support/users/jasonsweb/)
 * (@jasonsweb)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/translate-shortcode-text/#post-3269917)
 * Thanks!

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

The topic ‘Translate shortcode text’ is closed to new replies.

## Tags

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

 * 2 replies
 * 2 participants
 * Last reply from: [jasonsweb](https://wordpress.org/support/users/jasonsweb/)
 * Last activity: [13 years, 3 months ago](https://wordpress.org/support/topic/translate-shortcode-text/#post-3269917)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
