1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Lack of Interest Easy way to add Phrases to the js phrases

Discussion in 'Closed Suggestions' started by ragtek, Jul 21, 2011.

  1. ragtek

    ragtek Guest

    It would be great, if we could add js phrases via an static method global from everywhere (controller, template hook,..)

    For example:


    which would generate the code and insert it into the page_container_js_body phrases part
    cancel: "{xen:jsescape {xen:phrase cancel}}",
    (Coders are lazy;) )I don't like to use the page_container_js_body template hook and search replace there, only to add 1 phrase...
    Yoskaldyr likes this.
  2. ragtek

    ragtek Guest


    To add only 1 phrase i had to:

    1. create a template
    jQuery.extend(XenForo.phrases, { ragtek_show_user_details :  "{xen:jsescape {xen:phrase ragtek_show_user_details}}" });
    2. create a template hook event listener to add this to the template
    3. create a template create event listener, to cache the template

    (ok, it would be possible to work with str_replace in template hook page_container_js_body but because of the bad experiance with other add-ons ( http://xenforo.com/community/threads/adding-links-to-the-visitor-tab.17953/ ) i'm trying to avoid this as much as possible)

Share This Page