Translate Results In SP Polls And Make Stars Instead Of Radio Buttons - Question | JoomShaper
SP Page Builder 6 is Here! Learn More →

Translate Results In SP Polls And Make Stars Instead Of Radio Buttons

M

Meander

Extension 2 months ago

Hi,

I hope I'm posting this in the right category because I couldn't find a category for SP Polls.

However, I'm having trouble translating the Vote and Votes in the results.

I've already tried creating language overrides for the language strings COM_SPPOLLS_VOTE and COM_SPPOLLS_VOTES, but that doesn't work. I've also cleared the cache and all cookies.

Secondly, I'd like to have star images instead of radio buttons.

I've already created an override for the module, and I think I need to look for it in this section of the default .php file:

<div class="radio">
                <label>

                    <input type="radio" name="question" value="<?php echo $key; ?>" <?php echo !is_null($vote) && ($value->poll == $vote) ? 'checked': ($key==0 ? 'checked': ''); ?>>
                    <img src="/mysite.nl/images/example/ster.png" alt="Option 1" class="ratingstar">
                    <?php echo $value->poll; ?>
                </label>
                            </div>

I've managed to add an image (and set the radio input to hidden), but then you get (obviously) the same image for every vote, so I have to repeat it somewhere with the different options (Option 1 to 5), but I'm not very good at PHP.

Is there a way to simply get those 5 options, each with its own image?

Please see the image to see what I mean.

0
3 Answers
Atick Eashrak Shuvo
Atick Eashrak Shuvo
Accepted Answer
Support Agent 2 months ago #200664

Hello Meander,

Sorry for the inconvenience. Regarding the translation issue, unfortunately, those phrases are hardcoded and not directly translatable. To translate them, you would need to modify the code in the file JRoot/components/com_sppolls/layouts/results.php on line 23.

Concerning the star replacement, it isn't possible to use images directly. However, you can use star emojis. You can find some here: emojicombos.com/star.

Hope this helps!

Best regards

0
M
Meander
Accepted Answer
2 months ago #200666

Thank you.

Regarding the translation, I would have to upload that .php file again after every update because I can't override it, right?

0
Atick Eashrak Shuvo
Atick Eashrak Shuvo
Accepted Answer
Support Agent 2 months ago #200667

Yes

0