__( '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' ), ); Ui::screenHeader( array( 'crumb' => __( 'Translations', 'swiftling' ), 'title' => __( 'Templates', 'swiftling' ), 'description' => $swiftling_block ? __( 'What every page shows around its content: the header, the footer, the menu, the site title and the texts of each template, such as the heading of search results. The header, footer and menu are the same in every template, so they are translated once.', 'swiftling' ) : __( 'What every kind of page shows around its content: the header, the footer, the menu, the site title and texts of the theme, such as the heading of search results. The header, footer and menu are the same everywhere, so they are translated once.', '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_views = swiftling_can_list( 'edit_theme_options' ) ? swiftling_site_views() : array(); // The header and the footer, each a row of its own, translated once for every page. $swiftling_parts = $swiftling_views ? swiftling_site_parts() : array(); $swiftling_part_example = swiftling_site_part_example(); // Texts builders keep outside posts, such as ACF's options pages, each a subject of the editor; // only those the user may translate. $swiftling_builders = array(); foreach ( \SwiftLing\Builders\Registry::subjects() as $swiftling_builder => $swiftling_groups ) { foreach ( $swiftling_groups as $swiftling_group ) { $swiftling_group['subjects'] = array_values( array_filter( $swiftling_group['subjects'], static function ( $entry ): bool { $subject = swiftling_subject( $entry['key'] ); return $subject && swiftling_can_translate_subject( $subject ); } ) ); if ( $swiftling_group['subjects'] ) { $swiftling_builders[ $swiftling_builder ][] = $swiftling_group; } } } $swiftling_keys = array_merge( array_map( static function ( $part ): string { return 'site:' . $part; }, array_keys( $swiftling_parts ) ), wp_list_pluck( $swiftling_views, 'key' ) ); foreach ( $swiftling_builders as $swiftling_groups ) { foreach ( $swiftling_groups as $swiftling_group ) { $swiftling_keys = array_merge( $swiftling_keys, wp_list_pluck( $swiftling_group['subjects'], 'key' ) ); } } $swiftling_states = swiftling_object_states( $swiftling_keys ); $swiftling_columns = 4 + count( $swiftling_languages['targets'] ); ?>

$swiftling_part_name ) : ?>




1 ) : ?>
$swiftling_groups ) : ?>