WordPress.org

Ready to get started?Download WordPress

Forums

Visual Form Builder
Visual Form Builder: localization problem (14 posts)

  1. HiFly
    Member
    Posted 2 years ago #

    Hi,
    First of all thanks for this fine and useful plugin. It was very simple to get in creating forms using it. I've created a test form in a few minutes! :). Nice!
    However I'm in stuck with plugin localization. It seems to be the plugin untranslatable using neither PoEdit, nor CodeStyle Localisation plugin (this one even cannot detect Visual Form Builder among my other plugins).
    As we need forms to be published in two languages (English and Lithuanian), translation of texts visable on front-end is essential.
    And...it is very urgent for us. Unless I solve the problem today/tommorow, I'll be constrained to change this perfect thing to any other localizable one.
    I would be glad and thankful getting an advise or some help.

  2. Matthew Muro
    Visual Form Builder Pro
    Plugin Author

    Posted 2 years ago #

    I'm aware of encoding and localization issues. The next version will try to solve the encoding issues, but localization will take a little more time.

    The next version is being planned for release next week.

  3. HiFly
    Member
    Posted 2 years ago #

    Thanks, Mmuro, for your answer. I'll be waiting lot for next version. Could I hope to be informed of a new release with localization support? (*pot or *po files are requisite). Good luck in optimization!

  4. Diane Bourque
    Member
    Posted 2 years ago #

    I'm also waiting for localization.

    I need to use the forms in French and I can't seem to be able to translate text like "Please enter a valid email address" or "This field is required." This is annoying...

    I'll subscribe to this topic hoping that you'll find time to address this.

    The form is available here:
    http://dianebourque.com/contact/

    Good luck MM!

  5. Matthew Muro
    Visual Form Builder Pro
    Plugin Author

    Posted 2 years ago #

    If you are looking to translate the messages on the front-end form, not the admin stuff, that's something you will have to do.

    Here is an example of how to change the default error messages for the jQuery Form Validation:

    In your theme folder, create a JavaScript file. In this example, I'm using myjs.js. Add the following code to it and customize the language to what you need:

    jQuery(document).ready(function($) {
    	$.extend($.validator.messages, {
    		required: "Eingabe nötig",
    		email: "Bitte eine gültige E-Mail-Adresse eingeben"
    	});
    });

    Now, in your functions.php file, add the following piece of code:
    wp_enqueue_script( 'my-visual-form-builder-validation', get_bloginfo( 'template_url' ) . '/myjs.js' , array( 'jquery', 'jquery-form-validation' ), '', true );

    If you wish to change more of the jQuery error messages, please refer to the API documentation or this topic on StackOverflow on how to change the default error messages.

  6. HiFly
    Member
    Posted 2 years ago #

    Hi, MMuro,
    First of all we certainly need front-end translations. The Admin panel could be left as it is (EN) for a while.
    Thanks for your advice. It's quite sophisticated to localize something for non-developers (which I am) :). And there is a question: if your suggested adjustment replaces English translation or it works as a switch for different languages? Our site is multilingual, so we will use different forms in different languages.
    The second point: how to get bilingual such things as "Submit" button, title "Verification", other visible texts, which are not error messages called by js, but simply embedded in your code. We are using qTranslate tool, but its shortcode [:lt]... [:en] doesn't work with your plugin unlike others.
    As I like your plug nevertheless, I've decided to make bilingual texts and button on the same form, but, you see, it's not the way to solve this problem. So I hope to get good news on release of a new update.

  7. Matthew Muro
    Visual Form Builder Pro
    Plugin Author

    Posted 2 years ago #

    HiFly, I do plan on making the other text translatable in a future version and have made that known several times. It's coming, I just ask for a little patience.

    The solution above is to fix Diane's problem with the jQuery form validation error messages. If you want to use the same solution, feel free. However, I'm not sure you how you would go about making it work with several languages on the same blog.

    You might be able to target the ID of the form and use the same code above. I haven't tested that.

  8. havemaskwilltravel
    Member
    Posted 2 years ago #

    Hi Mmuro, really like your formbuilder a lot. Have been able to customize some of the validation messages, but I can't seem to change the text in the captcha fieldset. How do I do that? When do you think a future version will support translation of text?

  9. Carlos Vázquez
    Member
    Posted 2 years ago #

    While the plugin is not updated by mmuro, and for whom the above code has not worked, either because of conflicts between jQuery and / or templates, here is a workaround:

    In this direction download the JQuery Validator: http://bassistance.de/jquery-plugins/jquery-plugin-validation/. Click on the link "download" and save the zip file on your pc. Open the file jquery.validate.js or jquery.validate.min.js in a text editor.

    Look for the text messages: required:" This field is required. At line 267 in the case of jquery.validate.js or line 20 in the case of jquery.validate.min.js (You can use any . The Jquery.validate.min.js is compressed and takes up less Kb)

    In the downloaded zip file are translations of 41 languages, in a directory called "localization".

    Open the file that corresponds to your language with a text editor and copy the text that is between the curly braces {} and replace the text with the English language in the Jquery.validate you have chosen above.

    Once done, upload to the server the modified file in your theme directory or wherever you want.

    Now we must choose between two options:

    1 - Modify the code in visual-form-builder.php. (This option has the advantage that the load is done via the plugin and the disadvantage that in an upcoming changes will be lost)

    Open the Visual-form-builder.php file and replace the url http://ajax.aspnetcdn.com/ajax/jquery.validate/1.9/jquery.validate.min.js on lines 321 and 331.

    Looks like this: wp_enqueue_script ('jquery-form-validation "," h t t p://www.yoursite.com/wp-content/themes/yourtheme/jquery.validate.min.js', array ('jquery'),'' , true);

    2 - Open your functions.php file in your theme where or create a new one. Copied to the last line before ?> The above code wp_enqueue_script ('jquery-form-validation "," h t t p://www.yoursite.com/wp-content/themes/yourtheme/jquery.validate.min.js' array ('jquery'),'', true); (This method reloads the script, but not affected by a new update)

    This is a temporary solution and we are limited to a single language, but is simple and useful as the plugin is not updated.

    Sorry for my English. I hope I have helped you. For me it works well: http://femcor.net/seguro-de-automoviles-solicitud/

  10. Matthew Muro
    Visual Form Builder Pro
    Plugin Author

    Posted 2 years ago #

    Carlos, editing the source should always be avoided. My solution above is what you need to be doing.

  11. Carlos Vázquez
    Member
    Posted 2 years ago #

    I know, and this is the solution 2, which does not touch the source. As I said earlier was temporary. It's a little frustrating that a great script can not be translated in a way easier.
    Yesterday I was reviewing how to do it with jQuery, even using several possibilities with the jQuery.noConflict (), but I not found the solution. I am using the framework presswork and no way to run the plugin you offer to change the language.

    When I add the plugin (jQuery(document).ready(function($)...), to submit validation is ignored. I have tried in many ways and with the template parent and child, and no way.

    I will continue investigating to try to apply it.

  12. BojanGl
    Member
    Posted 2 years ago #

    If you want to use language files you have at first place to rename folder "langauges" to "languages" and after that to add function to your functions.php

    function visual_form_builder_init() {
      load_plugin_textdomain( 'visual-form-builder', false , 'visual-form-builder/languages' );
    }
    add_action('init', 'visual_form_builder_init');

    After that you can use language files(visual-form-builder-de_DE.po) and update plugin without problems.

    Pozdrav

  13. manyakama
    Member
    Posted 2 years ago #

    Matthew!

    I managed to translate a plugin to hungraian, but downmost in the verification box in the transleted text the accentuated letter. How can I fix it?

    The second problem is also in the verification box: the title of the box is "Verification" and I don't find it in anywhere. In wich file can I find it and translate??

  14. ivank123
    Member
    Posted 2 years ago #

    Hi there.
    I've found the file visual-form-builder.pot so I decided to translate this plugin to spanish. But after generating and uploading .po and .mo files nothing changed. I also added the lines to functions.php suggested by BojanGl above, but nothing. Any idea of what should I do to make it work?

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic