• Plugin & Theme Dev

    I swear I'll update this soon 😛 Just have to finish a large report in the next 1.5 weeks and I'll have spare time for plugin development 🙂

  • Any update on this @Schamper ?

  • @Schamper Please add Russian Language Support during Poll creation UI

  • @psychobunny I tried to localize the poll plugin, but the translation doesn't happen (nodebb v0.6.x). I saw the client side js use window.templates.parse(pathToTpl, data, callback ) to process the tpl and translate string such as "[[poll.votes]]" not being replaced. Any suggestion? I guess tpl translation only happens at server side code?

  • Community Rep

    I got the translator working by using a ':' to split the translation filename and variable, e.g.:


    and my languages/ru/poll.json has:

     "votes": "голосов"

  • @yariplus what the string to put in the tpl? I tried following:

    <a class="poll-view-result-votecount" href="#">{options.votecount} [[poll:votes]]</a>

    but translator didn't work:(

  • Community Rep

    I have

    <a class="poll-view-result-votecount" href="#"> "[[poll:votes]]"</a>

    (without the quotes)

  • Community Rep

    err, it keeps parsing out the text

    This is what i'm using

  • @yariplus said:

    no luck:(

    my poll.json

    Screen Shot 2015-04-19 at 12.48.27 PM.png

    The result

    Screen Shot 2015-04-19 at 12.47.12 PM.png

  • Community Rep

    @Gordon-Gu said:

    @yariplus said:

    no luck:(

    my poll.json

    Screen Shot 2015-04-19 at 12.48.27 PM.png

    The result

    Screen Shot 2015-04-19 at 12.47.12 PM.png

    Ah okay, I should have posted my whole code. Looks like the client doesn't load the language files automatically, you have to you have to call load() first in the poll init and translate() on the template. If you can wait a bit I'm going to make a PR with everything setup.

    edit: hmm, actually it does load the language automatically when you call translate(), maybe someone who knows more about the translator knows why it's not translating that template. All the admin templates work fine for me cause their parsed on the server.

    edit 2: Okay! I got it working. PR coming...

  • Community Rep

  • This works with 0.7.1?

  • @Leonardo-Galani Just gave this a shot on 0.7.3 and it appears to be broken on my end.

    Edit: It appears to work but it doesn't display the poll on the topic.

  • with me is the following problem.
    when you create is the poll not load properly with the.
    the theme appears is but empty.
    the code is but since.

    Bildschirmfoto vom 2015-08-06 10:08:53.png

    Bildschirmfoto vom 2015-08-06 10:09:23.png

  • @ogerly Yup I got basically the same.

  • @Kowlin There is a pull request (not authored by me) which fixes the problem. The Javascript problem is easy to fix. However, that in and of itself does not wholly fix the problem. The second part is that the Persona theme is laid out a bit different in HTML and the poll client javascript expects to insert the poll into a certain HTML element. Altering the poll code to work correctly for Persona means breaking all other themes. I have my own fixes for these issues but haven't pushed anything because of the theme compatibility problem.

    How I fixed the JS problem:

    index 5eb6a09..7b78147 100644
    --- a/public/js/poll/main.js
    +++ b/public/js/poll/main.js
    @@ -1,7 +1,7 @@
     (function() {
            window.Poll = {
                    load: function(data) {
    -                       Poll.sockets.emit.load(data.pollid, function(err, poll)
    +                       Poll.sockets.emit.load(data, function(err, poll) {
                                    if (!err) {
                                            Poll.view.init(poll, function(pollView)
                                                    if (parseInt(poll.info.deleted,
    diff --git a/templates/poll/notify.tpl b/templates/poll/notify.tpl
    index a4c5354..fc693c2 100644
    --- a/templates/poll/notify.tpl
    +++ b/templates/poll/notify.tpl
    @@ -1 +1 @@
    -<script>Poll.load({ pollid: {pollid} })</script>
    \ No newline at end of file

    And how I fixed the Persona theme problem:

    diff --git a/public/js/poll/view.js b/public/js/poll/view.js
    index 1d586ad..900f3e4 100644
    --- a/public/js/poll/view.js
    +++ b/public/js/poll/view.js
    @@ -63,7 +63,7 @@
                    insertPoll: function(poll, callback) {
                            View.parsePoll(poll, function(html) {
    -                               $('#post-container .post-row[data-index="0"] .po
    +                               $('.posts .clearfix[data-index="0"] .content').p

  • @phil said:

    •                           $('.posts .clearfix[data-index="0"] .content').p

    missing since what? p = poll ??

  • @Schamper This plugin would be very usefull in fact. I'm pretty sure that some people are moving from NodeBB to Discourse because of this problem. About me I spent some time installing nodeBB, which is fabulous, but the BIG problem is that I didn't find any working poll system on NodeBB until now, and I'm thinking about migrating to Discourse.. Sad, don't you think ?

  • lmao @Schamper being the reason why you are giving up on forum software.

    I think people need to understand that he has done those plugins as side projects that are open source. He has no reason to even update these other than his own motivation.
    Yes it would be nice for them to work on the latest version but if you are that desperate for a plug then use the nodebb version that the plugin supports.

    BitBangers is still running nodebb v0.6 as we rely heavily on the shoutbox which is only really compatible up to v0.6.

  • @Schamper The poll plugin is now working on my 0.8.2 NodeBB. Thank you very much for this awesome work !! 🙂 👍

Suggested Topics

| |