__( 'Translations', 'swiftling' ), 'title' => __( 'Forms', 'swiftling' ), 'description' => __( 'The texts of your forms: labels, choices, buttons and messages. A form is translated once and shows in every page it is on.', 'swiftling' ), ) ); if ( ! $swiftling_languages['targets'] ) { Ui::emptyState( __( 'Choose the languages first', 'swiftling' ), __( 'Content is translated into the languages you choose.', 'swiftling' ), array( __( 'Add languages', 'swiftling' ), admin_url( 'admin.php?page=swiftling-languages' ) ) ); return; } $swiftling_not_listed = add_query_arg( array( 'page' => 'swiftling-forms', 'help' => 'not-listed', ), admin_url( 'admin.php' ) ); // The forms of every form plugin on the site, by plugin, and their state in every language. $swiftling_forms = array(); $swiftling_plugins = 0; foreach ( $swiftling_providers as $swiftling_provider ) { $swiftling_found = $swiftling_provider->forms(); if ( ! $swiftling_found ) { continue; } ++$swiftling_plugins; foreach ( $swiftling_found as $swiftling_form ) { $swiftling_forms[] = array_merge( $swiftling_form, array( 'plugin' => $swiftling_provider->name() ) ); } } if ( ! $swiftling_forms ) { echo '
'; Ui::emptyState( __( 'No forms found on this site', 'swiftling' ), __( 'When you add a form with a form plugin, it appears here and you can translate its labels, buttons and messages.', 'swiftling' ) ); ?>

name() ); ?>

__( 'A form built into a page with the block editor, Divi or Elementor is not listed here. Its texts are part of that page, so you translate them in the page’s own editor.', 'swiftling' ), 'compact' => true, ) ); Ui::button( __( 'My form is not listed', 'swiftling' ), 'secondary', $swiftling_not_listed ); ?>
'; return; } $swiftling_legend = array( 'reviewed' => __( 'Reviewed', 'swiftling' ), 'machine' => __( 'Machine translated', 'swiftling' ), 'outdated' => __( 'Original changed since translation', 'swiftling' ), 'partial' => __( 'Partly translated: some texts are still empty', 'swiftling' ), 'missing' => __( 'Not translated', 'swiftling' ), ); $swiftling_states = swiftling_object_states( wp_list_pluck( $swiftling_forms, 'key' ) ); $swiftling_count = count( $swiftling_forms ); ?>