Scroll Translations: How can I refer to the language key in a user macro written with Velocity

Comments

3 comments

  • Avatar
    Daria Huber (K15t)

    Hi Nicole,

     

    language parameter is not available over velocity but you can get it over Java Script Context Scroll.Versions.Context.user.currentLanguage.

     

    Hope that helps!

    Cheers,

    Daria

    0
    Comment actions Permalink
  • Avatar
    Nicole Fischer

    Hello Daria,

    Thank you very much for your reply. Unfortunately, I have no experience with Java Script. Could you help me more precisely in terms of how and where to use your idea, please?

    Thank you very much in advance.

    Cheers,

    Nicole

     

     

    0
    Comment actions Permalink
  • Avatar
    Nicole Fischer

    Hello,

    I have been trying the following JavaScript:

    <SCRIPT type="text/javascript">

    var element = document.getElementById('main-content').innerHTML=Scroll.Versions.Context.user.currentLanguage.toString();

    </SCRIPT>

    The script returns [object Object]. So it seems to me as if I am accessing the right thing but I do not know how to return the language.

    Can anyone help?

    Cheers,

    Nicole

     

    0
    Comment actions Permalink

Please sign in to leave a comment.

Powered by Zendesk