Support » Plugin: Slimstat Analytics » Opt-out message multilingual

  • Slimstat is as great plugin, but I see no option to make a multilingual opt-out message. I’m using WPML.

    Is there an chance to make the opt-out message multilingual?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Jason Crouse


    Hi, you can customize the message, and the markup around it, in the plugin’s settings.

    Hello Jason,

    hm, then please tell me how to add other languages for the opt-out message.

    In the available field “Opt-out message” there is only a html input textarea. Since I’m using WPML i need PHP to add a string for the String Translation Tool or an input textarea for each language.

    I want “This website stores cookies on you computer” in english and in German (if someone opens the site from Austria, Germany or Switzerland) “Diese Website speichert Cookies auf Ihrem Computer.”

    Also in english the buttens “Accept” and “Deny”, in German “Annehmen” and “Ablehnen”.

    This is not possible with HTML only, as far as I know.

    Plugin Author Jason Crouse


    Hi Chris,

    you make a good point. I wonder, though, how this could be implemented in a way that lets website administrators customize their messages, if they want to. Embedding those strings in a .po file might put this feature out of reach of most people who don’t have a lot of experience editing those files, let alone FTP-ing them to their server.

    Any recommendations on how to achieve what you suggest, without giving up the flexibility that we had in mind when we implemented this feature?


    Hello Jason!

    Hm, best would be adding just other textares below, one for each available language in WPML. So, at the moment I don’t have the code ready, but i’m shure it is easy:

    1. to get all languages defined in WPML
    2. render a textarea for each language
    3. store the content of the textareas as an (best associative) array in the wp database
    4. fetching the appropriate array index if the PHP condition (example for German) if($_GET[lang] == "de" || strstr($_SERVER['REQUEST_URI'], '/de/')) is given.

    I’m not sure what I will do, I need it soon. Building an add-on for slimstat would be the best way. Another – not very elegant – way is to put the text for all languages in the single textarea and wrap each language in something like <div "optouttext-[lang]" style="display: none;">, then showing only the appropriate <div> via a JavaScript function which filters the URL, if it is possible.

    Slimstat is an alternative to Google Analytics and many people are looking for such an alternative. So, the future is in Europe already there, and, as you know, there is not only one language spoken in Europe…;-).

    Plugin Author Jason Crouse


    I’m not fully convinced that MANY text areas would be the best way to solve the problem, as this solution doesn’t really scale well and it would require a substantial change in how we handle our settings. We are working with WPML to get access to their developers program. I am leaning towards implementing a feature that uses some kind of “placeholder-like” solution, that works in conjunction with WPML. Stay tuned.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Opt-out message multilingual’ is closed to new replies.