• Resolved frilansmagi

    (@frilansmagi)


    Hi,

    I have followed the guide and got it up and running. But how would i do if i in want to echo a varible and not a string?

    instead of:
    {{ pll_e("Test text on TWIG template 1.") }}

    I want to:
    {{ pll_e(my.twig.var) }}

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Marcin Kazmierski

    (@marcinkazmierski)

    Hi,
    it is not possible because the plugin has got a string scanner.
    Scanner finds strings to translate in code of plugins or themes which are used in pll_e or pll__ functions.

    So i have same problem i have a array which i loop trough:

    <?php foreach ($array as $variable) {
          pll_e($variable'); 
    }; ?>

    It echo the variable right but i can’t see any string to translate.

    Plugin Author Marcin Kazmierski

    (@marcinkazmierski)

    Polylang function pll_e() do not support variables, only clear strings.

    Maybe something to report at polylang? ??
    I write a ticket, i think that could be a nice feature.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Variable from PHP.’ is closed to new replies.