Quantcast
Channel: polylang – WordPress.org Forums
Viewing all articles
Browse latest Browse all 11471

Chouby on "Polylang&Avenue theme from web2feel - Listing translation"

$
0
0

If you want to do this with the Polylang string translation feature, that's a bit different. The doc is here.
use

pll_e('Price');

instead of

_e('Price','my-text-domain')

to do the translation on frontend

And to put the strings in the translation table on admin, write that somewhere in your functions.php:

pll_register_string('just a name for my string', 'Price');

However, that code breaks wehn Polylang is de-activated (so for example during the upgrade). So it is better to write:

if (function_exists('pll_register_string')) {
  pll_register_string('just a name for my string', 'Price');
}

and

if (function_exists('pll_e')) {
  pll_e('Price');
else {
 echo 'Price';
}

Viewing all articles
Browse latest Browse all 11471

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>