PluginProbe
Polylang / 3.8.6
Polylang v3.8.6
3.8.9 3.8.8 3.8.7 3.8.6 3.8.5 3.8.4 3.8.3 2.7 2.7.0.1 2.7.1 2.7.2 2.7.3 2.7.4 2.8 2.8.1 2.8.2 2.8.3 2.8.4 2.9 2.9.1 2.9.2 3.0 3.0.1 3.0.2 3.0.3 All 233 releases
polylang / src / modules / wizard / view-wizard-step-languages.php

view-wizard-step-languages.php in Polylang 3.8.6, at src/modules/wizard/view-wizard-step-languages.php

137 lines 4.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Displays the wizard languages step
4 *
5 * @package Polylang
6 *
7 * @since 2.7
8 *
9 * @var PLL_Model $model `PLL_Model` instance.
10 */
11
12 defined( 'ABSPATH' ) || exit;
13
14 $existing_languages = $model->languages->get_list();
15 $default_language = $model->languages->get_default();
16 $languages_list = array_diff_key(
17 PLL_Settings::get_predefined_languages(),
18 wp_list_pluck( $existing_languages, 'locale', 'locale' )
19 );
20 ?>
21 <div id="language-fields"></div>
22 <p class="languages-setup">
23 <?php esc_html_e( 'This wizard will help you configure your Polylang settings, and get you started quickly with your multilingual website.', 'polylang' ); ?>
24 </p>
25 <p class="languages-setup">
26 <?php esc_html_e( 'First we are going to define the languages that you will use on your website.', 'polylang' ); ?>
27 </p>
28 <h2><?php esc_html_e( 'Languages', 'polylang' ); ?></h2>
29 <div id="messages">
30 </div>
31 <div class="form-field">
32 <label for="lang_list"><?php esc_html_e( 'Select a language to be added', 'polylang' ); ?></label>
33 <div class="select-language-field">
34 <select name="lang_list" id="lang_list">
35 <option value=""></option>
36 <?php
37 foreach ( $languages_list as $language ) {
38 printf(
39 '<option value="%1$s" data-flag-html="%3$s" data-language-name="%2$s" >%2$s - %1$s</option>' . "\n",
40 esc_attr( $language['locale'] ),
41 esc_attr( $language['name'] ),
42 esc_attr( PLL_Language::get_predefined_flag( $language['flag'] ) )
43 );
44 }
45 ?>
46 </select>
47 <div class="action-buttons">
48 <button type="button"
49 class="button-primary button"
50 value="<?php esc_attr_e( 'Add new language', 'polylang' ); ?>"
51 id="add-language"
52 name="add-language"
53 >
54 <span class="dashicons dashicons-plus"></span><?php esc_html_e( 'Add new language', 'polylang' ); ?>
55 </button>
56 </div>
57 </div>
58 </div>
59 <table id="languages" class="striped">
60 <thead>
61 <tr>
62 <th><?php esc_html_e( 'Language', 'polylang' ); ?></th>
63 <th><?php esc_html_e( 'Remove', 'polylang' ); ?></th>
64 </tr>
65 </thead>
66 <tbody>
67 </tbody>
68 </table>
69 <table id="defined-languages" class="striped<?php echo empty( $existing_languages ) ? ' hide' : ''; ?>">
70 <?php if ( ! empty( $default_language ) ) : ?>
71 <caption><span class="icon-default-lang"></span> <?php esc_html_e( 'Default language', 'polylang' ); ?></caption>
72 <?php endif; ?>
73 <thead>
74 <tr>
75 <th><?php esc_html_e( 'Languages already defined', 'polylang' ); ?></th>
76 </tr>
77 </thead>
78 <tbody>
79 <?php
80 foreach ( $existing_languages as $lg ) {
81 printf(
82 '<tr><td>%3$s<span>%2$s - %1$s</span> %4$s</td></tr>' . "\n",
83 esc_attr( $lg->locale ),
84 esc_html( $lg->name ),
85 $lg->flag, // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
86 $lg->is_default ? ' <span class="icon-default-lang"><span class="screen-reader-text">' . esc_html__( 'Default language', 'polylang' ) . '</span></span>' : ''
87 );
88 }
89 ?>
90 </tbody>
91 </table>
92
93 <div id="dialog">
94 <p>
95 <?php
96 printf(
97 /* translators: %1$s: is a language flag image, %2$s: is a language native name */
98 esc_html__( 'You selected %1$s %2$s but you didn\'t add it to the list before continuing to the next step.', 'polylang' ),
99 '<span id="dialog-language-flag"></span>',
100 '<strong id="dialog-language"></strong>'
101 );
102 ?>
103 </p>
104 <p>
105 <?php esc_html_e( 'Do you want to add this language before continuing to the next step?', 'polylang' ); ?>
106 </p>
107 <ul>
108 <li>
109 <?php
110 printf(
111 /* translators: %s: is the translated label of the 'Yes' button */
112 esc_html__( '%s: add this language and continue to the next step', 'polylang' ),
113 '<strong>' . esc_html__( 'Yes', 'polylang' ) . '</strong >'
114 );
115 ?>
116 </li>
117 <li>
118 <?php
119 printf(
120 /* translators: %s: is the translated label of the 'No' button */
121 esc_html__( "%s: don't add this language and continue to the next step", 'polylang' ),
122 '<strong>' . esc_html__( 'No', 'polylang' ) . '</strong >'
123 );
124 ?>
125 </li>
126 <li>
127 <?php
128 printf(
129 /* translators: %s: is the translated label of the 'Ignore' button */
130 esc_html__( '%s: stay at this step', 'polylang' ),
131 '<strong>' . esc_html__( 'Ignore', 'polylang' ) . '</strong >'
132 );
133 ?>
134 </li>
135 </ul>
136 </div>
137