Title: Call pll_e function from JavaScript
Last modified: July 10, 2018

---

# Call pll_e function from JavaScript

 *  Resolved [Igor Lopasovsky](https://wordpress.org/support/users/igorlopasovsky/)
 * (@igorlopasovsky)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/call-pll_e-function-from-javascript/)
 * Hey Guys,
 * Is it somehow possible to call pll_e function from JavaScript? I generate HTML
   content dynamically from JS and I need it to be translated.
 * Many thanks for help.

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

 *  [codestylist](https://wordpress.org/support/users/codestylist/)
 * (@codestylist)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/call-pll_e-function-from-javascript/#post-10479973)
 * pll_e is a PHP function and it runs on the server. PHP generates the final HTML
   code. JavaScript is embedded in HTML and it runs on the client, so it can not
   call a PHP function. If you want to do so, you have to use ajax to request a 
   PHP result.
 *  Plugin Author [Chouby](https://wordpress.org/support/users/chouby/)
 * (@chouby)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/call-pll_e-function-from-javascript/#post-10481549)
 * Hi,
 * This is the function used by WP to send translated strings from PHP to js: [https://developer.wordpress.org/reference/functions/wp_localize_script/](https://developer.wordpress.org/reference/functions/wp_localize_script/)
 * You can use `pll__()` instead of `__()` to do the same with strings translated
   by Polylang.
 *  Thread Starter [Igor Lopasovsky](https://wordpress.org/support/users/igorlopasovsky/)
 * (@igorlopasovsky)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/call-pll_e-function-from-javascript/#post-10482784)
 * Thank you very much for help. This is exactly what I was looking for.

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

The topic ‘Call pll_e function from JavaScript’ 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/)

 * 3 replies
 * 3 participants
 * Last reply from: [Igor Lopasovsky](https://wordpress.org/support/users/igorlopasovsky/)
 * Last activity: [7 years, 10 months ago](https://wordpress.org/support/topic/call-pll_e-function-from-javascript/#post-10482784)
 * Status: resolved