Changeset 3183922
- Timestamp:
- 11/07/2024 02:39:03 PM (13 months ago)
- Location:
- nlingual
- Files:
-
- 34 edited
- 37 copied
-
tags/2.10.0.1 (copied) (copied from nlingual/trunk)
-
tags/2.10.0.1/documentation/languages/overview.php (copied) (copied from nlingual/trunk/documentation/languages/overview.php)
-
tags/2.10.0.1/documentation/localizables/overview.php (copied) (copied from nlingual/trunk/documentation/localizables/overview.php)
-
tags/2.10.0.1/documentation/localizables/sidebar.php (copied) (copied from nlingual/trunk/documentation/localizables/sidebar.php)
-
tags/2.10.0.1/documentation/localizer/localize-this.php (copied) (copied from nlingual/trunk/documentation/localizer/localize-this.php)
-
tags/2.10.0.1/documentation/options/management.php (copied) (copied from nlingual/trunk/documentation/options/management.php)
-
tags/2.10.0.1/documentation/options/overview.php (copied) (copied from nlingual/trunk/documentation/options/overview.php)
-
tags/2.10.0.1/documentation/options/requests.php (copied) (copied from nlingual/trunk/documentation/options/requests.php)
-
tags/2.10.0.1/documentation/options/sidebar.php (copied) (copied from nlingual/trunk/documentation/options/sidebar.php)
-
tags/2.10.0.1/documentation/post-translation/translation.php (copied) (copied from nlingual/trunk/documentation/post-translation/translation.php)
-
tags/2.10.0.1/documentation/posts-translation/translation.php (copied) (copied from nlingual/trunk/documentation/posts-translation/translation.php)
-
tags/2.10.0.1/documentation/shared/post-sync-summary.php (copied) (copied from nlingual/trunk/documentation/shared/post-sync-summary.php)
-
tags/2.10.0.1/documentation/synchronizer/cloning.php (copied) (copied from nlingual/trunk/documentation/synchronizer/cloning.php)
-
tags/2.10.0.1/documentation/synchronizer/overview.php (copied) (copied from nlingual/trunk/documentation/synchronizer/overview.php)
-
tags/2.10.0.1/documentation/synchronizer/sidebar.php (copied) (copied from nlingual/trunk/documentation/synchronizer/sidebar.php)
-
tags/2.10.0.1/includes/abstract-nlingual-handler.php (copied) (copied from nlingual/trunk/includes/abstract-nlingual-handler.php) (5 diffs)
-
tags/2.10.0.1/includes/autoloader.php (modified) (2 diffs)
-
tags/2.10.0.1/includes/class-nlingual-backend.php (copied) (copied from nlingual/trunk/includes/class-nlingual-backend.php) (7 diffs)
-
tags/2.10.0.1/includes/class-nlingual-documenter.php (modified) (2 diffs)
-
tags/2.10.0.1/includes/class-nlingual-exception.php (copied) (copied from nlingual/trunk/includes/class-nlingual-exception.php) (1 diff)
-
tags/2.10.0.1/includes/class-nlingual-frontend.php (copied) (copied from nlingual/trunk/includes/class-nlingual-frontend.php) (4 diffs)
-
tags/2.10.0.1/includes/class-nlingual-installer.php (modified) (3 diffs)
-
tags/2.10.0.1/includes/class-nlingual-language.php (modified) (1 diff)
-
tags/2.10.0.1/includes/class-nlingual-languages.php (copied) (copied from nlingual/trunk/includes/class-nlingual-languages.php) (3 diffs)
-
tags/2.10.0.1/includes/class-nlingual-liaison.php (copied) (copied from nlingual/trunk/includes/class-nlingual-liaison.php) (3 diffs)
-
tags/2.10.0.1/includes/class-nlingual-locale.php (copied) (copied from nlingual/trunk/includes/class-nlingual-locale.php)
-
tags/2.10.0.1/includes/class-nlingual-localizer-field.php (modified) (1 diff)
-
tags/2.10.0.1/includes/class-nlingual-localizer.php (copied) (copied from nlingual/trunk/includes/class-nlingual-localizer.php) (10 diffs)
-
tags/2.10.0.1/includes/class-nlingual-manager.php (copied) (copied from nlingual/trunk/includes/class-nlingual-manager.php) (3 diffs)
-
tags/2.10.0.1/includes/class-nlingual-registry.php (copied) (copied from nlingual/trunk/includes/class-nlingual-registry.php) (12 diffs)
-
tags/2.10.0.1/includes/class-nlingual-rewriter.php (copied) (copied from nlingual/trunk/includes/class-nlingual-rewriter.php) (8 diffs)
-
tags/2.10.0.1/includes/class-nlingual-settings.php (copied) (copied from nlingual/trunk/includes/class-nlingual-settings.php) (4 diffs)
-
tags/2.10.0.1/includes/class-nlingual-synchronizer.php (copied) (copied from nlingual/trunk/includes/class-nlingual-synchronizer.php)
-
tags/2.10.0.1/includes/class-nlingual-system.php (copied) (copied from nlingual/trunk/includes/class-nlingual-system.php) (8 diffs)
-
tags/2.10.0.1/includes/class-nlingual-translator.php (copied) (copied from nlingual/trunk/includes/class-nlingual-translator.php) (6 diffs)
-
tags/2.10.0.1/includes/class-nlingual-url.php (copied) (copied from nlingual/trunk/includes/class-nlingual-url.php) (2 diffs)
-
tags/2.10.0.1/includes/functions-compatibility.php (modified) (3 diffs)
-
tags/2.10.0.1/includes/functions-gettext.php (copied) (copied from nlingual/trunk/includes/functions-gettext.php)
-
tags/2.10.0.1/includes/functions-nlingual.php (copied) (copied from nlingual/trunk/includes/functions-nlingual.php) (3 diffs)
-
tags/2.10.0.1/includes/presets-languages.php (modified) (1 diff)
-
tags/2.10.0.1/js/admin.js (modified) (3 diffs)
-
tags/2.10.0.1/languages/nlingual.pot (copied) (copied from nlingual/trunk/languages/nlingual.pot) (1 diff)
-
tags/2.10.0.1/nlingual.php (copied) (copied from nlingual/trunk/nlingual.php) (2 diffs)
-
tags/2.10.0.1/readme.txt (copied) (copied from nlingual/trunk/readme.txt) (3 diffs)
-
tags/2.10.0.1/uninstall.php (copied) (copied from nlingual/trunk/uninstall.php)
-
trunk/includes/abstract-nlingual-handler.php (modified) (5 diffs)
-
trunk/includes/autoloader.php (modified) (2 diffs)
-
trunk/includes/class-nlingual-backend.php (modified) (7 diffs)
-
trunk/includes/class-nlingual-documenter.php (modified) (2 diffs)
-
trunk/includes/class-nlingual-exception.php (modified) (1 diff)
-
trunk/includes/class-nlingual-frontend.php (modified) (4 diffs)
-
trunk/includes/class-nlingual-installer.php (modified) (3 diffs)
-
trunk/includes/class-nlingual-language.php (modified) (1 diff)
-
trunk/includes/class-nlingual-languages.php (modified) (3 diffs)
-
trunk/includes/class-nlingual-liaison.php (modified) (3 diffs)
-
trunk/includes/class-nlingual-localizer-field.php (modified) (1 diff)
-
trunk/includes/class-nlingual-localizer.php (modified) (10 diffs)
-
trunk/includes/class-nlingual-manager.php (modified) (3 diffs)
-
trunk/includes/class-nlingual-registry.php (modified) (12 diffs)
-
trunk/includes/class-nlingual-rewriter.php (modified) (8 diffs)
-
trunk/includes/class-nlingual-settings.php (modified) (4 diffs)
-
trunk/includes/class-nlingual-system.php (modified) (8 diffs)
-
trunk/includes/class-nlingual-translator.php (modified) (6 diffs)
-
trunk/includes/class-nlingual-url.php (modified) (2 diffs)
-
trunk/includes/functions-compatibility.php (modified) (3 diffs)
-
trunk/includes/functions-nlingual.php (modified) (3 diffs)
-
trunk/includes/presets-languages.php (modified) (1 diff)
-
trunk/js/admin.js (modified) (3 diffs)
-
trunk/languages/nlingual.pot (modified) (1 diff)
-
trunk/nlingual.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
nlingual/tags/2.10.0.1/includes/abstract-nlingual-handler.php
r3168845 r3183922 135 135 * 136 136 * @param string $tag The name of the filter to hook the $method to. 137 * @param string $method The name of the called class e'smethod to run when applied.137 * @param string $method The name of the called class' method to run when applied. 138 138 * @param int $priority Optional. The priority to use for this particular callback. 139 139 * @param int $accepted_args Optional. The number of arguments the callback accepts. … … 175 175 * @param string $tag The name of the filter to remove from. 176 176 * @param string $method The name of the called class' method to remove. 177 * @param bool $dont_disable W ether or not to skip flagging it at disabled.177 * @param bool $dont_disable Whether or not to skip flagging it at disabled. 178 178 * 179 179 * @return bool|int The priority it originally had (false if wasn't added). … … 216 216 * @since 2.6.0 217 217 * 218 * @param bool $force W ether or not to explicitly disable all hooks.218 * @param bool $force Whether or not to explicitly disable all hooks. 219 219 */ 220 220 public static function remove_all_hooks( $disable = false ) { … … 233 233 * @param string $tag The name of the filter to remove from. 234 234 * @param string $method The name of the class' method to remove. 235 * @param bool $dont_force W ether or not to ignore a hook's disabled status.235 * @param bool $dont_force Whether or not to ignore a hook's disabled status. 236 236 */ 237 237 final public static function restore_hook( $tag, $method, $dont_force = false ) { … … 255 255 * @since 2.6.0 256 256 * 257 * @param bool $force W ether or not to force-restore all hooks.257 * @param bool $force Whether or not to force-restore all hooks. 258 258 */ 259 259 public static function restore_all_hooks( $force = false ) { -
nlingual/tags/2.10.0.1/includes/autoloader.php
r1896568 r3183922 22 22 * @param string $name The symbol name of the asset being requested. 23 23 * 24 * @return bool W ether or not the file was found and loaded.24 * @return bool Whether or not the file was found and loaded. 25 25 */ 26 26 function find( $type, $name ) { … … 46 46 * Find/load an nLingual class. 47 47 * 48 * Will automatically init ailize if it's a Functional sub-class.48 * Will automatically initialize if it's a Functional sub-class. 49 49 * 50 50 * @internal -
nlingual/tags/2.10.0.1/includes/class-nlingual-backend.php
r3168847 r3183922 16 16 * Hooks into various backend systems to load 17 17 * custom assets, modify the interface, and 18 * add language management to relev ent screens.18 * add language management to relevant screens. 19 19 * 20 20 * @internal Used by the System. … … 343 343 */ 344 344 private static function register_localized_locations( $type, $global ) { 345 $list = $GLOBALS[ $global ] ;345 $list = $GLOBALS[ $global ] ?? array(); 346 346 347 347 // Cache the old version of the menus for reference … … 733 733 734 734 /* translators: %1$s = The name of the language, %2$s = The title of the post, wrapped in a link */ 735 $links[] = esc_html( _fx( '%1$s: %2$s', 'language: title', 'nlingual', $other_language->system_name, $link ));735 $links[] = _fx( '%1$s: %2$s', 'language: title', 'nlingual', $other_language->system_name, $link ); 736 736 } 737 737 if ( $links ) { … … 1162 1162 // And the post type supports translation 1163 1163 && Registry::is_post_type_supported( $post->post_type ) 1164 // And the post type has sync ronization rules specified1164 // And the post type has synchronization rules specified 1165 1165 && Registry::get_post_sync_rules( $post->post_type ) 1166 1166 // And the post has sister translations … … 1296 1296 * 1297 1297 * @since 2.10.0 Add translator notes. Explicitly enqueue in header. 1298 * @si cne 2.8.8 Add admin_post, for nl_new_translation call.1298 * @since 2.8.8 Add admin_post, for nl_new_translation call. 1299 1299 * @since 2.6.0 Updated to use plugin version for CSS/JS files. 1300 1300 * @since 2.0.0 … … 1327 1327 1328 1328 /** 1329 * Print relev ent variables for JavaScript.1329 * Print relevant variables for JavaScript. 1330 1330 * 1331 1331 * @since 2.10.0 Use wp_json_encode(). … … 1352 1352 1353 1353 /** 1354 * Create a clone of the requested post in the requested lan uage.1354 * Create a clone of the requested post in the requested language. 1355 1355 * 1356 1356 * Will redirect to the edit screen for the new translation. -
nlingual/tags/2.10.0.1/includes/class-nlingual-documenter.php
r2449432 r3183922 164 164 * @uses Documenter::register_help_tab() to register each screen/tab. 165 165 * 166 * @param string$screens An array of screen=>tab IDs to register.166 * @param array<string,string> $screens An array of screen=>tab IDs to register. 167 167 */ 168 168 public static function register_help_tabs( $screens ) { … … 177 177 178 178 /** 179 * Load the s epecified tab's file and return it's ID/title/content.179 * Load the specified tab's file and return it's ID/title/content. 180 180 * 181 181 * @since 2.0.0 -
nlingual/tags/2.10.0.1/includes/class-nlingual-exception.php
r3168845 r3183922 72 72 73 73 /** 74 * Ou put a string representation of the exception.74 * Output a string representation of the exception. 75 75 * 76 76 * @since 2.0.0 -
nlingual/tags/2.10.0.1/includes/class-nlingual-frontend.php
r3168847 r3183922 68 68 self::add_hook( 'wp_nav_menu_objects', 'handle_language_links', 10, 1 ); 69 69 70 // General fi tlering70 // General filtering 71 71 self::add_hook( 'body_class', 'add_body_classes', 10, 1 ); 72 72 self::add_hook( 'option_page_on_front', 'current_language_post', 10, 1 ); … … 252 252 * @param string $type The type of location. 253 253 * @param array $locations The list of locations to filter. 254 * @param array $registered The list of orig nially register locations.254 * @param array $registered The list of originally register locations. 255 255 * 256 256 * @return array The modified $locations with unlocalized versions updated. … … 360 360 * @since 2.9.2 361 361 * 362 * @param bool $localize_items W ether or not to localize menu items.362 * @param bool $localize_items Whether or not to localize menu items. 363 363 * @param object $menu The menu being considered. 364 364 * @param array $items The items for the menu. … … 695 695 } 696 696 697 // Replace with new i sntance of patched one697 // Replace with new instance of patched one 698 698 $wp_locale = new Locale(); 699 699 } -
nlingual/tags/2.10.0.1/includes/class-nlingual-installer.php
r1896568 r3183922 70 70 */ 71 71 private static function plugin_security_check( $check_referer = null ) { 72 // Make sure they have permiss on72 // Make sure they have permission 73 73 if ( ! current_user_can( 'activate_plugins' ) ) { 74 74 return false; … … 92 92 * Test if the site previously used nLingual 1. 93 93 * 94 * Tests for presen se of old nLingual-options array.95 * 96 * @since 2.0.0 97 * 98 * @return bool W ether or not we're upgrading.94 * Tests for presence of old nLingual-options array. 95 * 96 * @since 2.0.0 97 * 98 * @return bool Whether or not we're upgrading. 99 99 */ 100 100 private static function is_upgrading() { … … 305 305 * @global \wpdb $wpdb The database abstraction class instance. 306 306 * 307 * @return bool W ether or not an upgrade was performed.307 * @return bool Whether or not an upgrade was performed. 308 308 */ 309 309 public static function upgrade() { -
nlingual/tags/2.10.0.1/includes/class-nlingual-language.php
r2375574 r3183922 169 169 * @option string "iso_code" The ISO 639-1 code for the language. 170 170 * @option string "direction" The text direction of the language (ltr or rtl). 171 * @option int "list_order" The d isired order of the language.171 * @option int "list_order" The desired order of the language. 172 172 */ 173 173 public function __construct( $values ) { -
nlingual/tags/2.10.0.1/includes/class-nlingual-languages.php
r3168845 r3183922 126 126 * @since 2.0.0 127 127 * 128 * @return bool W ether or not the position is valid.128 * @return bool Whether or not the position is valid. 129 129 */ 130 130 public function valid() { … … 321 321 * 322 322 * @param array|Language $language The language to add. 323 * @param bool $sort W ether or not to sort after adding.323 * @param bool $sort Whether or not to sort after adding. 324 324 * 325 325 * @return self. … … 387 387 * 388 388 * @since 2.9.1 Drop checking of locale/ISO for match. 389 * @si cne 2.2.0 Changed to check all locales before checking ISO codes.389 * @since 2.2.0 Changed to check all locales before checking ISO codes. 390 390 * @since 2.0.0 391 391 * -
nlingual/tags/2.10.0.1/includes/class-nlingual-liaison.php
r3168847 r3183922 421 421 * @param \WP_Query $query The query being modified. 422 422 * 423 * @return mixed The default language otuse.423 * @return mixed The default language to use. 424 424 */ 425 425 public static function quickstart_order_manager_language( $pre_value, $query ) { … … 601 601 */ 602 602 public static function indexpages_filter_pages_for_dropdown( $pages, $args ) { 603 // Bail if pages are not supported for tran lsation603 // Bail if pages are not supported for translation 604 604 if ( ! Registry::is_post_type_supported( 'page' ) ) { 605 605 return $pages; … … 680 680 681 681 /** 682 * Check if cert ian SEO plugins are active, setup necessary helpers.682 * Check if certain SEO plugins are active, setup necessary helpers. 683 683 * 684 684 * @since 2.9.1 -
nlingual/tags/2.10.0.1/includes/class-nlingual-localizer-field.php
r2375574 r3183922 94 94 95 95 /** 96 * W ether or not to ignore the fallback when the localized value is empty.96 * Whether or not to ignore the fallback when the localized value is empty. 97 97 * 98 98 * @since 2.6.0 -
nlingual/tags/2.10.0.1/includes/class-nlingual-localizer.php
r3168847 r3183922 120 120 121 121 /** 122 * Registry of objects whos localized data has been preloaded.122 * Registry of objects whose localized data has been preloaded. 123 123 * 124 124 * @internal … … 153 153 * @param string|array $ids The ID (or list of IDs to try) of the field to retrieve. 154 154 * 155 * @return Localizer_Field|bool The retr eived field, FALSE on failure.155 * @return Localizer_Field|bool The retrieved field, FALSE on failure. 156 156 */ 157 157 public static function get_field( $ids ) { … … 511 511 * @param string|array $id The ID (or possible IDs) of the field, or a key to search for. 512 512 * @param int $language_id The language ID to match. 513 * @param int $object_id The object ID if relev ent (otherwise 0).513 * @param int $object_id The object ID if relevant (otherwise 0). 514 514 * @param string $fallback Optional. A fallback to use if the result is empty/null. 515 * @param bool $check_reg Optional. W ether or not to check if the field is regsitered before fetching (default TRUE).515 * @param bool $check_reg Optional. Whether or not to check if the field is registered before fetching (default TRUE). 516 516 * 517 517 * @return field|bool The localized version, false if nothing found. … … 565 565 * 566 566 * @param string $key The field key to search for. 567 * @param int $object_id Optional. The object ID if relev ent (otherwise 0).568 * @param bool $check_reg Optional. W ether or not to check if the field is regsitered before fetching (default TRUE).567 * @param int $object_id Optional. The object ID if relevant (otherwise 0). 568 * @param bool $check_reg Optional. Whether or not to check if the field is registered before fetching (default TRUE). 569 569 * 570 570 * @return array The localized versions of the specified field. … … 611 611 * @param string $key The field key to search for. 612 612 * @param int $language_id The language ID to save for. 613 * @param int $object_id The object ID if relev ent (otherwise 0).613 * @param int $object_id The object ID if relevant (otherwise 0). 614 614 * @param string $value The localized value of the field. 615 * @param bool $check_reg Optional. W ether or not to check if the field is regsitered before fetching (default TRUE).615 * @param bool $check_reg Optional. Whether or not to check if the field is registered before fetching (default TRUE). 616 616 */ 617 617 public static function save_field_value( $key, $language_id, $object_id, $value, $check_reg = true ) { … … 857 857 $term_object = \WP_Term::get_instance( $term_id ); // Get the raw term 858 858 859 // If the term can be retrieved, localize the name, falling back if applica lbe859 // If the term can be retrieved, localize the name, falling back if applicable 860 860 if ( $term_object ) { 861 861 $term = self::get_field_value( "term.{$term_object->taxonomy}:term_name", $language->id, $term_id, $term ); … … 880 880 881 881 if ( $args['fields'] == 'names' ) { 882 // Chan age to id=>names, will convert back later882 // Change to id=>names, will convert back later 883 883 $args['fields'] = 'id=>name'; 884 884 … … 938 938 */ 939 939 public static function update_unlocalized_term_fields( $term_id, $tt_id, $taxonomy ) { 940 // Get the u dpated term, since we aren't provided with the updated values940 // Get the updated term, since we aren't provided with the updated values 941 941 $term = get_term( $term_id, $taxonomy ); 942 942 … … 980 980 } 981 981 982 // Determin object ID to use982 // Determine object ID to use 983 983 $object_id_keys = array( 984 984 'post.php' => 'post_ID', … … 1068 1068 } 1069 1069 1070 // Determin object ID to use1070 // Determine object ID to use 1071 1071 $object_id_keys = array( 1072 1072 'post' => 'post', -
nlingual/tags/2.10.0.1/includes/class-nlingual-manager.php
r3168847 r3183922 1 1 <?php 2 2 /** 3 * nLingual Management Fun tionality3 * nLingual Management Functionality 4 4 * 5 5 * @package nLingual … … 83 83 array( __CLASS__, 'settings_page' ), // callback 84 84 'dashicons-translation', // icon 85 90 // Pos tion; after settings85 90 // Position; after settings 86 86 ); 87 87 … … 242 242 } 243 243 244 // Default text direction to ltr if not set, rtl if not explic tly ltr244 // Default text direction to ltr if not set, rtl if not explicitly ltr 245 245 $entry['direction'] = 'ltr'; 246 246 if ( isset( $language['direction'] ) && $language['direction'] != 'ltr' ) { -
nlingual/tags/2.10.0.1/includes/class-nlingual-registry.php
r3168847 r3183922 242 242 * Check if an option is supported. 243 243 * 244 * Will also u dpate the option value if it was deprecated244 * Will also update the option value if it was deprecated 245 245 * but has a sufficient alternative. 246 246 * … … 250 250 * @param string &$option The option name. 251 251 * 252 * @return bool W ether or not the option is supported.252 * @return bool Whether or not the option is supported. 253 253 */ 254 254 public static function has( &$option ) { … … 280 280 // Check if it's set, return it's value. 281 281 if ( isset( self::$options[ $option ] ) ) { 282 // Check if it's been overrid en, use that unless otherwise requested282 // Check if it's been overridden, use that unless otherwise requested 283 283 $has_override = isset( self::$options_override[ $option ] ); 284 284 if ( $has_override && ! $true_value ) { … … 376 376 * @since 2.0.0 377 377 * 378 * @uses Registry::get() to retri ve the appropriate rules array.378 * @uses Registry::get() to retrieve the appropriate rules array. 379 379 * 380 380 * @param string $rule_type The type of rules to retrieve ('sync' or 'clone'). … … 446 446 * 447 447 * @param mixed $language The desired language. 448 * @param bool $lock W ether or not to lock the selection.449 * @param bool $override W ether or not to override the lock.448 * @param bool $lock Whether or not to lock the selection. 449 * @param bool $override Whether or not to override the lock. 450 450 * 451 451 * @throws Exception If the language specified does not exist. 452 452 * 453 * @return bool W ether or not the language could be changed.453 * @return bool Whether or not the language could be changed. 454 454 */ 455 455 public static function set_language( $language, $lock = false, $override = false ) { … … 557 557 * @param mixed $language2 The language to compare against. 558 558 * 559 * @return bool The result of the comparis ion.559 * @return bool The result of the comparison. 560 560 */ 561 561 public static function compare_languages( $language1, $language2 ) { … … 626 626 * @param string $location Optional. The ID of a specific location to check. 627 627 * 628 * @return bool W ether or not the location is localizable.628 * @return bool Whether or not the location is localizable. 629 629 */ 630 630 public static function is_location_supported( $type, $location = null ) { … … 670 670 * 671 671 * @param string|array $post_types The post type(s) to check. 672 * @param bool $require_all Optional. W ether or not to ensure ALL are supported.673 * 674 * @return bool W ether or not the post type(s) are supported.672 * @param bool $require_all Optional. Whether or not to ensure ALL are supported. 673 * 674 * @return bool Whether or not the post type(s) are supported. 675 675 */ 676 676 public static function is_post_type_supported( $post_types, $require_all = false ) { … … 709 709 * @param string|array $taxonomies The taxonomy(ies) to check. 710 710 * 711 * @return bool W ether or not the taxonomy(ies) are supported.711 * @return bool Whether or not the taxonomy(ies) are supported. 712 712 */ 713 713 public static function is_taxonomy_supported( $taxonomies ) { … … 739 739 * @global \WP_Rewrite $wp_rewrite The WordPress rewrite API. 740 740 * 741 * @return bool W ether or not rewriting can be used.741 * @return bool Whether or not rewriting can be used. 742 742 */ 743 743 public static function can_use_rewrites() { … … 759 759 * This setting applies if: 760 760 * - it's enabled 761 * - the default lang auge is requested761 * - the default language is requested 762 762 * - the accepted language doesn't match 763 763 * another available language … … 767 767 * @param mixed $language The language to compare. 768 768 * 769 * @return bool W ether or not the skip_default_l10n rule applies.769 * @return bool Whether or not the skip_default_l10n rule applies. 770 770 */ 771 771 public static function does_skip_default_l10n_apply( $language ) { -
nlingual/tags/2.10.0.1/includes/class-nlingual-rewriter.php
r3168847 r3183922 26 26 27 27 /** 28 * Internal flag for w ether or not to localize a URL.28 * Internal flag for whether or not to localize a URL. 29 29 * 30 30 * @internal … … 105 105 * 106 106 * @param string|array $url_data Optional. The URL string or parsed array to process. 107 * @param bool $return_language Optional. W ether or not to return just the language.107 * @param bool $return_language Optional. Whether or not to return just the language. 108 108 * 109 109 * @return URL The parsed and processed URL object. … … 217 217 * 218 218 * @since 2.10.0 Use wp_parse_url(). 219 * @since 2.9.1 Adjust URL building and trai nling slash handling.219 * @since 2.9.1 Adjust URL building and trailing slash handling. 220 220 * @since 2.9.0 Use does_skip_default_l10n_apply() to handle default URL localization logic, 221 221 * Added $force_localize to allow overriding skip_default_l10n even if it applies. … … 232 232 * @param string $url The URL to parse. 233 233 * @param mixed $language Optional. The desired language to localize to. 234 * @param bool $force_localize Optional. W ether or not to ignore skip_default_l10n.234 * @param bool $force_localize Optional. Whether or not to ignore skip_default_l10n. 235 235 * 236 236 * @throws Exception If the language requested does not exist. … … 256 256 257 257 /** 258 * Filter w ether or not to localize the URL.258 * Filter whether or not to localize the URL. 259 259 * 260 260 * @since 2.8.4 Dropped $relocalize param. … … 305 305 306 306 // If it's not a wordpress internal URL, 307 // AND skip_defa lt_l10n does not apply,307 // AND skip_default_l10n does not apply, 308 308 // Go ahead and localize the URL 309 309 if ( ! preg_match( '#^/wp-([\w-]+.php|(admin|content|includes)/)#', $the_url->path ) … … 494 494 unset( $_GET['s'] ); 495 495 } 496 // Give up and just get the or ginally requested URL, relocalized496 // Give up and just get the originally requested URL, relocalized 497 497 else { 498 498 $url = self::localize_url( NL_ORIGINAL_URL, null ); … … 612 612 * @uses Rewriter::localize_here() to get each URL. 613 613 * 614 * @param bool $skip_current W ether or not to skip the current language.614 * @param bool $skip_current Whether or not to skip the current language. 615 615 * @param string $index_by What language property to use for the array index (typically id or slug). 616 616 * -
nlingual/tags/2.10.0.1/includes/class-nlingual-settings.php
r3168847 r3183922 108 108 109 109 /** 110 * Given an array, extract the d isired value defined like so: myvar[mykey][0].110 * Given an array, extract the desired value defined like so: myvar[mykey][0]. 111 111 * 112 112 * @since 2.0.0 … … 149 149 * Retrieve the settings value. 150 150 * 151 * Handles names like option[suboption][] appropr aitely.151 * Handles names like option[suboption][] appropriately. 152 152 * 153 153 * @since 2.0.0 … … 191 191 * @option mixed "data" Optional. data for the field. 192 192 * @option string "help" Optional. Help text. 193 * @param mixed $value Optional. A specifi value to use193 * @param mixed $value Optional. A specific value to use 194 194 * instead of dynamically retrieving it. 195 195 */ … … 229 229 230 230 if ( $args['help'] ) { 231 // Wrap $html in lab lewith help text if checkbox or radio231 // Wrap $html in label with help text if checkbox or radio 232 232 if ( $args['type'] == 'checkbox' || $args['type'] == 'radio' ) { 233 233 $html = sprintf( '<label>%s %s</label>', $html, $args['help'] ); -
nlingual/tags/2.10.0.1/includes/class-nlingual-system.php
r3168845 r3183922 189 189 * 190 190 * @param mixed $language The language object, slug or id. 191 * @param bool $reload_textdomains W ether or not to reload text domains.191 * @param bool $reload_textdomains Whether or not to reload text domains. 192 192 */ 193 193 public static function switch_language( $language, $reload_textdomains = false ) { … … 423 423 424 424 /** 425 * @todo figure out handling of switching lang auge within switching blog425 * @todo figure out handling of switching language within switching blog 426 426 */ 427 427 … … 469 469 * @uses Rewriter::process_url() to parse the current page URL. 470 470 * @uses Registry::does_skip_default_l10n_apply() to see if the default language URL should be unlocalized. 471 * @uses Registry::accepted_language() to determine a p erferred language.471 * @uses Registry::accepted_language() to determine a preferred language. 472 472 * @uses Registry::set_language() to tentatively apply the detected language. 473 473 */ … … 667 667 * Flag a post being (un)trashed. 668 668 * 669 * This is to prevent sync ronize_post() from proceeding.669 * This is to prevent synchronize_post() from proceeding. 670 670 * 671 671 * @since 2.6.0 … … 836 836 } 837 837 838 // If the langu ge was detected via URL and we're still parsing the request, force localization838 // If the language was detected via URL and we're still parsing the request, force localization 839 839 $force_localize = defined( 'NL_DETECTED_SOURCE' ) && NL_DETECTED_SOURCE == 'url' && ! did_action( 'parse_request' ); 840 840 … … 1112 1112 } 1113 1113 1114 // If in the backend, or language is not required, add 0 to retr eive language-less posts too1114 // If in the backend, or language is not required, add 0 to retrieve language-less posts too 1115 1115 if ( is_backend() || ! Registry::get( 'language_is_required' ) ) { 1116 1116 $value[] = '0'; … … 1198 1198 $requested_languages = (array) $query_vars[ $query_var ]; 1199 1199 1200 // Get the available languages for vali ation purposes1200 // Get the available languages for validation purposes 1201 1201 $all_languages = Registry::languages(); 1202 1202 … … 1246 1246 * @uses Registry::get() to retrieve the show_all_languages option. 1247 1247 * @uses Registry::languages() to check/get the matching language object. 1248 * @uses Registry::current_language() as the default language to fi tler by.1248 * @uses Registry::current_language() as the default language to filter by. 1249 1249 * @uses Translator::get_post_language() to get the translation in that language. 1250 1250 * 1251 1251 * @param array $pages The list of pages to filter. 1252 * @param array $args The ar ugments passed to get_pages().1252 * @param array $args The arguments passed to get_pages(). 1253 1253 * 1254 1254 * @return array The filtered list of pages. -
nlingual/tags/2.10.0.1/includes/class-nlingual-translator.php
r3168847 r3183922 24 24 * @method static bool|Language get_post_language( int|\WP_Post $post, bool $true_value = false ) get a post's language. 25 25 * @method static bool|Language get_term_language( int|\WP_Term $term, bool $true_value = false ) get a term's language. 26 * @method static bool set_post_language( int|\WP_Post $post, mixed $lang auge ) set a post's language.27 * @method static bool set_term_language( int|\WP_Term $term, mixed $lang auge ) set a term's language.26 * @method static bool set_post_language( int|\WP_Post $post, mixed $language ) set a post's language. 27 * @method static bool set_term_language( int|\WP_Term $term, mixed $language ) set a term's language. 28 28 * @method static bool delete_post_language( int|\WP_Post $post ) delete a post's language. 29 29 * @method static bool delete_term_language( int|\WP_Term $term ) delete a term's language. … … 215 215 * @param string $object_type The type of object. 216 216 * @param int $object_id The ID of the object. 217 * @param bool $true_value W ether or not to bypass language_is_requried fallback.217 * @param bool $true_value Whether or not to bypass language_is_required fallback. 218 218 * 219 219 * @return bool|Language The language of the object (false if not found). … … 451 451 * any of the languages listed aren't valid. 452 452 * 453 * @since 2.10.0 Fix do ucmentation on $translations.453 * @since 2.10.0 Fix documentation on $translations. 454 454 * @since 2.6.0 Now flushes cache for translations as well as target object. 455 455 * @since 2.0.0 … … 468 468 * @throws Exception If the language specified does not exist. 469 469 * 470 * @param bool W ether or not the association could be done (false if aborted).470 * @param bool Whether or not the association could be done (false if aborted). 471 471 */ 472 472 public static function set_object_translations( $object_type, $object_id, $translations ) { … … 543 543 * @throws Exception If the language specified does not exist. 544 544 * 545 * @param bool W ether or not the association could be done.545 * @param bool Whether or not the association could be done. 546 546 */ 547 547 public static function set_object_translation( $object_type, $object_id, $language, $target_id ) { … … 576 576 * @throws Exception If the language specified does not exist. 577 577 * 578 * @return bool W ether or not a deletion was performed (false = nothing to delete).578 * @return bool Whether or not a deletion was performed (false = nothing to delete). 579 579 */ 580 580 public static function delete_object_translation( $object_type, $object_id, $language ) { -
nlingual/tags/2.10.0.1/includes/class-nlingual-url.php
r3168847 r3183922 148 148 // If not an array, throw an exception 149 149 elseif ( ! is_array( $url_data ) ) { 150 throw new Exception( __CLASS__ . '::parse() expects a string or array, rec ieved ' . gettype( $url_data ), NL_ERR_UNSUPPORTED );150 throw new Exception( __CLASS__ . '::parse() expects a string or array, received ' . gettype( $url_data ), NL_ERR_UNSUPPORTED ); 151 151 } 152 152 … … 239 239 } 240 240 241 // Finish ewith the fragment241 // Finish with the fragment 242 242 if ( $this->fragment ) { 243 243 $url .= '#' . $this->fragment; -
nlingual/tags/2.10.0.1/includes/functions-compatibility.php
r2244029 r3183922 1 1 <?php 2 2 /** 3 * nLingual Compatibil ty Functions3 * nLingual Compatibility Functions 4 4 * 5 5 * @package nLingual 6 * @subpackage Backwards_Compatibil ty6 * @subpackage Backwards_Compatibility 7 7 * 8 8 * @since 2.0.0 … … 200 200 * 201 201 * @param string $prefix Optional. A prefix to place before the links (should end with a space). 202 * @param string $sep Optio anl A separator to use when putting the links together.203 * @param bool $skip_current Optional. W ether or not to leave out the link for the current language.202 * @param string $sep Optional A separator to use when putting the links together. 203 * @param bool $skip_current Optional. Whether or not to leave out the link for the current language. 204 204 */ 205 205 function nL_print_lang_links( $prefix = '', $sep = ' ', $skip_current = false ) { … … 225 225 * @param mixed $language Optional. The language to get the matching version for (defaults to current). 226 226 * @param string $separator Optional. The separator to use when splitting the text (defaults to one defined under nLingual before 2.0.0). 227 * @param bool $force Optional. W ether or not to force the split to happen instead of only when outside the admin.227 * @param bool $force Optional. Whether or not to force the split to happen instead of only when outside the admin. 228 228 * 229 229 * @return string The part of the text corresponding to the language desired. -
nlingual/tags/2.10.0.1/includes/functions-nlingual.php
r3168845 r3183922 25 25 * @since 2.0.0 26 26 * 27 * @return bool W ether or not this should be considered a "backend" request.27 * @return bool Whether or not this should be considered a "backend" request. 28 28 */ 29 29 function is_backend() { … … 49 49 * @since 2.4.0 50 50 * 51 * @return bool W ether or not we're running on 4.6 or earlier.51 * @return bool Whether or not we're running on 4.6 or earlier. 52 52 */ 53 53 function is_patch_font_stack_needed() { … … 162 162 * @since 2.8.0 163 163 * 164 * @return bool W ether or not this plugin is active.164 * @return bool Whether or not this plugin is active. 165 165 */ 166 166 function is_nlingual_active() { -
nlingual/tags/2.10.0.1/includes/presets-languages.php
r1896568 r3183922 142 142 ), 143 143 'pt' => array( 144 'system_name' => __( 'Portug ese', 'nlingual' ),144 'system_name' => __( 'Portuguese', 'nlingual' ), 145 145 'native_name' => 'Português', 146 146 'short_name' => 'Pt', -
nlingual/tags/2.10.0.1/js/admin.js
r2681436 r3183922 56 56 jQuery( $ => { 57 57 // ========================= 58 // ! Set ings Pages58 // ! Settings Pages 59 59 // ========================= 60 60 … … 451 451 tinymce.editors.forEach( localizeEditor ); 452 452 453 // Backwards compatib lity; catch any late-registered editors453 // Backwards compatibility; catch any late-registered editors 454 454 tinymce.on( 'SetupEditor', e => { 455 455 // TinyMCE 4.7 changes callback arg to event CONTAINING editor … … 501 501 } ); 502 502 503 // Create a new translation for the assoc aited language503 // Create a new translation for the associated language 504 504 $( '.nl-add-translation' ).click( function() { 505 505 var $field = $( this ).parents( '.nl-field' ); -
nlingual/tags/2.10.0.1/languages/nlingual.pot
r3168845 r3183922 1229 1229 1230 1230 #: includes/presets-languages.php:144 1231 msgid "Portug ese"1231 msgid "Portuguese" 1232 1232 msgstr "" 1233 1233 -
nlingual/tags/2.10.0.1/nlingual.php
r3168847 r3183922 4 4 Plugin URI: https://github.com/dougwollison/nlingual 5 5 Description: Easy to manage Multilingual system, with theme development utilities and post data synchronization. 6 Version: 2.10.0 6 Version: 2.10.0.1 7 7 Author: Doug Wollison 8 8 Author URI: https://dougw.me … … 51 51 * @var string 52 52 */ 53 define( 'NL_PLUGIN_VERSION', '2.10.0 ' );53 define( 'NL_PLUGIN_VERSION', '2.10.0.1' ); 54 54 55 55 /** -
nlingual/tags/2.10.0.1/readme.txt
r3168847 r3183922 5 5 Tested up to: 6.6.2 6 6 Requires PHP: 7.0.0 7 Stable tag: 2.10.0 7 Stable tag: 2.10.0.1 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 44 44 - Slug: the value to use when localizing a URL for the language (typically the same as the ISO code). 45 45 - Text Direction: the text direction the language should be rendered in (Left-to-right or right-to-left). Will override the one specified in the text domain files. 46 - Active State: w ether or not to allow public access to content in the language.46 - Active State: whether or not to allow public access to content in the language. 47 47 48 48 = Flexible Language Detection/Switching = … … 80 80 **Details on each release can be found [on the GitHub releases page](https://github.com/dougwollison/nlingual/releases) for this project.** 81 81 82 = 2.10.0.1 = 83 Fix display of translation links in posts screen. 84 82 85 = 2.10.0 = 83 86 WP 6.6 and PHP 7 compatibility and API documentation improvements. Minor type check fixes and output escaping for edge cases. -
nlingual/trunk/includes/abstract-nlingual-handler.php
r3168845 r3183922 135 135 * 136 136 * @param string $tag The name of the filter to hook the $method to. 137 * @param string $method The name of the called class e'smethod to run when applied.137 * @param string $method The name of the called class' method to run when applied. 138 138 * @param int $priority Optional. The priority to use for this particular callback. 139 139 * @param int $accepted_args Optional. The number of arguments the callback accepts. … … 175 175 * @param string $tag The name of the filter to remove from. 176 176 * @param string $method The name of the called class' method to remove. 177 * @param bool $dont_disable W ether or not to skip flagging it at disabled.177 * @param bool $dont_disable Whether or not to skip flagging it at disabled. 178 178 * 179 179 * @return bool|int The priority it originally had (false if wasn't added). … … 216 216 * @since 2.6.0 217 217 * 218 * @param bool $force W ether or not to explicitly disable all hooks.218 * @param bool $force Whether or not to explicitly disable all hooks. 219 219 */ 220 220 public static function remove_all_hooks( $disable = false ) { … … 233 233 * @param string $tag The name of the filter to remove from. 234 234 * @param string $method The name of the class' method to remove. 235 * @param bool $dont_force W ether or not to ignore a hook's disabled status.235 * @param bool $dont_force Whether or not to ignore a hook's disabled status. 236 236 */ 237 237 final public static function restore_hook( $tag, $method, $dont_force = false ) { … … 255 255 * @since 2.6.0 256 256 * 257 * @param bool $force W ether or not to force-restore all hooks.257 * @param bool $force Whether or not to force-restore all hooks. 258 258 */ 259 259 public static function restore_all_hooks( $force = false ) { -
nlingual/trunk/includes/autoloader.php
r1896568 r3183922 22 22 * @param string $name The symbol name of the asset being requested. 23 23 * 24 * @return bool W ether or not the file was found and loaded.24 * @return bool Whether or not the file was found and loaded. 25 25 */ 26 26 function find( $type, $name ) { … … 46 46 * Find/load an nLingual class. 47 47 * 48 * Will automatically init ailize if it's a Functional sub-class.48 * Will automatically initialize if it's a Functional sub-class. 49 49 * 50 50 * @internal -
nlingual/trunk/includes/class-nlingual-backend.php
r3168847 r3183922 16 16 * Hooks into various backend systems to load 17 17 * custom assets, modify the interface, and 18 * add language management to relev ent screens.18 * add language management to relevant screens. 19 19 * 20 20 * @internal Used by the System. … … 343 343 */ 344 344 private static function register_localized_locations( $type, $global ) { 345 $list = $GLOBALS[ $global ] ;345 $list = $GLOBALS[ $global ] ?? array(); 346 346 347 347 // Cache the old version of the menus for reference … … 733 733 734 734 /* translators: %1$s = The name of the language, %2$s = The title of the post, wrapped in a link */ 735 $links[] = esc_html( _fx( '%1$s: %2$s', 'language: title', 'nlingual', $other_language->system_name, $link ));735 $links[] = _fx( '%1$s: %2$s', 'language: title', 'nlingual', $other_language->system_name, $link ); 736 736 } 737 737 if ( $links ) { … … 1162 1162 // And the post type supports translation 1163 1163 && Registry::is_post_type_supported( $post->post_type ) 1164 // And the post type has sync ronization rules specified1164 // And the post type has synchronization rules specified 1165 1165 && Registry::get_post_sync_rules( $post->post_type ) 1166 1166 // And the post has sister translations … … 1296 1296 * 1297 1297 * @since 2.10.0 Add translator notes. Explicitly enqueue in header. 1298 * @si cne 2.8.8 Add admin_post, for nl_new_translation call.1298 * @since 2.8.8 Add admin_post, for nl_new_translation call. 1299 1299 * @since 2.6.0 Updated to use plugin version for CSS/JS files. 1300 1300 * @since 2.0.0 … … 1327 1327 1328 1328 /** 1329 * Print relev ent variables for JavaScript.1329 * Print relevant variables for JavaScript. 1330 1330 * 1331 1331 * @since 2.10.0 Use wp_json_encode(). … … 1352 1352 1353 1353 /** 1354 * Create a clone of the requested post in the requested lan uage.1354 * Create a clone of the requested post in the requested language. 1355 1355 * 1356 1356 * Will redirect to the edit screen for the new translation. -
nlingual/trunk/includes/class-nlingual-documenter.php
r2449432 r3183922 164 164 * @uses Documenter::register_help_tab() to register each screen/tab. 165 165 * 166 * @param string$screens An array of screen=>tab IDs to register.166 * @param array<string,string> $screens An array of screen=>tab IDs to register. 167 167 */ 168 168 public static function register_help_tabs( $screens ) { … … 177 177 178 178 /** 179 * Load the s epecified tab's file and return it's ID/title/content.179 * Load the specified tab's file and return it's ID/title/content. 180 180 * 181 181 * @since 2.0.0 -
nlingual/trunk/includes/class-nlingual-exception.php
r3168845 r3183922 72 72 73 73 /** 74 * Ou put a string representation of the exception.74 * Output a string representation of the exception. 75 75 * 76 76 * @since 2.0.0 -
nlingual/trunk/includes/class-nlingual-frontend.php
r3168847 r3183922 68 68 self::add_hook( 'wp_nav_menu_objects', 'handle_language_links', 10, 1 ); 69 69 70 // General fi tlering70 // General filtering 71 71 self::add_hook( 'body_class', 'add_body_classes', 10, 1 ); 72 72 self::add_hook( 'option_page_on_front', 'current_language_post', 10, 1 ); … … 252 252 * @param string $type The type of location. 253 253 * @param array $locations The list of locations to filter. 254 * @param array $registered The list of orig nially register locations.254 * @param array $registered The list of originally register locations. 255 255 * 256 256 * @return array The modified $locations with unlocalized versions updated. … … 360 360 * @since 2.9.2 361 361 * 362 * @param bool $localize_items W ether or not to localize menu items.362 * @param bool $localize_items Whether or not to localize menu items. 363 363 * @param object $menu The menu being considered. 364 364 * @param array $items The items for the menu. … … 695 695 } 696 696 697 // Replace with new i sntance of patched one697 // Replace with new instance of patched one 698 698 $wp_locale = new Locale(); 699 699 } -
nlingual/trunk/includes/class-nlingual-installer.php
r1896568 r3183922 70 70 */ 71 71 private static function plugin_security_check( $check_referer = null ) { 72 // Make sure they have permiss on72 // Make sure they have permission 73 73 if ( ! current_user_can( 'activate_plugins' ) ) { 74 74 return false; … … 92 92 * Test if the site previously used nLingual 1. 93 93 * 94 * Tests for presen se of old nLingual-options array.95 * 96 * @since 2.0.0 97 * 98 * @return bool W ether or not we're upgrading.94 * Tests for presence of old nLingual-options array. 95 * 96 * @since 2.0.0 97 * 98 * @return bool Whether or not we're upgrading. 99 99 */ 100 100 private static function is_upgrading() { … … 305 305 * @global \wpdb $wpdb The database abstraction class instance. 306 306 * 307 * @return bool W ether or not an upgrade was performed.307 * @return bool Whether or not an upgrade was performed. 308 308 */ 309 309 public static function upgrade() { -
nlingual/trunk/includes/class-nlingual-language.php
r2375574 r3183922 169 169 * @option string "iso_code" The ISO 639-1 code for the language. 170 170 * @option string "direction" The text direction of the language (ltr or rtl). 171 * @option int "list_order" The d isired order of the language.171 * @option int "list_order" The desired order of the language. 172 172 */ 173 173 public function __construct( $values ) { -
nlingual/trunk/includes/class-nlingual-languages.php
r3168845 r3183922 126 126 * @since 2.0.0 127 127 * 128 * @return bool W ether or not the position is valid.128 * @return bool Whether or not the position is valid. 129 129 */ 130 130 public function valid() { … … 321 321 * 322 322 * @param array|Language $language The language to add. 323 * @param bool $sort W ether or not to sort after adding.323 * @param bool $sort Whether or not to sort after adding. 324 324 * 325 325 * @return self. … … 387 387 * 388 388 * @since 2.9.1 Drop checking of locale/ISO for match. 389 * @si cne 2.2.0 Changed to check all locales before checking ISO codes.389 * @since 2.2.0 Changed to check all locales before checking ISO codes. 390 390 * @since 2.0.0 391 391 * -
nlingual/trunk/includes/class-nlingual-liaison.php
r3168847 r3183922 421 421 * @param \WP_Query $query The query being modified. 422 422 * 423 * @return mixed The default language otuse.423 * @return mixed The default language to use. 424 424 */ 425 425 public static function quickstart_order_manager_language( $pre_value, $query ) { … … 601 601 */ 602 602 public static function indexpages_filter_pages_for_dropdown( $pages, $args ) { 603 // Bail if pages are not supported for tran lsation603 // Bail if pages are not supported for translation 604 604 if ( ! Registry::is_post_type_supported( 'page' ) ) { 605 605 return $pages; … … 680 680 681 681 /** 682 * Check if cert ian SEO plugins are active, setup necessary helpers.682 * Check if certain SEO plugins are active, setup necessary helpers. 683 683 * 684 684 * @since 2.9.1 -
nlingual/trunk/includes/class-nlingual-localizer-field.php
r2375574 r3183922 94 94 95 95 /** 96 * W ether or not to ignore the fallback when the localized value is empty.96 * Whether or not to ignore the fallback when the localized value is empty. 97 97 * 98 98 * @since 2.6.0 -
nlingual/trunk/includes/class-nlingual-localizer.php
r3168847 r3183922 120 120 121 121 /** 122 * Registry of objects whos localized data has been preloaded.122 * Registry of objects whose localized data has been preloaded. 123 123 * 124 124 * @internal … … 153 153 * @param string|array $ids The ID (or list of IDs to try) of the field to retrieve. 154 154 * 155 * @return Localizer_Field|bool The retr eived field, FALSE on failure.155 * @return Localizer_Field|bool The retrieved field, FALSE on failure. 156 156 */ 157 157 public static function get_field( $ids ) { … … 511 511 * @param string|array $id The ID (or possible IDs) of the field, or a key to search for. 512 512 * @param int $language_id The language ID to match. 513 * @param int $object_id The object ID if relev ent (otherwise 0).513 * @param int $object_id The object ID if relevant (otherwise 0). 514 514 * @param string $fallback Optional. A fallback to use if the result is empty/null. 515 * @param bool $check_reg Optional. W ether or not to check if the field is regsitered before fetching (default TRUE).515 * @param bool $check_reg Optional. Whether or not to check if the field is registered before fetching (default TRUE). 516 516 * 517 517 * @return field|bool The localized version, false if nothing found. … … 565 565 * 566 566 * @param string $key The field key to search for. 567 * @param int $object_id Optional. The object ID if relev ent (otherwise 0).568 * @param bool $check_reg Optional. W ether or not to check if the field is regsitered before fetching (default TRUE).567 * @param int $object_id Optional. The object ID if relevant (otherwise 0). 568 * @param bool $check_reg Optional. Whether or not to check if the field is registered before fetching (default TRUE). 569 569 * 570 570 * @return array The localized versions of the specified field. … … 611 611 * @param string $key The field key to search for. 612 612 * @param int $language_id The language ID to save for. 613 * @param int $object_id The object ID if relev ent (otherwise 0).613 * @param int $object_id The object ID if relevant (otherwise 0). 614 614 * @param string $value The localized value of the field. 615 * @param bool $check_reg Optional. W ether or not to check if the field is regsitered before fetching (default TRUE).615 * @param bool $check_reg Optional. Whether or not to check if the field is registered before fetching (default TRUE). 616 616 */ 617 617 public static function save_field_value( $key, $language_id, $object_id, $value, $check_reg = true ) { … … 857 857 $term_object = \WP_Term::get_instance( $term_id ); // Get the raw term 858 858 859 // If the term can be retrieved, localize the name, falling back if applica lbe859 // If the term can be retrieved, localize the name, falling back if applicable 860 860 if ( $term_object ) { 861 861 $term = self::get_field_value( "term.{$term_object->taxonomy}:term_name", $language->id, $term_id, $term ); … … 880 880 881 881 if ( $args['fields'] == 'names' ) { 882 // Chan age to id=>names, will convert back later882 // Change to id=>names, will convert back later 883 883 $args['fields'] = 'id=>name'; 884 884 … … 938 938 */ 939 939 public static function update_unlocalized_term_fields( $term_id, $tt_id, $taxonomy ) { 940 // Get the u dpated term, since we aren't provided with the updated values940 // Get the updated term, since we aren't provided with the updated values 941 941 $term = get_term( $term_id, $taxonomy ); 942 942 … … 980 980 } 981 981 982 // Determin object ID to use982 // Determine object ID to use 983 983 $object_id_keys = array( 984 984 'post.php' => 'post_ID', … … 1068 1068 } 1069 1069 1070 // Determin object ID to use1070 // Determine object ID to use 1071 1071 $object_id_keys = array( 1072 1072 'post' => 'post', -
nlingual/trunk/includes/class-nlingual-manager.php
r3168847 r3183922 1 1 <?php 2 2 /** 3 * nLingual Management Fun tionality3 * nLingual Management Functionality 4 4 * 5 5 * @package nLingual … … 83 83 array( __CLASS__, 'settings_page' ), // callback 84 84 'dashicons-translation', // icon 85 90 // Pos tion; after settings85 90 // Position; after settings 86 86 ); 87 87 … … 242 242 } 243 243 244 // Default text direction to ltr if not set, rtl if not explic tly ltr244 // Default text direction to ltr if not set, rtl if not explicitly ltr 245 245 $entry['direction'] = 'ltr'; 246 246 if ( isset( $language['direction'] ) && $language['direction'] != 'ltr' ) { -
nlingual/trunk/includes/class-nlingual-registry.php
r3168847 r3183922 242 242 * Check if an option is supported. 243 243 * 244 * Will also u dpate the option value if it was deprecated244 * Will also update the option value if it was deprecated 245 245 * but has a sufficient alternative. 246 246 * … … 250 250 * @param string &$option The option name. 251 251 * 252 * @return bool W ether or not the option is supported.252 * @return bool Whether or not the option is supported. 253 253 */ 254 254 public static function has( &$option ) { … … 280 280 // Check if it's set, return it's value. 281 281 if ( isset( self::$options[ $option ] ) ) { 282 // Check if it's been overrid en, use that unless otherwise requested282 // Check if it's been overridden, use that unless otherwise requested 283 283 $has_override = isset( self::$options_override[ $option ] ); 284 284 if ( $has_override && ! $true_value ) { … … 376 376 * @since 2.0.0 377 377 * 378 * @uses Registry::get() to retri ve the appropriate rules array.378 * @uses Registry::get() to retrieve the appropriate rules array. 379 379 * 380 380 * @param string $rule_type The type of rules to retrieve ('sync' or 'clone'). … … 446 446 * 447 447 * @param mixed $language The desired language. 448 * @param bool $lock W ether or not to lock the selection.449 * @param bool $override W ether or not to override the lock.448 * @param bool $lock Whether or not to lock the selection. 449 * @param bool $override Whether or not to override the lock. 450 450 * 451 451 * @throws Exception If the language specified does not exist. 452 452 * 453 * @return bool W ether or not the language could be changed.453 * @return bool Whether or not the language could be changed. 454 454 */ 455 455 public static function set_language( $language, $lock = false, $override = false ) { … … 557 557 * @param mixed $language2 The language to compare against. 558 558 * 559 * @return bool The result of the comparis ion.559 * @return bool The result of the comparison. 560 560 */ 561 561 public static function compare_languages( $language1, $language2 ) { … … 626 626 * @param string $location Optional. The ID of a specific location to check. 627 627 * 628 * @return bool W ether or not the location is localizable.628 * @return bool Whether or not the location is localizable. 629 629 */ 630 630 public static function is_location_supported( $type, $location = null ) { … … 670 670 * 671 671 * @param string|array $post_types The post type(s) to check. 672 * @param bool $require_all Optional. W ether or not to ensure ALL are supported.673 * 674 * @return bool W ether or not the post type(s) are supported.672 * @param bool $require_all Optional. Whether or not to ensure ALL are supported. 673 * 674 * @return bool Whether or not the post type(s) are supported. 675 675 */ 676 676 public static function is_post_type_supported( $post_types, $require_all = false ) { … … 709 709 * @param string|array $taxonomies The taxonomy(ies) to check. 710 710 * 711 * @return bool W ether or not the taxonomy(ies) are supported.711 * @return bool Whether or not the taxonomy(ies) are supported. 712 712 */ 713 713 public static function is_taxonomy_supported( $taxonomies ) { … … 739 739 * @global \WP_Rewrite $wp_rewrite The WordPress rewrite API. 740 740 * 741 * @return bool W ether or not rewriting can be used.741 * @return bool Whether or not rewriting can be used. 742 742 */ 743 743 public static function can_use_rewrites() { … … 759 759 * This setting applies if: 760 760 * - it's enabled 761 * - the default lang auge is requested761 * - the default language is requested 762 762 * - the accepted language doesn't match 763 763 * another available language … … 767 767 * @param mixed $language The language to compare. 768 768 * 769 * @return bool W ether or not the skip_default_l10n rule applies.769 * @return bool Whether or not the skip_default_l10n rule applies. 770 770 */ 771 771 public static function does_skip_default_l10n_apply( $language ) { -
nlingual/trunk/includes/class-nlingual-rewriter.php
r3168847 r3183922 26 26 27 27 /** 28 * Internal flag for w ether or not to localize a URL.28 * Internal flag for whether or not to localize a URL. 29 29 * 30 30 * @internal … … 105 105 * 106 106 * @param string|array $url_data Optional. The URL string or parsed array to process. 107 * @param bool $return_language Optional. W ether or not to return just the language.107 * @param bool $return_language Optional. Whether or not to return just the language. 108 108 * 109 109 * @return URL The parsed and processed URL object. … … 217 217 * 218 218 * @since 2.10.0 Use wp_parse_url(). 219 * @since 2.9.1 Adjust URL building and trai nling slash handling.219 * @since 2.9.1 Adjust URL building and trailing slash handling. 220 220 * @since 2.9.0 Use does_skip_default_l10n_apply() to handle default URL localization logic, 221 221 * Added $force_localize to allow overriding skip_default_l10n even if it applies. … … 232 232 * @param string $url The URL to parse. 233 233 * @param mixed $language Optional. The desired language to localize to. 234 * @param bool $force_localize Optional. W ether or not to ignore skip_default_l10n.234 * @param bool $force_localize Optional. Whether or not to ignore skip_default_l10n. 235 235 * 236 236 * @throws Exception If the language requested does not exist. … … 256 256 257 257 /** 258 * Filter w ether or not to localize the URL.258 * Filter whether or not to localize the URL. 259 259 * 260 260 * @since 2.8.4 Dropped $relocalize param. … … 305 305 306 306 // If it's not a wordpress internal URL, 307 // AND skip_defa lt_l10n does not apply,307 // AND skip_default_l10n does not apply, 308 308 // Go ahead and localize the URL 309 309 if ( ! preg_match( '#^/wp-([\w-]+.php|(admin|content|includes)/)#', $the_url->path ) … … 494 494 unset( $_GET['s'] ); 495 495 } 496 // Give up and just get the or ginally requested URL, relocalized496 // Give up and just get the originally requested URL, relocalized 497 497 else { 498 498 $url = self::localize_url( NL_ORIGINAL_URL, null ); … … 612 612 * @uses Rewriter::localize_here() to get each URL. 613 613 * 614 * @param bool $skip_current W ether or not to skip the current language.614 * @param bool $skip_current Whether or not to skip the current language. 615 615 * @param string $index_by What language property to use for the array index (typically id or slug). 616 616 * -
nlingual/trunk/includes/class-nlingual-settings.php
r3168847 r3183922 108 108 109 109 /** 110 * Given an array, extract the d isired value defined like so: myvar[mykey][0].110 * Given an array, extract the desired value defined like so: myvar[mykey][0]. 111 111 * 112 112 * @since 2.0.0 … … 149 149 * Retrieve the settings value. 150 150 * 151 * Handles names like option[suboption][] appropr aitely.151 * Handles names like option[suboption][] appropriately. 152 152 * 153 153 * @since 2.0.0 … … 191 191 * @option mixed "data" Optional. data for the field. 192 192 * @option string "help" Optional. Help text. 193 * @param mixed $value Optional. A specifi value to use193 * @param mixed $value Optional. A specific value to use 194 194 * instead of dynamically retrieving it. 195 195 */ … … 229 229 230 230 if ( $args['help'] ) { 231 // Wrap $html in lab lewith help text if checkbox or radio231 // Wrap $html in label with help text if checkbox or radio 232 232 if ( $args['type'] == 'checkbox' || $args['type'] == 'radio' ) { 233 233 $html = sprintf( '<label>%s %s</label>', $html, $args['help'] ); -
nlingual/trunk/includes/class-nlingual-system.php
r3168845 r3183922 189 189 * 190 190 * @param mixed $language The language object, slug or id. 191 * @param bool $reload_textdomains W ether or not to reload text domains.191 * @param bool $reload_textdomains Whether or not to reload text domains. 192 192 */ 193 193 public static function switch_language( $language, $reload_textdomains = false ) { … … 423 423 424 424 /** 425 * @todo figure out handling of switching lang auge within switching blog425 * @todo figure out handling of switching language within switching blog 426 426 */ 427 427 … … 469 469 * @uses Rewriter::process_url() to parse the current page URL. 470 470 * @uses Registry::does_skip_default_l10n_apply() to see if the default language URL should be unlocalized. 471 * @uses Registry::accepted_language() to determine a p erferred language.471 * @uses Registry::accepted_language() to determine a preferred language. 472 472 * @uses Registry::set_language() to tentatively apply the detected language. 473 473 */ … … 667 667 * Flag a post being (un)trashed. 668 668 * 669 * This is to prevent sync ronize_post() from proceeding.669 * This is to prevent synchronize_post() from proceeding. 670 670 * 671 671 * @since 2.6.0 … … 836 836 } 837 837 838 // If the langu ge was detected via URL and we're still parsing the request, force localization838 // If the language was detected via URL and we're still parsing the request, force localization 839 839 $force_localize = defined( 'NL_DETECTED_SOURCE' ) && NL_DETECTED_SOURCE == 'url' && ! did_action( 'parse_request' ); 840 840 … … 1112 1112 } 1113 1113 1114 // If in the backend, or language is not required, add 0 to retr eive language-less posts too1114 // If in the backend, or language is not required, add 0 to retrieve language-less posts too 1115 1115 if ( is_backend() || ! Registry::get( 'language_is_required' ) ) { 1116 1116 $value[] = '0'; … … 1198 1198 $requested_languages = (array) $query_vars[ $query_var ]; 1199 1199 1200 // Get the available languages for vali ation purposes1200 // Get the available languages for validation purposes 1201 1201 $all_languages = Registry::languages(); 1202 1202 … … 1246 1246 * @uses Registry::get() to retrieve the show_all_languages option. 1247 1247 * @uses Registry::languages() to check/get the matching language object. 1248 * @uses Registry::current_language() as the default language to fi tler by.1248 * @uses Registry::current_language() as the default language to filter by. 1249 1249 * @uses Translator::get_post_language() to get the translation in that language. 1250 1250 * 1251 1251 * @param array $pages The list of pages to filter. 1252 * @param array $args The ar ugments passed to get_pages().1252 * @param array $args The arguments passed to get_pages(). 1253 1253 * 1254 1254 * @return array The filtered list of pages. -
nlingual/trunk/includes/class-nlingual-translator.php
r3168847 r3183922 24 24 * @method static bool|Language get_post_language( int|\WP_Post $post, bool $true_value = false ) get a post's language. 25 25 * @method static bool|Language get_term_language( int|\WP_Term $term, bool $true_value = false ) get a term's language. 26 * @method static bool set_post_language( int|\WP_Post $post, mixed $lang auge ) set a post's language.27 * @method static bool set_term_language( int|\WP_Term $term, mixed $lang auge ) set a term's language.26 * @method static bool set_post_language( int|\WP_Post $post, mixed $language ) set a post's language. 27 * @method static bool set_term_language( int|\WP_Term $term, mixed $language ) set a term's language. 28 28 * @method static bool delete_post_language( int|\WP_Post $post ) delete a post's language. 29 29 * @method static bool delete_term_language( int|\WP_Term $term ) delete a term's language. … … 215 215 * @param string $object_type The type of object. 216 216 * @param int $object_id The ID of the object. 217 * @param bool $true_value W ether or not to bypass language_is_requried fallback.217 * @param bool $true_value Whether or not to bypass language_is_required fallback. 218 218 * 219 219 * @return bool|Language The language of the object (false if not found). … … 451 451 * any of the languages listed aren't valid. 452 452 * 453 * @since 2.10.0 Fix do ucmentation on $translations.453 * @since 2.10.0 Fix documentation on $translations. 454 454 * @since 2.6.0 Now flushes cache for translations as well as target object. 455 455 * @since 2.0.0 … … 468 468 * @throws Exception If the language specified does not exist. 469 469 * 470 * @param bool W ether or not the association could be done (false if aborted).470 * @param bool Whether or not the association could be done (false if aborted). 471 471 */ 472 472 public static function set_object_translations( $object_type, $object_id, $translations ) { … … 543 543 * @throws Exception If the language specified does not exist. 544 544 * 545 * @param bool W ether or not the association could be done.545 * @param bool Whether or not the association could be done. 546 546 */ 547 547 public static function set_object_translation( $object_type, $object_id, $language, $target_id ) { … … 576 576 * @throws Exception If the language specified does not exist. 577 577 * 578 * @return bool W ether or not a deletion was performed (false = nothing to delete).578 * @return bool Whether or not a deletion was performed (false = nothing to delete). 579 579 */ 580 580 public static function delete_object_translation( $object_type, $object_id, $language ) { -
nlingual/trunk/includes/class-nlingual-url.php
r3168847 r3183922 148 148 // If not an array, throw an exception 149 149 elseif ( ! is_array( $url_data ) ) { 150 throw new Exception( __CLASS__ . '::parse() expects a string or array, rec ieved ' . gettype( $url_data ), NL_ERR_UNSUPPORTED );150 throw new Exception( __CLASS__ . '::parse() expects a string or array, received ' . gettype( $url_data ), NL_ERR_UNSUPPORTED ); 151 151 } 152 152 … … 239 239 } 240 240 241 // Finish ewith the fragment241 // Finish with the fragment 242 242 if ( $this->fragment ) { 243 243 $url .= '#' . $this->fragment; -
nlingual/trunk/includes/functions-compatibility.php
r2244029 r3183922 1 1 <?php 2 2 /** 3 * nLingual Compatibil ty Functions3 * nLingual Compatibility Functions 4 4 * 5 5 * @package nLingual 6 * @subpackage Backwards_Compatibil ty6 * @subpackage Backwards_Compatibility 7 7 * 8 8 * @since 2.0.0 … … 200 200 * 201 201 * @param string $prefix Optional. A prefix to place before the links (should end with a space). 202 * @param string $sep Optio anl A separator to use when putting the links together.203 * @param bool $skip_current Optional. W ether or not to leave out the link for the current language.202 * @param string $sep Optional A separator to use when putting the links together. 203 * @param bool $skip_current Optional. Whether or not to leave out the link for the current language. 204 204 */ 205 205 function nL_print_lang_links( $prefix = '', $sep = ' ', $skip_current = false ) { … … 225 225 * @param mixed $language Optional. The language to get the matching version for (defaults to current). 226 226 * @param string $separator Optional. The separator to use when splitting the text (defaults to one defined under nLingual before 2.0.0). 227 * @param bool $force Optional. W ether or not to force the split to happen instead of only when outside the admin.227 * @param bool $force Optional. Whether or not to force the split to happen instead of only when outside the admin. 228 228 * 229 229 * @return string The part of the text corresponding to the language desired. -
nlingual/trunk/includes/functions-nlingual.php
r3168845 r3183922 25 25 * @since 2.0.0 26 26 * 27 * @return bool W ether or not this should be considered a "backend" request.27 * @return bool Whether or not this should be considered a "backend" request. 28 28 */ 29 29 function is_backend() { … … 49 49 * @since 2.4.0 50 50 * 51 * @return bool W ether or not we're running on 4.6 or earlier.51 * @return bool Whether or not we're running on 4.6 or earlier. 52 52 */ 53 53 function is_patch_font_stack_needed() { … … 162 162 * @since 2.8.0 163 163 * 164 * @return bool W ether or not this plugin is active.164 * @return bool Whether or not this plugin is active. 165 165 */ 166 166 function is_nlingual_active() { -
nlingual/trunk/includes/presets-languages.php
r1896568 r3183922 142 142 ), 143 143 'pt' => array( 144 'system_name' => __( 'Portug ese', 'nlingual' ),144 'system_name' => __( 'Portuguese', 'nlingual' ), 145 145 'native_name' => 'Português', 146 146 'short_name' => 'Pt', -
nlingual/trunk/js/admin.js
r2681436 r3183922 56 56 jQuery( $ => { 57 57 // ========================= 58 // ! Set ings Pages58 // ! Settings Pages 59 59 // ========================= 60 60 … … 451 451 tinymce.editors.forEach( localizeEditor ); 452 452 453 // Backwards compatib lity; catch any late-registered editors453 // Backwards compatibility; catch any late-registered editors 454 454 tinymce.on( 'SetupEditor', e => { 455 455 // TinyMCE 4.7 changes callback arg to event CONTAINING editor … … 501 501 } ); 502 502 503 // Create a new translation for the assoc aited language503 // Create a new translation for the associated language 504 504 $( '.nl-add-translation' ).click( function() { 505 505 var $field = $( this ).parents( '.nl-field' ); -
nlingual/trunk/languages/nlingual.pot
r3168845 r3183922 1229 1229 1230 1230 #: includes/presets-languages.php:144 1231 msgid "Portug ese"1231 msgid "Portuguese" 1232 1232 msgstr "" 1233 1233 -
nlingual/trunk/nlingual.php
r3168847 r3183922 4 4 Plugin URI: https://github.com/dougwollison/nlingual 5 5 Description: Easy to manage Multilingual system, with theme development utilities and post data synchronization. 6 Version: 2.10.0 6 Version: 2.10.0.1 7 7 Author: Doug Wollison 8 8 Author URI: https://dougw.me … … 51 51 * @var string 52 52 */ 53 define( 'NL_PLUGIN_VERSION', '2.10.0 ' );53 define( 'NL_PLUGIN_VERSION', '2.10.0.1' ); 54 54 55 55 /** -
nlingual/trunk/readme.txt
r3168847 r3183922 5 5 Tested up to: 6.6.2 6 6 Requires PHP: 7.0.0 7 Stable tag: 2.10.0 7 Stable tag: 2.10.0.1 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 44 44 - Slug: the value to use when localizing a URL for the language (typically the same as the ISO code). 45 45 - Text Direction: the text direction the language should be rendered in (Left-to-right or right-to-left). Will override the one specified in the text domain files. 46 - Active State: w ether or not to allow public access to content in the language.46 - Active State: whether or not to allow public access to content in the language. 47 47 48 48 = Flexible Language Detection/Switching = … … 80 80 **Details on each release can be found [on the GitHub releases page](https://github.com/dougwollison/nlingual/releases) for this project.** 81 81 82 = 2.10.0.1 = 83 Fix display of translation links in posts screen. 84 82 85 = 2.10.0 = 83 86 WP 6.6 and PHP 7 compatibility and API documentation improvements. Minor type check fixes and output escaping for edge cases.
Note: See TracChangeset
for help on using the changeset viewer.