Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Takayuki Miyoshi

    (@takayukister)

    I don’t know about WPML. Maybe nothing has changed about the compatibility.

    Thread Starter Ov3rfly

    (@ov3rfly)

    WPML is a very common commercial translation plugin.

    From the release notes of CF7 you changed a function with multilingual forms. Please specify in detail what has been changed as “Maybe compatible” is not a answer I can work with here.

    As plugin developer you can get a free WPML licence and support.

    Hi,
    I’m wondering too how to create forms in different languages without the “Language selector”? Is there a new way to do this, after abandoning the old one. I use WPML too for multilanguage websites.

    Plugin Author Takayuki Miyoshi

    (@takayukister)

    Sorry, but I don’t comment on the compatibility with individual plugin, especially when it’s a commercial one that is not available on the plugin directory.

    This is all I can say.

    https://contactform7.com/2016/02/20/contact-form-7-44/

    The multilingual plugins can switch the locale setting of WordPress, and Contact Form 7 provides contact forms in the current locale.

    Thread Starter Ov3rfly

    (@ov3rfly)

    Too bad, WPML runs at over 400,000 sites and is the first choice for multilingual content since many years.

    Seems my customers have to stay at CF7 4.3.1 for now until some third party volunteer will figure out if/how CF7 4.4 works with current WPML…

    Hello,
    Thank you for the great plugin you’ve created.

    Since the last update in CF7 4.4 you remove the “Language selector” which is very important, no matter which multilanguage plugin it is used in multilanguage website.
    Imagine that you have a multilanguage website with 3 languages, for example in German, Spanish and Russian.
    How do you suggest to create forms for each one of the languages without the “Language selector”?

    Thread Starter Ov3rfly

    (@ov3rfly)

    Small update for interested readers:

    As some of our sites have various editors and we can not switch language of whole WordPress admin every time somebody adds a new form in some language, we are currently using a workaround for WPML.

    It replaces the “Add new” button with a list of buttons for each registered WPML language and passes the language as undocumented param locale="xx_XX" to CF7 form creation, screenshot.

    With this workaround the form success/error messages and locale settings are set up in correct language.

    Notes:

    1. WPML has to be configured to NOT translate CF7 posts (default).
    2. “Add new” item in side menu is NOT affected/replaced.
    3. If you edit/copy a form, it keeps the language of creation.
    4. Tested with WordPress 4.5.2, WPML 3.3.8, CF7 4.4.2
    5. Add code to functions.php of (child-)theme.

    // WPML with CF7, hack to create forms with correct locale param
    function wpml_cf7_admin_footer() {
    	$languages = apply_filters( 'wpml_active_languages', NULL, 'skip_missing=0' );
    	if ( !empty( $languages ) ) {
    		$languages = json_encode( $languages );
    ?>
    <script type="text/javascript">
    var wpml_cf7 = <?php echo $languages; ?>;
    var wpml_cf7_btn = jQuery('h1 a[href$="admin.php?page=wpcf7-new"]');
    var wpml_cf7_href = jQuery(wpml_cf7_btn).attr('href');
    var wpml_cf7_new = jQuery('<span/>');
    if (wpml_cf7_btn && wpml_cf7_href) {
    	jQuery.each(wpml_cf7, function(key, obj) {
    		if (wpml_cf7[key].default_locale) {
    			jQuery(wpml_cf7_new).append(
    				jQuery(wpml_cf7_btn).clone()
    				.attr('href', wpml_cf7_href + '&locale=' + wpml_cf7[key].default_locale)
    				.attr('title', wpml_cf7[key].translated_name)
    				.append(
    					jQuery('<img/>')
    					.attr('src', wpml_cf7[key].country_flag_url)
    					.css('margin-left', '4px')
    				)
    			);
    		}
    	});
    	jQuery(wpml_cf7_btn).replaceWith(wpml_cf7_new);
    }
    </script>
    <?php
    	}
    }
    add_action( 'admin_footer-toplevel_page_wpcf7', 'wpml_cf7_admin_footer' );

    Maybe it helps somebody, feedback welcome…

    eaglejohn

    (@danielbenjamins)

    When will the language selector be available again?

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Language Selector Retired in 4.4, compatibility with WPML?’ is closed to new replies.