PluginProbe
Bogo / 2.4
Bogo v2.4
3.9.3 trunk 1.0 1.1 2.0 2.0.1 2.1 2.1.1 2.1.2 2.1.3 2.2 2.3 2.4 2.4.1 2.4.2 2.4.3 2.5 2.6 2.6.1 2.7 2.8 2.8.1 2.9 3.0 3.0.1 All 52 releases
← All changes | admin/admin.php +100 -439 trunk2.4 View file →
@@ -3,513 +3,174 @@
3 3 require_once BOGO_PLUGIN_DIR . '/admin/includes/user.php';
4 4 require_once BOGO_PLUGIN_DIR . '/admin/includes/post.php';
5 5 require_once BOGO_PLUGIN_DIR . '/admin/includes/nav-menu.php';
6 6 require_once BOGO_PLUGIN_DIR . '/admin/includes/widgets.php';
7 -require_once BOGO_PLUGIN_DIR . '/admin/includes/language-packs.php';
8 -require_once BOGO_PLUGIN_DIR . '/admin/includes/terms-translation.php';
9 7
10 -add_action( 'admin_init', 'bogo_upgrade', 10, 0 );
8 +add_action( 'admin_enqueue_scripts', 'bogo_admin_enqueue_scripts' );
11 9
12 -function bogo_upgrade() {
13 - $old_ver = bogo_get_prop( 'version' );
14 - $new_ver = BOGO_VERSION;
15 -
16 - if ( $old_ver !== $new_ver ) {
17 - require_once BOGO_PLUGIN_DIR . '/admin/includes/upgrade.php';
18 - do_action( 'bogo_upgrade', $new_ver, $old_ver );
19 - bogo_set_prop( 'version', $new_ver );
20 - }
21 -}
22 -
23 -add_action( 'admin_enqueue_scripts', 'bogo_admin_enqueue_scripts', 10, 1 );
24 -
25 10 function bogo_admin_enqueue_scripts( $hook_suffix ) {
26 - wp_enqueue_style( 'bogo-admin',
27 - plugins_url( 'admin/includes/css/admin.css', BOGO_PLUGIN_BASENAME ),
28 - array(), BOGO_VERSION, 'all'
29 - );
11 + if ( false !== strpos( $hook_suffix, 'bogo-tools' )
12 + || 'widgets.php' == $hook_suffix
13 + || 'user-edit.php' == $hook_suffix ) {
14 + wp_enqueue_style( 'bogo-admin',
15 + plugins_url( 'admin/includes/css/admin.css', BOGO_PLUGIN_BASENAME ),
16 + array(), BOGO_VERSION, 'all' );
30 17
31 - if ( is_rtl() ) {
32 - wp_enqueue_style( 'bogo-admin-rtl',
33 - plugins_url( 'admin/includes/css/admin-rtl.css', BOGO_PLUGIN_BASENAME ),
34 - array(), BOGO_VERSION, 'all'
35 - );
18 + return;
36 19 }
37 20
38 - $assets = include BOGO_PLUGIN_DIR . '/admin/includes/js/index.asset.php';
21 + if ( 'nav-menus.php' == $hook_suffix ) {
22 + $nav_menu_id = absint( get_user_option( 'nav_menu_recently_edited' ) );
23 + $nav_menu_items = wp_get_nav_menu_items( $nav_menu_id );
24 + $locales = array();
39 25
40 - wp_enqueue_script( 'bogo-admin',
41 - plugins_url( 'admin/includes/js/index.js', BOGO_PLUGIN_BASENAME ),
42 - $assets['dependencies'],
43 - $assets['version'],
44 - array( 'in_footer' => true )
45 - );
46 -
47 - wp_set_script_translations( 'bogo-admin', 'bogo' );
48 -
49 - $available_languages = array();
50 -
51 - foreach ( bogo_available_languages() as $locale => $language ) {
52 - $native_name = bogo_get_language_native_name( $locale );
53 -
54 - if ( bogo_locale_is_alone( $locale ) ) {
55 - $native_name = bogo_get_short_name( $native_name );
26 + foreach ( (array) $nav_menu_items as $item ) {
27 + $locales[$item->db_id] = $item->bogo_locales;
56 28 }
57 29
58 - $tags = array(
59 - bogo_language_tag( $locale ),
60 - bogo_lang_slug( $locale ),
61 - );
30 + $prefix = 'menu-item-bogo-locale';
62 31
63 - $available_languages[$locale] = array(
64 - 'name' => $language,
65 - 'nativename' => trim( $native_name ),
66 - 'country' => bogo_get_country_code( $locale ),
67 - 'tags' => array_unique( array_filter( $tags ) ),
68 - );
69 - }
32 + wp_enqueue_script( 'bogo-admin',
33 + plugins_url( 'admin/includes/js/admin.js', BOGO_PLUGIN_BASENAME ),
34 + array( 'jquery' ),
35 + BOGO_VERSION, true );
70 36
71 - $bogo_obj = array(
72 - 'availableLanguages' => $available_languages,
73 - 'defaultLocale' => bogo_get_default_locale(),
74 - 'currentPost' => array(),
75 - 'localizablePostTypes' => bogo_localizable_post_types(),
76 - 'showFlags' => apply_filters( 'bogo_use_flags', true ),
77 - );
37 + wp_localize_script( 'bogo-admin', '_bogo', array(
38 + 'availableLanguages' => bogo_available_languages( 'orderby=value' ),
39 + 'locales' => $locales,
40 + 'selectorLegend' => __( 'Displayed on pages in', 'bogo' ),
41 + 'cbPrefix' => $prefix ) );
78 42
79 - if ( in_array( $hook_suffix, array( 'post.php', 'post-new.php' ) ) ) {
80 - if ( $screen = get_current_screen() and $screen->is_block_editor() ) {
81 - wp_enqueue_script( 'bogo-block-editor' );
82 - }
43 + wp_enqueue_style( 'bogo-admin',
44 + plugins_url( 'admin/includes/css/admin.css', BOGO_PLUGIN_BASENAME ),
45 + array(), BOGO_VERSION, 'all' );
83 46
84 - $user_locale = bogo_get_user_locale();
85 -
86 - $current_post = array(
87 - 'locale' => $user_locale,
88 - 'lang' => bogo_lang_slug( $user_locale ),
89 - 'translations' => array(),
90 - );
91 -
92 - if ( $post = get_post() ) {
93 - $current_post['postId'] = $post->ID;
94 - $post_type_object = get_post_type_object( $post->post_type );
95 - $edit_post_cap = $post_type_object->cap->edit_post;
96 -
97 - if ( $locale = get_post_meta( $post->ID, '_locale', true ) ) {
98 - $current_post['locale'] = $locale;
99 - $current_post['lang'] = bogo_lang_slug( $locale );
100 - }
101 -
102 - $available_locales = bogo_available_locales( array(
103 - 'exclude' => array( $current_post['locale'] ),
104 - ) );
105 -
106 - foreach ( $available_locales as $locale ) {
107 - $current_post['translations'][$locale] = array();
108 -
109 - $translation = bogo_get_post_translation( $post->ID, $locale );
110 -
111 - if ( $translation ) {
112 - $current_post['translations'][$locale] = array(
113 - 'postId' => $translation->ID,
114 - 'postTitle' => $translation->post_title,
115 - 'editLink' => current_user_can( $edit_post_cap, $translation->ID )
116 - ? get_edit_post_link( $translation, 'raw' )
117 - : '',
118 - );
119 - }
120 - }
121 - }
122 -
123 - $bogo_obj['currentPost'] = $current_post;
47 + return;
124 48 }
125 -
126 - wp_add_inline_script( 'bogo-admin',
127 - sprintf(
128 - 'var bogo = %s;',
129 - wp_json_encode( $bogo_obj, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE )
130 - ),
131 - 'before'
132 - );
133 49 }
134 50
135 -add_action( 'admin_menu', 'bogo_admin_menu', 10, 0 );
51 +add_action( 'admin_menu', 'bogo_admin_menu' );
136 52
137 53 function bogo_admin_menu() {
138 - add_menu_page(
139 - __( 'Languages', 'bogo' ),
140 - __( 'Languages', 'bogo' ),
141 - 'bogo_manage_language_packs',
142 - 'bogo',
143 - 'bogo_tools_page',
144 - 'dashicons-translation',
145 - 73 // between Users (70) and Tools (75)
146 - );
54 + $tools = add_management_page(
55 + __( 'Bogo Tools', 'bogo' ), __( 'Bogo', 'bogo' ),
56 + 'update_core', 'bogo-tools', 'bogo_tools_page' );
147 57
148 - $tools = add_submenu_page(
149 - 'bogo',
150 - __( 'Language Packs', 'bogo' ),
151 - __( 'Language Packs', 'bogo' ),
152 - 'bogo_manage_language_packs',
153 - 'bogo',
154 - 'bogo_tools_page'
155 - );
156 -
157 - add_action( 'load-' . $tools, 'bogo_load_tools_page', 10, 0 );
158 -
159 - $available_locales = bogo_available_locales( array(
160 - 'current_user_can_access' => true,
161 - 'exclude' => array( bogo_get_default_locale() ),
162 - ) );
163 -
164 - if ( 0 < count( $available_locales ) ) {
165 - $texts = add_submenu_page(
166 - 'bogo',
167 - __( 'Terms Translation', 'bogo' ),
168 - __( 'Terms Translation', 'bogo' ),
169 - 'bogo_edit_terms_translation',
170 - 'bogo-texts',
171 - 'bogo_texts_page'
172 - );
173 -
174 - add_action( 'load-' . $texts, 'bogo_load_texts_page', 10, 0 );
175 - }
58 + add_action( 'load-' . $tools, 'bogo_load_tools_page' );
176 59 }
177 60
178 -add_filter(
179 - 'set_screen_option_bogo_texts_per_page',
180 - 'bogo_set_screen_options',
181 - 10, 3
182 -);
183 -
184 -function bogo_set_screen_options( $result, $option, $value ) {
185 - $bogo_screens = array(
186 - 'bogo_texts_per_page',
187 - );
188 -
189 - if ( in_array( $option, $bogo_screens ) ) {
190 - $result = $value;
191 - }
192 -
193 - return $result;
194 -}
195 -
196 61 function bogo_load_tools_page() {
197 62 require_once( ABSPATH . 'wp-admin/includes/translation-install.php' );
198 63
199 - $action = $_GET['action'] ?? '';
200 - $locale = $_GET['locale'] ?? null;
64 + $action = isset( $_GET['action'] ) ? $_GET['action'] : '';
201 65
202 - if ( 'activate' === $action ) {
66 + if ( 'install_translation' == $action ) {
203 67 check_admin_referer( 'bogo-tools' );
204 68
205 - if ( ! current_user_can( 'bogo_manage_language_packs' ) ) {
206 - wp_die( wp_kses_data( __( 'You are not allowed to manage translations.', 'bogo' ) ) );
69 + if ( ! current_user_can( 'update_core' ) ) {
70 + wp_die( __( 'You are not allowed to install translations.', 'bogo' ) );
207 71 }
208 72
209 - if ( 'en_US' === $locale ) {
210 - bogo_set_prop( 'enus_deactivated', false );
73 + $locale = isset( $_GET['locale'] ) ? $_GET['locale'] : null;
211 74
75 + if ( wp_download_language_pack( $locale ) ) {
212 76 $redirect_to = add_query_arg(
213 - array( 'message' => 'enus_activated' ),
214 - menu_page_url( 'bogo', false )
215 - );
77 + array( 'locale' => $locale, 'message' => 'success' ),
78 + menu_page_url( 'bogo-tools', false ) );
216 79 } else {
217 - if ( wp_download_language_pack( $locale ) ) {
218 - $redirect_to = add_query_arg(
219 - array( 'locale' => $locale, 'message' => 'install_success' ),
220 - menu_page_url( 'bogo', false )
221 - );
222 - } else {
223 - $redirect_to = add_query_arg(
224 - array( 'locale' => $locale, 'message' => 'install_failed' ),
225 - menu_page_url( 'bogo', false )
226 - );
227 - }
228 - }
229 -
230 - wp_safe_redirect( $redirect_to );
231 - exit();
232 - }
233 -
234 - if ( 'deactivate' === $action ) {
235 - check_admin_referer( 'bogo-tools' );
236 -
237 - if ( ! current_user_can( 'bogo_manage_language_packs' ) ) {
238 - wp_die( wp_kses_data( __( 'You are not allowed to manage translations.', 'bogo' ) ) );
239 - }
240 -
241 - if ( 'en_US' === $locale ) {
242 - bogo_set_prop( 'enus_deactivated', true );
243 -
244 80 $redirect_to = add_query_arg(
245 - array( 'message' => 'enus_deactivated' ),
246 - menu_page_url( 'bogo', false )
247 - );
248 - } else {
249 - if ( bogo_delete_language_pack( $locale ) ) {
250 - $redirect_to = add_query_arg(
251 - array( 'locale' => $locale, 'message' => 'delete_success' ),
252 - menu_page_url( 'bogo', false )
253 - );
254 - } else {
255 - $redirect_to = add_query_arg(
256 - array( 'locale' => $locale, 'message' => 'delete_failed' ),
257 - menu_page_url( 'bogo', false )
258 - );
259 - }
81 + array( 'locale' => $locale, 'message' => 'failed' ),
82 + menu_page_url( 'bogo-tools', false ) );
260 83 }
261 84
262 85 wp_safe_redirect( $redirect_to );
263 86 exit();
264 87 }
88 +}
265 89
266 - if ( 'promote' === $action ) {
267 - check_admin_referer( 'bogo-tools' );
90 +function bogo_tools_page() {
91 + $message = "";
268 92
269 - if ( ! current_user_can( 'bogo_manage_language_packs' ) ) {
270 - wp_die( wp_kses_data( __( 'You are not allowed to manage translations.', 'bogo' ) ) );
93 + if ( isset( $_GET['message'] ) ) {
94 + if ( 'success' == $_GET['message'] ) {
95 + $message = __( "Translation installed successfully.", 'bogo' );
96 + } elseif ( 'failed' == $_GET['message'] ) {
97 + $message = __( "Translation install failed.", 'bogo' );
271 98 }
272 -
273 - if ( 'en_US' === $locale or ! bogo_is_available_locale( $locale ) ) {
274 - $locale = '';
275 - }
276 -
277 - if ( update_option( 'WPLANG', $locale ) ) {
278 - $redirect_to = add_query_arg(
279 - array( 'locale' => $locale, 'message' => 'promote_success' ),
280 - menu_page_url( 'bogo', false )
281 - );
282 - } else {
283 - $redirect_to = add_query_arg(
284 - array( 'locale' => $locale, 'message' => 'promote_failed' ),
285 - menu_page_url( 'bogo', false )
286 - );
287 - }
288 -
289 - wp_safe_redirect( $redirect_to );
290 - exit();
291 99 }
292 100
293 - if ( 'translate' === $action ) {
294 - check_admin_referer( 'bogo-tools' );
101 +?>
102 +<div class="wrap">
295 103
296 - if ( ! current_user_can( 'bogo_edit_terms_translation', $locale ) ) {
297 - wp_die( wp_kses_data( __( 'You are not allowed to edit translations.', 'bogo' ) ) );
298 - }
104 +<h2><?php echo esc_html( __( 'Bogo Tools', 'bogo' ) ); ?></h2>
299 105
300 - $is_active = ( 'en_US' === $locale )
301 - ? ! bogo_is_enus_deactivated()
302 - : bogo_is_available_locale( $locale );
106 +<?php if ( ! empty( $message ) ) : ?>
107 +<div id="message" class="updated"><p><?php echo esc_html( $message ); ?></p></div>
108 +<?php endif; ?>
303 109
304 - if ( ! bogo_is_default_locale( $locale ) and $is_active ) {
305 - $redirect_to = add_query_arg(
306 - array( 'locale' => $locale ),
307 - menu_page_url( 'bogo-texts', false ) );
110 +<?php
111 + bogo_toolbox_installed_translations();
112 + bogo_toolbox_add_translations();
113 +?>
308 114
309 - wp_safe_redirect( $redirect_to );
310 - exit();
311 - }
312 - }
313 -
314 - $current_screen = get_current_screen();
315 -
316 - add_filter( 'manage_' . $current_screen->id . '_columns',
317 - array( 'Bogo_Language_Packs_List_Table', 'define_columns' ),
318 - 10, 1
319 - );
115 +</div>
116 +<?php
320 117 }
321 118
322 -function bogo_tools_page() {
323 - $list_table = new Bogo_Language_Packs_List_Table();
324 - $list_table->prepare_items();
119 +function bogo_toolbox_installed_translations() {
120 + $title = __( 'Available Languages', 'bogo' );
325 121
122 + $default_locale = bogo_get_default_locale();
123 + $languages = array( $default_locale => bogo_get_language( $default_locale ) )
124 + + bogo_available_languages();
326 125 ?>
327 -<div class="wrap">
328 -
329 -<h1 class="wp-heading-inline"><?php
330 - echo esc_html( __( 'Language Packs', 'bogo' ) );
331 -?></h1>
332 -
126 +<div class="tool-box">
127 +<h3 class="title"><?php echo esc_html( $title ); ?></h3>
128 +<ul id="translations">
333 129 <?php
334 - if ( ! empty( $_REQUEST['s'] ) ) {
335 - echo sprintf(
336 - '<span class="subtitle">%s</span>',
337 - wp_kses_data( sprintf(
338 - /* translators: %s: search query */
339 - __( 'Search results for: <strong>%s</strong>', 'bogo' ),
340 - esc_html( $_REQUEST['s'] )
341 - ) )
342 - );
130 + foreach ( $languages as $locale => $language ) {
131 + echo sprintf( '<li>%s</li>', esc_html( $language ) );
343 132 }
344 133 ?>
345 -
346 -<hr class="wp-header-end">
347 -
348 -<?php bogo_admin_notice(); ?>
349 -
350 -<?php $list_table->views(); ?>
351 -
352 -<form method="get" action="" id="bogo-language-packs">
353 - <input type="hidden" name="page" value="<?php echo esc_attr( $_REQUEST['page'] ); ?>" />
354 - <?php $list_table->search_box( __( 'Search Language', 'bogo' ), 'bogo-language-packs' ); ?>
355 - <?php $list_table->display(); ?>
356 -</form>
357 -
134 +</ul>
358 135 </div>
359 136 <?php
360 137 }
361 138
362 -function bogo_load_texts_page() {
363 - $action = $_POST['action'] ?? '';
139 +function bogo_toolbox_add_translations() {
140 + if ( ! wp_can_install_language_pack() ) {
141 + return;
142 + }
364 143
365 - if ( 'save' === $action ) {
366 - check_admin_referer( 'bogo-edit-text-translation' );
144 + $title = __( 'Add Languages', 'bogo' );
367 145
368 - if ( ! current_user_can( 'bogo_edit_terms_translation' ) ) {
369 - wp_die( wp_kses_data( __( 'You are not allowed to edit translations.', 'bogo' ) ) );
370 - }
146 + $available_translations = wp_get_available_translations();
147 + $languages = array_diff( bogo_languages(), bogo_available_languages() );
371 148
372 - $locale = $_POST['locale'] ?? null;
149 +?>
150 +<div class="tool-box">
151 +<h3 class="title"><?php echo esc_html( $title ); ?></h3>
152 +<ul id="translations">
153 +<?php
154 + foreach ( $languages as $locale => $language ) {
155 + if ( isset( $available_translations[$locale] ) ) {
156 + $install_link = menu_page_url( 'bogo-tools', false );
157 + $install_link = add_query_arg(
158 + array( 'action' => 'install_translation', 'locale' => $locale ),
159 + $install_link );
160 + $install_link = wp_nonce_url( $install_link, 'bogo-tools' );
161 + $install_link = sprintf( '<a href="%1$s" class="install">%2$s</a>',
162 + $install_link, __( 'Install', 'bogo' ) );
373 163
374 - if ( ! bogo_is_available_locale( $locale ) ) {
375 - return;
376 - }
377 -
378 - if ( ! current_user_can( 'bogo_access_locale', $locale ) ) {
379 - wp_die( wp_kses_data( __( 'You are not allowed to edit terms in this locale.', 'bogo' ) ) );
380 - }
381 -
382 - $entries = array();
383 -
384 - foreach ( (array) bogo_terms_translation( $locale ) as $item ) {
385 - $translation = $item['translated'];
386 -
387 - $cap = $item['cap'] ?? 'bogo_edit_terms_translation';
388 -
389 - if ( isset( $_POST[$item['name']] ) and current_user_can( $cap ) ) {
390 - $translation = $_POST[$item['name']];
391 - }
392 -
393 - $entries[] = array(
394 - 'singular' => $item['name'],
395 - 'translations' => array( $translation ),
396 - 'context' => preg_replace( '/:.*$/', '', $item['name'] ),
397 - );
398 - }
399 -
400 - if ( Bogo_POMO::export( $locale, $entries ) ) {
401 - $message = 'translation_saved';
164 + echo sprintf( '<li>%1$s %2$s</li>',
165 + esc_html( $language ), $install_link );
402 166 } else {
403 - $message = 'translation_failed';
167 + echo sprintf( '<li>%s</li>', esc_html( $language ) );
404 168 }
405 -
406 - $redirect_to = add_query_arg(
407 - array(
408 - 'locale' => $locale,
409 - 'message' => $message,
410 - 'paged' => absint( $_POST['paged'] ?? 1 ),
411 - ),
412 - menu_page_url( 'bogo-texts', false )
413 - );
414 -
415 - wp_safe_redirect( $redirect_to );
416 - exit();
417 -
418 - } else {
419 - $current_screen = get_current_screen();
420 -
421 - add_filter( 'manage_' . $current_screen->id . '_columns',
422 - array( 'Bogo_Terms_Translation_List_Table', 'define_columns' ),
423 - 10, 1
424 - );
425 -
426 - add_screen_option( 'per_page', array(
427 - 'default' => 20,
428 - 'option' => 'bogo_texts_per_page',
429 - ) );
430 169 }
431 -}
432 -
433 -function bogo_texts_page() {
434 - $list_table = new Bogo_Terms_Translation_List_Table();
435 - $list_table->prepare_items();
436 -
437 170 ?>
438 -<div class="wrap">
439 -
440 -<h1 class="wp-heading-inline"><?php
441 - echo esc_html( __( 'Terms Translation', 'bogo' ) );
442 -?></h1>
443 -
444 -<?php
445 - if ( ! empty( $_REQUEST['s'] ) ) {
446 - echo sprintf(
447 - '<span class="subtitle">%s</span>',
448 - wp_kses_data( sprintf(
449 - /* translators: %s: search query */
450 - __( 'Search results for: <strong>%s</strong>', 'bogo' ),
451 - esc_html( $_REQUEST['s'] )
452 - ) )
453 - );
454 - }
455 -?>
456 -
457 -<hr class="wp-header-end">
458 -
459 -<?php bogo_admin_notice(); ?>
460 -
461 -<form action="" method="get">
462 -<input type="hidden" name="page" value="<?php echo esc_attr( $_REQUEST['page'] ?? '' ); ?>" />
463 -<input type="hidden" name="locale" value="<?php echo esc_attr( $_REQUEST['locale'] ?? '' ); ?>" />
464 -<?php
465 - $list_table->search_box(
466 - __( 'Search Translation', 'bogo' ), 'bogo-terms-translation'
467 - );
468 -?>
469 -</form>
470 -
471 -<form action="" method="post" id="bogo-terms-translation">
472 -<input type="hidden" name="action" value="save" />
473 -<input type="hidden" name="paged" value="<?php echo absint( $_GET['paged'] ?? '' ); ?>" />
474 -<?php
475 - wp_nonce_field( 'bogo-edit-text-translation' );
476 - $list_table->display();
477 -?>
478 -</form>
171 +</ul>
479 172 </div>
480 173 <?php
481 174 }
482 175
483 -function bogo_admin_notice( $reason = '' ) {
484 - if ( empty( $reason ) and isset( $_GET['message'] ) ) {
485 - $reason = $_GET['message'];
486 - }
487 -
488 - if ( 'install_success' === $reason ) {
489 - $message = __( 'Translation installed successfully.', 'bogo' );
490 - } elseif ( 'install_failed' === $reason ) {
491 - $message = __( 'Translation install failed.', 'bogo' );
492 - } elseif ( 'promote_success' === $reason ) {
493 - $message = __( 'Site language set successfully.', 'bogo' );
494 - } elseif ( 'promote_failed' === $reason ) {
495 - $message = __( 'Setting site language failed.', 'bogo' );
496 - } elseif ( 'delete_success' === $reason ) {
497 - $message = __( 'Translation uninstalled successfully.', 'bogo' );
498 - } elseif ( 'delete_failed' === $reason ) {
499 - $message = __( 'Translation uninstall failed.', 'bogo' );
500 - } elseif ( 'enus_deactivated' === $reason ) {
501 - $message = __( 'English (United States) deactivated.', 'bogo' );
502 - } elseif ( 'enus_activated' === $reason ) {
503 - $message = __( 'English (United States) activated.', 'bogo' );
504 - } elseif ( 'translation_saved' === $reason ) {
505 - $message = __( 'Translation saved.', 'bogo' );
506 - } elseif ( 'translation_failed' === $reason ) {
507 - $message = __( 'Saving translation failed.', 'bogo' );
508 - } else {
509 - return false;
510 - }
511 -
512 - wp_admin_notice( $message, array(
513 - 'type' => str_ends_with( $reason, '_failed' ) ? 'error' : 'success',
514 - ) );
515 -}
176 +?>