• Resolved Mariavd

    (@mariavd)


    Hi,

    I would like to make a survey using your Awesome-Surveys plugin. It’s working great and I like your tutorial!

    However, the survey I’m making has to be in Dutch. So I’m trying to alter all the texts. I managed to change the “Submit response” button in the php code. Unfortunately I’m unable to locate the code for the error message(s?) “This field is required”. Could you tell me where I can change this text?

    Thanks in advance!

    Maria

    https://www.ads-software.com/plugins/awesome-surveys/

Viewing 12 replies - 1 through 12 (of 12 total)
  • Plugin Author Will Brubaker

    (@willthewebmechanic)

    Automattic Happiness Engineer

    Howdy Mariavd,

    Thanks for using the Awesome Surveys plugin and thanks for your feedback. I really appreciate it!

    All of the text strings that are generated by the PHP files are translatable – meaning that those text strings can be modified without modifying the PHP files themselves. I would be happy to try and find some documentation if you’re interested. You can find the translation file in wp-content/plugins/awesome-surveys/languages – the file name is awesome-surveys.pot – if you provide translations, I would be happy to include those translations in future updates.

    The ‘This field is required’ message that you are asking about is generated by the jquery validation plugin. I haven’t included any of the localization files for that within Awesome Surveys – but the file you need can be found here: Validation message file

    I would be happy to provide you with a code snippet to properly include that file if you’re comfortable inserting code snippets in your theme’s functions.php file.

    Thread Starter Mariavd

    (@mariavd)

    Howdy Will,

    Thank you for answering my question about the translation of you plugin.
    I’m not familiar with including code snippets in the functions.php but I googled and found another plugin written by Thomas Griffin. This plugin would make it possible to place the code snippet in the plugin instead of in the fuctions.php.
    https://thomasgriffinmedia.com/custom-snippets-plugin/
    I can try this first, if you can provide me with the code snippet?

    I also had a look at the awesome-surveys.pot and translated a few pages in wordpad.
    If this is what you need, I can continue translating it for you.

    Thanks,

    mariavd

    Plugin Author Will Brubaker

    (@willthewebmechanic)

    Automattic Happiness Engineer

    Hey there,

    Sorry I didn’t get back to you sooner. I just wanted to check in and let you know that I haven’t forgotten about you and will be providing a code snippet just as soon as I can get to it.

    Cheers,
    Will

    Thread Starter Mariavd

    (@mariavd)

    Hey Will,

    Thank you for your message. No problem!
    mariavd

    Plugin Author Will Brubaker

    (@willthewebmechanic)

    Automattic Happiness Engineer

    So…this is a bit more complicated than I initially thought and I’m sure I can do a better job of implementing this on a larger scale, but until then here’s a bit of a workaround:

    1. Grab this JavaScript file messages_nl.js
    2. place that file in the same directory as the plugin you mentioned before. That will be wp-content/plugins/cwwp-custom-snippets/
    3. Here is an edited version of the custom snippets plugin. The code that I have placed between the custom code blocks is what you need to load the JavaScript that will then output the messages in Dutch.

    I realize this may not be clear, so if you have questions don’t hesitate to ask and I’ll do my best to help.

    Thread Starter Mariavd

    (@mariavd)

    Hey Will,

    Thank you for your work!
    I installed the plugin ‘Code With WP Custom Snippet’ first.

    Then I placed the file ‘messages_nl.js’ in the map ‘wp-content/plugins/cwwm-custom-snippets’

    Finally I copied the code between the custom code blocks from the edited version and pasted it in the plugin on my website.

    Unfortunately I still have the message ‘this field is required’ in English. Perhaps I missed something?

    Thank you!

    Mariavd

    Plugin Author Will Brubaker

    (@willthewebmechanic)

    Automattic Happiness Engineer

    is the ‘Code With WP Custom Snippet’ plugin activated?

    Thread Starter Mariavd

    (@mariavd)

    Hey Will,

    Yes, the plugin was activated. I just tried again, deactivate and activate.
    Unfortunately I still have the message ‘this field is required’ in English.

    Mariavd

    Plugin Author Will Brubaker

    (@willthewebmechanic)

    Automattic Happiness Engineer

    Mariavd,

    Thank you so much for your patience and understanding while we work through this. The steps that you described should have worked ??

    Like I said, I really need to find a different/better way to display the messages and I am starting work on that right now.

    In the meantime, can you provide me with a link to your site where your survey is and I’ll take a look and try to figure out why this workaround is not working there?

    Thread Starter Mariavd

    (@mariavd)

    Hey Will,

    Don’t worry , I thank you for your patience with me too.
    I’m still working under localhost, because I am new to wordpress.
    I made a little site with a survey for a friend’s schoolproject.
    It should be online next week, I hope, we don’t have a domainname yet.
    If you do want to take a look at it, I can zip it and send it by mail?
    Don’t worry about it too much. It would be nice if it is in Dutch, but if not, people will understand for a schoolproject.
    Do you still need a translation for the .pot file? Since you already have an excellent translation for the jsquery!

    Mariavd

    Plugin Author Will Brubaker

    (@willthewebmechanic)

    Automattic Happiness Engineer

    Yes, if you can provide me with your translated .pot file that would be great – the front page of my website has a contact form – contact me there and we’ll work that out!

    I just updated Awesome Surveys to version 1.3. If you have your language set in wp-config.php version 1.3 will automatically add the appropriate jQuery validation messages file. As an example if, in your wp-config.php there is a line that says define( 'WPLANG', 'nl_NL' ); then the Dutch validation messages should be loaded.

    edit: edited for syntax

    Thread Starter Mariavd

    (@mariavd)

    Hey Will!

    Awesome! It works! I only had to change the button ‘submit response’ into ‘verzenden’ in the class.awesomesurveys-frondend.php.

    I will contact you tomorrow on your website for the translation of the .pot file!

    Thank you so much!

    Mariavd

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘changing pre-set language’ is closed to new replies.