Fork me on GitHub

passing language constants to ajax code does not work!  Bottom

  • Hi,

    I have a pnajax.php code that passes a language constant (for example: _PMSENT) to the response function in javascript. But it is showing it as _PMSENT to the browser instead of "The PM has been sent" as defined in the language file! How can I make it to pick up the definition instead of showing the constant name?

    Thanks in advance.
  • Hi,

    you have to deliver it in an already translated form (return pnML('_PMSENT'); ), since JavaScript does not know the language defines.

    --
    Guite | ModuleStudio
  • Can I use the pnML function in the PHP side not in the template?
  • I guess you can use the pnml modifier
    '_LANG_DEFINE'|pnml

    or the pnml plugin
    <!--[pnml name='_LANG_DEFINE']-->

    in the template side icon_wink

    --
    - Mateo T. -
    Mis principios... son mis fines

This list is based on users active over the last 60 minutes.