Yop-polls and qtranslate quicktags
-
Hi,
I used qtranslate quicktags (eg. [:en]english text[:el]greek text ) but not all the translated stings appeared correctly as you can see in a picture that I made ( ) to give you a visual look, because I am doing all the tests on a localhost server.
Could you please tell me where to find the echo of these untranslated strings in your php code so as to see if __() or _e() functions are being used for text?
Thank you very much.
Best wishes
Panos
-
link to image https://i.imgur.com/I7C8AJ4.png
Hi Panos,
In inc/yop_poll_model.php, the poll’s creation starts with return_poll_html function. Starting with line 3060, the poll’s elements are being replaced.
The text is the ones you’ll find in the database – we don’t use __() or _e()
In addition, the functions below also help creating the poll:
answer_replace_callback
other_answer_replace_callback
answer_result_replace_callback
customfield_replace_callbackPlease let us know if you need more help.
Regards,
YOP Team
Hi YOP Team,
It took me more than I was expecting, mostly because I had to do some other things simultaneously, but I managed to find out what I had to change, so as if someone uses the QTranslate plugin and not WPML for translation, then he/she will be able to insert The qtranslate quicktags (eg. [:en]english text[:de]Deutsch text ).
You said that you do not use __(), but you use it for all your text messages. The problem for me was that I had to use different language text, not for the messages themselves, but for the input texts that you have in backend options of the plugin.
You can see my txt file
https://www.redheadillusion.com/testred/yop-poll-491-code-changes.txt
for the changes that I made to the code and if you want you can integrate them to your code, because it does not alter the behavior of your plugin, (at least I think so), but it gives someone the opportunity to use the quicktags of the so popular QTranslate wordpress plugin.Now I have to say that I faced a few problems running your plugin in my
localhost server, so I decided to setup a partial duplicate of my site online, so as to find out if these problems keep on bothering me. Some of them were gone but a few still bother me.You can visit this test site of mine that I have set up with real content and if you think that you must have login credentials to find out more for helping me to solve the problems that I face, please tell me where to send you this info.
The address of the test site is https://www.redheadillusion.com/testred
If you omit the word testred you will visit the actual site.In the test site you will see that I have set up both your plugin and the WP-Polls plugin. If you play a little with the WP-Polls plugin you will find out that its behavior according to the chosen language that is being displayed, is correct to all the actions that you decide to follow using it. (for example voting, seeing the results and return
back to vote again). With your plugin I couldn’t manage to achieve
such behavior.For simple polls WP-Polls plugin fits my needs, but I would like
to have polls that voters should put their answers as well and here comes your plugin which is the right and only I think solution for such a behavior.So my problems are, trying to list them starting with the most important:
1st. If I push the vote button or click on the view results link the
ajax script does not recognize the language of the site. It uses always the default english language. In WP-Polls plugin I solved it by
adding ?lang=’.qtrans_getLanguage() to the end of admin-ajax.php,
so as I had admin-ajax.php?lang=’.qtrans_getLanguage() and with
this I managed to pass the correct language to the ajax script.
In file yop_poll_model.php there are three occurrences of the word
admin=ajap.php which I converted them to
admin-ajax.php?lang=’.qtrans_getLanguage() but I couldn’t get
the result that I wanted to.2nd. I would like to have other answer as well, but to have the
opportunity to limit this to a number that I would decide, for example to 50. I do not want to have more than the number that I choose to have, because let’s say that 1000 voters want to have their opinion, you can easily imagine what would happen to the design of the site, not to mention if your plugin has the ability to manage such a large number of other answers.and 3rd. The plugin looks nice in sidebar but in archives page does not look the same till the time that you push the button Vote or you click the link View results, then everything become ok.
Thank you very much for your time that you spent on all us to help us to find solutions to our problems.
Best wishes
PanosHi YOP Team,
in case somehow you missed my post I bring it up again.
if you have the time please take a look.
Thank you very much.
Best wishes
PanosHi Panos,
1. Edit inc/public-admin.php and in return_yop_poll function, after every occurrence of admin-ajax.php add ?lang=’.qtrans_getLanguage() or
&lang=’.qtrans_getLanguage() if “?” is already in the url.2. We will take this suggestion into consideration and try to implement it in the future.
3. Please send us a link so we may take a look. There might be a conflict with the theme you use.
Regards,
YOP Team
Hi YOP Team,
Thank you very much for your support.
1. I had to change also the occurrences in the file inc/widget.php
2. This will be great.
3. https://www.redheadillusion.com/testred/yop-poll-archive
Best wishes
PanosHey Panos,
Do you use any plugins that affect the content of that page?
If you don’t, please edit the theme you use and in functions.php add
remove_filter( ‘the_content’, ‘wpautop’ );
remove_filter( ‘the_excerpt’, ‘wpautop’ );Regards,
YOP Team
Hi YOP Team,
Thank you very much for your time that you spend on all us to help us to solve our problems.
The result remains the same. I did what you suggested but the behavior is the same.
It is very weird because somehow the code has a break line after the input radio button which is vanished when we click on vote button or on view results link and the ajax code is being executed.
The same happens not only in page code but in post code as well. If I put the shortcode inside a post like I did in the following https://www.redheadillusion.com/testred/opposite-attraction-1941 the behavior is the same. You will find the poll at the end of the post.
Please, if you have time and will of course, tell me if you want to send you by email, login credentials to this test site of mine to have a look on your own. Your knowledge and experience is much more than mine and I think that you will understand more easily what is the culprit of such a behavior. At least I hope so.
Best regards
PanosHi Panos,
You can send us an email with login credentials to yop.help[at]gmail.com . Please make sure that account has permission to edit themes and plugins.
Regards,
YOP Team!Hi Yop Team,
Email has been sent directly from wordpress installation when I added the new user.
If you have any problem please let me know.
Thank you very much.
Best regards
PanosHi Yop Team,
I don’t know if you had the time to visit my test site.
All these days from my last reply I checked all my plugins one by one, in case one of them affects the content of the page in question ( as you told me ) but I found nothing about it.
Then I checked the poll template that I was using and I found out that if I change the code:
<li class="yop-poll-li-answer-%POLL-ID%"> %POLL-ANSWER-CHECK-INPUT% %POLL-ANSWER-LABEL% <span class="yop-poll-results-text-%POLL-ID%">%POLL-ANSWER-RESULT-LABEL%</span> %POLL-ANSWER-RESULT-BAR% </li>
to
<li class="yop-poll-li-answer-%POLL-ID%"> %POLL-ANSWER-CHECK-INPUT% %POLL-ANSWER-LABEL% <span class="yop-poll-results-text-%POLL-ID%">%POLL-ANSWER-RESULT-LABEL%</span> %POLL-ANSWER-RESULT-BAR% </li>
then everything is being displayed ok. (that means everything in one line)
Thank you very much for your wonderful plugin.
Best regards
Panos* I hope you do take into consideration to give us the choice, in a future release of your plugin, to limit the total “Other” answers a poll can accept.
- The topic ‘Yop-polls and qtranslate quicktags’ is closed to new replies.