Title: Translate strings
Last modified: May 5, 2021

---

# Translate strings

 *  Resolved [oribrn](https://wordpress.org/support/users/oribrn/)
 * (@oribrn)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/translate-strings-10/)
 * Hi,
 * I have register a custom sting to function.php:
 *     ```
       add_action('init', function() {
                      pll_register_string('similar', 'varietes');
       });
       ```
   
 * Now, I try to echo inside php template file:
 * `echo '<div class="related"><h4 class="related-portfolio"> Translation text </
   h4><ul>';`
 * **to**
 * `echo '<div class="related"><h4 class="related-portfolio"> ' . pll_e('similar').'
   </h4><ul>';`
 * What am I doing wrong in syntax?
 * Thanks
    -  This topic was modified 5 years, 2 months ago by [oribrn](https://wordpress.org/support/users/oribrn/).
    -  This topic was modified 5 years, 2 months ago by [oribrn](https://wordpress.org/support/users/oribrn/).

Viewing 1 replies (of 1 total)

 *  Thread Starter [oribrn](https://wordpress.org/support/users/oribrn/)
 * (@oribrn)
 * [5 years, 2 months ago](https://wordpress.org/support/topic/translate-strings-10/#post-14403657)
 * solved

Viewing 1 replies (of 1 total)

The topic ‘Translate strings’ is closed to new replies.

 * ![](https://ps.w.org/polylang/assets/icon-256x256.png?rev=3433336)
 * [Polylang](https://wordpress.org/plugins/polylang/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/polylang/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/polylang/)
 * [Active Topics](https://wordpress.org/support/plugin/polylang/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/polylang/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/polylang/reviews/)

 * 1 reply
 * 1 participant
 * Last reply from: [oribrn](https://wordpress.org/support/users/oribrn/)
 * Last activity: [5 years, 2 months ago](https://wordpress.org/support/topic/translate-strings-10/#post-14403657)
 * Status: resolved