Abbreviations and acronyms plugin

So i have this code in a file called abbreviations.js.es6

import { registerOption } from 'pretty-text/pretty-text';

registerOption((siteSettings, opts) => {
  opts.features['abbreviations'] = !!siteSettings.abbreviations_plugin_enabled;
});


function abbreviate(text) {
  var siteSettings = Discourse.SiteSettings;
  if (siteSettings.abbreviations_plugin_enabled) {
      //blabla.............
  }
  return text;
}

export function setup(helper) {
    helper.addPreProcessor(abbreviate);
}

The line

var siteSettings = Discourse.SiteSettings;

is giving me some headaches. Can someone give me some advice on how to reach Discourse.SiteSettings from there?
It works in the client, (i.e the preview window), but when I try to save the message that line gives an error, there is no way to save the message.

4 Likes