$swiftling_language ) { $swiftling_host = swiftling_target_host( $swiftling_host_format, (string) $swiftling_slug, $swiftling_language['locale'], $swiftling_domains ); $swiftling_state = '' !== $swiftling_host && isset( $swiftling_checks[ $swiftling_host ]['state'] ) ? (string) $swiftling_checks[ $swiftling_host ]['state'] : ''; $swiftling_hosts[ $swiftling_host_format ][ $swiftling_slug ] = array( 'language' => $swiftling_language, 'host' => $swiftling_host, 'state' => $swiftling_state, ); $swiftling_ready[ $swiftling_host_format ] = $swiftling_ready[ $swiftling_host_format ] && 'ok' === $swiftling_state; } } $swiftling_states = array( 'ok' => array( 'published', __( 'Leads here', 'swiftling' ), '' ), 'no_answer' => array( 'failed', __( 'Does not answer', 'swiftling' ), __( 'Add it at your host, or where you bought the domain. A new one can take up to a day.', 'swiftling' ) ), 'no_https' => array( 'failed', __( 'No secure certificate', 'swiftling' ), __( 'Turn on a certificate for it at your host. Most hosts do it for free.', 'swiftling' ) ), 'other_site' => array( 'failed', __( 'Another site answers', 'swiftling' ), __( 'It shows another site, or sends visitors on to another address. Add it to this site at your host as an alias, not as a redirect.', 'swiftling' ) ), '' => array( 'untested', __( 'Not checked', 'swiftling' ), '' ), ); if ( ! isset( $swiftling_languages['targets'][ $swiftling_lang ] ) ) { $swiftling_lang = (string) key( $swiftling_languages['targets'] ); } $swiftling_target = '' !== $swiftling_lang ? $swiftling_languages['targets'][ $swiftling_lang ] : null; $swiftling_types = swiftling_content_types(); // The lists by the content they belong to, in the order of the content types; each with the object // keys of the parts of its word. $swiftling_groups = array(); $swiftling_owners = array(); foreach ( swiftling_base_lists() as $swiftling_key => $swiftling_list ) { $swiftling_list['owners'] = array(); foreach ( array_keys( $swiftling_list['parts'] ) as $swiftling_index ) { $swiftling_list['owners'][ $swiftling_index ] = swiftling_base_owner( $swiftling_key, $swiftling_index ); $swiftling_owners[] = $swiftling_list['owners'][ $swiftling_index ]; } $swiftling_groups[ $swiftling_list['group'] ][ $swiftling_key ] = $swiftling_list; } $swiftling_groups = array_replace( array_intersect_key( array_fill_keys( array_keys( $swiftling_types ), array() ), $swiftling_groups ), $swiftling_groups ); // How many words each language has translated, for its tab. $swiftling_done = array(); foreach ( $swiftling_languages['targets'] as $swiftling_slug => $swiftling_language ) { swiftling_prime_slugs( $swiftling_owners, $swiftling_language['locale'] ); $swiftling_done[ $swiftling_slug ] = count( array_filter( array_map( 'swiftling_get_slug', $swiftling_owners, array_fill( 0, count( $swiftling_owners ), $swiftling_language['locale'] ) ) ) ); } $swiftling_screen = admin_url( 'admin.php?page=swiftling-addresses' ); Ui::screenHeader( array( 'crumb' => __( 'Settings', 'swiftling' ), 'title' => __( 'URLs', 'swiftling' ), 'description' => __( 'How the addresses of your pages read in each language.', 'swiftling' ), ) ); ?> __( 'URLs saved.', 'swiftling' ) ) ); ?> __( 'Not saved yet: not every address leads to this site. The site keeps the addresses it has; below is what to do.', 'swiftling' ) ) ); ?> __( 'Every address leads to this site. Save changes to switch to them.', 'swiftling' ) ) ); ?> __( 'Checked. Not every address leads to this site yet; below is what to do.', 'swiftling' ) ) ); ?> __( 'Words saved. Addresses with the earlier words lead to the new ones.', 'swiftling' ) ) ); ?> __( 'Some words were not saved, because they are taken. They show below as you typed them.', 'swiftling' ) ) ); ?>