Changeset 3042570
- Timestamp:
- 02/28/2024 12:46:43 PM (2 years ago)
- Location:
- glotpress
- Files:
-
- 42 edited
- 1 copied
-
tags/4.0.0-beta.3 (copied) (copied from glotpress/trunk)
-
tags/4.0.0-beta.3/CHANGELOG.md (modified) (3 diffs)
-
tags/4.0.0-beta.3/glotpress.php (modified) (2 diffs)
-
tags/4.0.0-beta.3/gp-includes/route.php (modified) (2 diffs)
-
tags/4.0.0-beta.3/gp-includes/template.php (modified) (1 diff)
-
tags/4.0.0-beta.3/gp-templates/glossary-delete.php (modified) (1 diff)
-
tags/4.0.0-beta.3/gp-templates/glossary-edit.php (modified) (2 diffs)
-
tags/4.0.0-beta.3/gp-templates/glossary-import.php (modified) (1 diff)
-
tags/4.0.0-beta.3/gp-templates/glossary-new.php (modified) (1 diff)
-
tags/4.0.0-beta.3/gp-templates/glossary-view.php (modified) (1 diff)
-
tags/4.0.0-beta.3/gp-templates/helper-functions.php (modified) (3 diffs)
-
tags/4.0.0-beta.3/gp-templates/project-branch.php (modified) (1 diff)
-
tags/4.0.0-beta.3/gp-templates/project-delete.php (modified) (1 diff)
-
tags/4.0.0-beta.3/gp-templates/project-edit.php (modified) (1 diff)
-
tags/4.0.0-beta.3/gp-templates/project-import.php (modified) (2 diffs)
-
tags/4.0.0-beta.3/gp-templates/project-mass-create-sets.php (modified) (1 diff)
-
tags/4.0.0-beta.3/gp-templates/project-new.php (modified) (1 diff)
-
tags/4.0.0-beta.3/gp-templates/project-permissions.php (modified) (1 diff)
-
tags/4.0.0-beta.3/gp-templates/translation-set-delete.php (modified) (1 diff)
-
tags/4.0.0-beta.3/gp-templates/translation-set-edit.php (modified) (1 diff)
-
tags/4.0.0-beta.3/gp-templates/translation-set-new.php (modified) (1 diff)
-
tags/4.0.0-beta.3/gp-templates/translations.php (modified) (2 diffs)
-
trunk/CHANGELOG.md (modified) (3 diffs)
-
trunk/glotpress.php (modified) (2 diffs)
-
trunk/gp-includes/route.php (modified) (2 diffs)
-
trunk/gp-includes/template.php (modified) (1 diff)
-
trunk/gp-templates/glossary-delete.php (modified) (1 diff)
-
trunk/gp-templates/glossary-edit.php (modified) (2 diffs)
-
trunk/gp-templates/glossary-import.php (modified) (1 diff)
-
trunk/gp-templates/glossary-new.php (modified) (1 diff)
-
trunk/gp-templates/glossary-view.php (modified) (1 diff)
-
trunk/gp-templates/helper-functions.php (modified) (3 diffs)
-
trunk/gp-templates/project-branch.php (modified) (1 diff)
-
trunk/gp-templates/project-delete.php (modified) (1 diff)
-
trunk/gp-templates/project-edit.php (modified) (1 diff)
-
trunk/gp-templates/project-import.php (modified) (2 diffs)
-
trunk/gp-templates/project-mass-create-sets.php (modified) (1 diff)
-
trunk/gp-templates/project-new.php (modified) (1 diff)
-
trunk/gp-templates/project-permissions.php (modified) (1 diff)
-
trunk/gp-templates/translation-set-delete.php (modified) (1 diff)
-
trunk/gp-templates/translation-set-edit.php (modified) (1 diff)
-
trunk/gp-templates/translation-set-new.php (modified) (1 diff)
-
trunk/gp-templates/translations.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
glotpress/tags/4.0.0-beta.3/CHANGELOG.md
r3027320 r3042570 1 1 All notable changes to this project will be documented in this file. 2 2 This project adheres to [Semantic Versioning](http://semver.org/). 3 4 ## [4.0.0-beta.3] (February 28, 2024) 5 6 **Features** 7 * Add a 'gp_before_translation_table' hook ([#1792]) 8 9 **Bugfixes** 10 11 * Add trailing slash to current_url to fix matching URLs without trailing slash ([#1785]) 12 * Breadcrumbs: Improve consistency across all content types ([#1789]) 13 * Glossary: Match single word entries of parts of speech that have no suffix rules. ([#1791]) 14 * Fix redirecting URL with query args ([#1797]) 15 * Add the breadcrumbs for the "New project" actions ([#1800]) 16 * Make the glossary regex more deterministic ([#1801]) 3 17 4 18 ## [4.0.0-beta.2] (January 26, 2024) … … 629 643 630 644 [Unreleased]: https://github.com/GlotPress/GlotPress/compare/3.0.0...HEAD 645 [4.0.0-beta.3]: https://github.com/GlotPress/GlotPress/compare/4.0.0-beta.2...4.0.0-beta.3 631 646 [4.0.0-beta.2]: https://github.com/GlotPress/GlotPress/compare/4.0.0-beta.1...4.0.0-beta.2 632 647 [4.0.0-beta.1]: https://github.com/GlotPress/GlotPress/compare/4.0.0-alpha.11...4.0.0-beta.1 … … 793 808 [#1779]: https://github.com/GlotPress/GlotPress/pull/1779 794 809 [#1745]: https://github.com/GlotPress/GlotPress/pull/1745 810 [#1801]: https://github.com/GlotPress/GlotPress/pull/1801 811 [#1798]: https://github.com/GlotPress/GlotPress/pull/1798 812 [#1800]: https://github.com/GlotPress/GlotPress/pull/1800 813 [#1797]: https://github.com/GlotPress/GlotPress/pull/1797 814 [#1785]: https://github.com/GlotPress/GlotPress/pull/1785 815 [#1791]: https://github.com/GlotPress/GlotPress/pull/1791 816 [#1789]: https://github.com/GlotPress/GlotPress/pull/1789 817 [#1796]: https://github.com/GlotPress/GlotPress/pull/1796 818 [#1786]: https://github.com/GlotPress/GlotPress/pull/1786 819 [#1792]: https://github.com/GlotPress/GlotPress/pull/1792 -
glotpress/tags/4.0.0-beta.3/glotpress.php
r3027320 r3042570 4 4 * Plugin URI: https://wordpress.org/plugins/glotpress/ 5 5 * Description: GlotPress is a tool to help translators collaborate. 6 * Version: 4.0.0-beta. 26 * Version: 4.0.0-beta.3 7 7 * Requires at least: 4.6 8 8 * Tested up to: 6.4 … … 30 30 */ 31 31 32 define( 'GP_VERSION', '4.0.0-beta. 2' );32 define( 'GP_VERSION', '4.0.0-beta.3' ); 33 33 define( 'GP_DB_VERSION', '980' ); 34 34 define( 'GP_CACHE_VERSION', '3.0' ); -
glotpress/tags/4.0.0-beta.3/gp-includes/route.php
r2296035 r3042570 28 28 public function __construct() { 29 29 30 // Make sure that the current URL has a trailing slash. 31 add_action( 'gp_before_request', array( $this, 'check_uri_trailing_slash' ) ); 30 32 } 31 33 … … 358 360 return status_header( $status ); 359 361 } 362 363 /** 364 * Check if the current URL has trailing slash. If not, redirect to trailed slash URL. 365 * 366 * @since 4.0.0 367 */ 368 public function check_uri_trailing_slash() { 369 370 // Current URL. 371 $current_uri = wp_parse_url( gp_url_current() ); 372 373 // URL path. 374 $current_path = $current_uri['path']; 375 376 // If the current path has no trailing slash, redirect to path with trailing slash. 377 if ( trailingslashit( $current_path ) !== $current_path ) { 378 379 // Add trailing slash to redirect URL. 380 $redirect_url = trailingslashit( $current_path ); 381 382 // Include any existing query. 383 if ( isset( $current_uri['query'] ) ) { 384 $redirect_url .= '?' . $current_uri['query']; 385 } 386 387 // Redirect to URL with trailing slash. 388 $this->redirect( $redirect_url ); 389 } 390 } 360 391 } -
glotpress/tags/4.0.0-beta.3/gp-includes/template.php
r2785382 r3042570 254 254 $links[] = empty( $path_from_root ) ? __( 'Projects', 'glotpress' ) : gp_link_get( gp_url( '/projects' ), __( 'Projects', 'glotpress' ) ); 255 255 foreach ( $path_from_root as $project ) { 256 $links[] = gp_link_project_get( $project, esc_html( $project->name ) ); 256 if ( ! is_null( $project->id ) ) { 257 $links[] = gp_link_project_get( $project, esc_html( $project->name ) ); 258 } 257 259 } 258 260 return $links; 259 261 } 260 262 261 function gp_breadcrumb_project( $project ) { 262 return gp_breadcrumb( gp_project_links_from_root( $project ) ); 263 /** 264 * Get project breadcrumb. 265 * 266 * @since 4.0.0 New $extra_items array to append items like Translation Set, Project Glossary or the current action. The last item has no link. 267 * If project ID is '0', set base locales link to breadcrumb. 268 * 269 * @param GP_Project $project GlotPress Project object. 270 * @param array $extra_items Array of additional items to add to the breadcrumb. 271 * 272 * @return string HTML of the breadcrumb. 273 */ 274 function gp_breadcrumb_project( $project, $extra_items = array() ) { 275 276 // If is a translation project, get the links. If is a virtual project with ID '0' for glossary, return base Locale for breadcrumb. 277 $breadcrumb = 0 !== $project->id ? gp_project_links_from_root( $project ) : array( gp_link_get( gp_url( '/languages' ), __( 'Locales', 'glotpress' ) ) ); 278 279 // If no extra items, the last breadcrumb item is the project name with no link. 280 if ( empty( $extra_items ) ) { 281 end( $breadcrumb ); 282 $last_key = key( $breadcrumb ); 283 284 $breadcrumb[ $last_key ] = $project->name; 285 } 286 287 // Add extra items. 288 $breadcrumb = array_merge( $breadcrumb, $extra_items ); 289 return gp_breadcrumb( $breadcrumb ); 263 290 } 264 291 -
glotpress/tags/4.0.0-beta.3/gp-templates/glossary-delete.php
r2699206 r3042570 9 9 10 10 gp_title( __( 'Delete glossary < GlotPress', 'glotpress' ) ); 11 gp_breadcrumb( 11 gp_breadcrumb_project( 12 $project, 12 13 array( 13 gp_project_links_from_root( $project ),14 14 gp_link_get( gp_url_project_locale( $project->path, $locale->slug, $translation_set->slug ), $translation_set->name ), 15 gp_link_get( gp_url_join( gp_url_project_locale( $project->path, $locale->slug, $translation_set->slug ), '/glossary' ), __( 'Glossary', 'glotpress' ) ), 15 // Check if is Global or Project Glossary. 16 gp_link_get( gp_url_project_locale( $project->path, $locale->slug, $translation_set->slug ) . 'glossary', 0 === $project->id ? __( 'Locale Glossary', 'glotpress' ) : __( 'Project Glossary', 'glotpress' ), ), 16 17 __( 'Delete', 'glotpress' ), 17 18 ) -
glotpress/tags/4.0.0-beta.3/gp-templates/glossary-edit.php
r2699206 r3042570 1 1 <?php 2 gp_title( __( 'Edit Glossary < GlotPress', 'glotpress' ) ); 3 gp_breadcrumb( 2 gp_title( __( 'Edit glossary < GlotPress', 'glotpress' ) ); 3 gp_breadcrumb_project( 4 $project, 4 5 array( 5 gp_project_links_from_root( $project ),6 6 gp_link_get( gp_url_project_locale( $project->path, $locale->slug, $translation_set->slug ), $translation_set->name ), 7 gp_link_get( gp_url_project_locale( $project->path, $locale->slug, $translation_set->slug ) . '/glossary', __( 'Glossary', 'glotpress' ) ), 7 // Check if is Global or Project Glossary. 8 gp_link_get( gp_url_project_locale( $project->path, $locale->slug, $translation_set->slug ) . 'glossary', 0 === $project->id ? __( 'Locale Glossary', 'glotpress' ) : __( 'Project Glossary', 'glotpress' ), ), 8 9 __( 'Edit', 'glotpress' ), 9 10 ) … … 12 13 ?> 13 14 14 <h2><?php _e( 'Edit Glossary', 'glotpress' ); ?></h2>15 <h2><?php _e( 'Edit glossary', 'glotpress' ); ?></h2> 15 16 16 17 <form action="" method="post"> -
glotpress/tags/4.0.0-beta.3/gp-templates/glossary-import.php
r2785382 r3042570 1 1 <?php 2 2 gp_title( __( 'Import into Glossary < GlotPress', 'glotpress' ) ); 3 gp_breadcrumb( 3 gp_breadcrumb_project( 4 $project, 4 5 array( 5 gp_project_links_from_root( $project ),6 6 gp_link_get( gp_url_project_locale( $project->path, $locale->slug, $translation_set->slug ), $translation_set->name ), 7 gp_link_get( gp_url_project_locale( $project->path, $locale->slug, $translation_set->slug ) . '/glossary', __( 'Glossary', 'glotpress' ) ), 7 // Check if is Global or Project Glossary. 8 gp_link_get( gp_url_project_locale( $project->path, $locale->slug, $translation_set->slug ) . 'glossary', 0 === $project->id ? __( 'Locale Glossary', 'glotpress' ) : __( 'Project Glossary', 'glotpress' ), ), 8 9 __( 'Import', 'glotpress' ), 9 10 ) -
glotpress/tags/4.0.0-beta.3/gp-templates/glossary-new.php
r2699206 r3042570 1 1 <?php 2 2 gp_title( __( 'Create New Glossary < GlotPress', 'glotpress' ) ); 3 gp_breadcrumb( 3 gp_breadcrumb_project( 4 $project, 4 5 array( 5 gp_project_links_from_root( $project ),6 6 gp_link_get( gp_url_project_locale( $project->path, $locale->slug, $translation_set->slug ), $translation_set->name ), 7 __( 'Create Glossary', 'glotpress' ),7 __( 'Create New Glossary', 'glotpress' ), 8 8 ) 9 9 ); -
glotpress/tags/4.0.0-beta.3/gp-templates/glossary-view.php
r2979634 r3042570 1 1 <?php 2 2 gp_title( __( 'View Glossary < GlotPress', 'glotpress' ) ); 3 gp_breadcrumb( 3 gp_breadcrumb_project( 4 $project, 4 5 array( 5 6 // Show Projects if is projects path, show Locales if is locales path. 6 gp_project_links_from_root( $project ) ? gp_project_links_from_root( $project ) : gp_link_get( gp_url( '/languages' ), __( 'Locales', 'glotpress' ) ),7 7 gp_link_get( gp_url_project_locale( $project->path, $locale->slug, $translation_set->slug ), $translation_set->name ), 8 8 0 === $project->id ? __( 'Locale Glossary', 'glotpress' ) : __( 'Project Glossary', 'glotpress' ), -
glotpress/tags/4.0.0-beta.3/gp-templates/helper-functions.php
r3027320 r3042570 409 409 $suffixes = array_filter( $suffixes, fn( $value ) => ! empty( $value ) ); 410 410 411 // Add suffixes for part_of_speech with rules. 411 412 if ( ! empty( $suffixes[ $type ] ) ) { 412 413 // Loop through rules. … … 463 464 } 464 465 } 466 } else { 467 // Add match for part_of_speech without any suffix rules. 468 $glossary_entries_suffixes[ $term ] = array(); 465 469 } 466 470 } … … 545 549 } 546 550 } 551 // Make the regex more deterministic. 552 ksort( $regex_group ); 547 553 548 554 // Build the regular expression. -
glotpress/tags/4.0.0-beta.3/gp-templates/project-branch.php
r2699206 r3042570 7 7 ) 8 8 ); 9 gp_breadcrumb_project( $project ); 9 gp_breadcrumb_project( 10 $project, 11 array( 12 __( 'Branch', 'glotpress' ), 13 ) 14 ); 10 15 gp_tmpl_header(); 11 16 ?> -
glotpress/tags/4.0.0-beta.3/gp-templates/project-delete.php
r2699206 r3042570 15 15 ) 16 16 ); 17 gp_breadcrumb_project( $project ); 17 gp_breadcrumb_project( 18 $project, 19 array( 20 __( 'Delete', 'glotpress' ), 21 ) 22 ); 18 23 gp_tmpl_header(); 19 24 ?> -
glotpress/tags/4.0.0-beta.3/gp-templates/project-edit.php
r2699206 r3042570 7 7 ) 8 8 ); 9 gp_breadcrumb_project( $project ); 9 gp_breadcrumb_project( 10 $project, 11 array( 12 __( 'Edit', 'glotpress' ), 13 ) 14 ); 10 15 gp_tmpl_header(); 11 16 ?> -
glotpress/tags/4.0.0-beta.3/gp-templates/project-import.php
r3026779 r3042570 7 7 ); 8 8 $return_link = gp_url_project( $project ); 9 gp_breadcrumb_project( $project ); 9 gp_breadcrumb_project( 10 $project, 11 array( 12 __( 'Import Originals', 'glotpress' ), 13 ) 14 ); 10 15 } else { 11 16 $gp_title = sprintf( … … 15 20 ); 16 21 $return_link = gp_url_project_locale( $project, $locale->slug, $translation_set->slug ); 17 gp_breadcrumb( 22 gp_breadcrumb_project( 23 $project, 18 24 array( 19 gp_project_links_from_root( $project ),20 25 gp_link_get( $return_link, $translation_set->name ), 26 __( 'Import Translations', 'glotpress' ), 21 27 ) 22 28 ); -
glotpress/tags/4.0.0-beta.3/gp-templates/project-mass-create-sets.php
r2699206 r3042570 7 7 ) 8 8 ); 9 gp_breadcrumb_project( $project ); 9 gp_breadcrumb_project( 10 $project, 11 array( 12 __( 'Mass-create Translation Sets', 'glotpress' ), 13 ) 14 ); 10 15 gp_enqueue_scripts( 'gp-mass-create-sets-page' ); 11 16 wp_localize_script( -
glotpress/tags/4.0.0-beta.3/gp-templates/project-new.php
r2699206 r3042570 1 1 <?php 2 2 gp_title( __( 'Create New Project < GlotPress', 'glotpress' ) ); 3 gp_breadcrumb( 3 gp_breadcrumb_project( 4 $project, 4 5 array( 5 6 __( 'Create New Project', 'glotpress' ), -
glotpress/tags/4.0.0-beta.3/gp-templates/project-permissions.php
r2699206 r3042570 7 7 ) 8 8 ); 9 gp_breadcrumb_project( $project ); 9 gp_breadcrumb_project( 10 $project, 11 array( 12 __( 'Permissions', 'glotpress' ), 13 ) 14 ); 10 15 gp_tmpl_header(); 11 16 ?> -
glotpress/tags/4.0.0-beta.3/gp-templates/translation-set-delete.php
r2699206 r3042570 16 16 ) 17 17 ); 18 gp_breadcrumb( 18 gp_breadcrumb_project( 19 $project, 19 20 array( 20 gp_ project_links_from_root( $project),21 gp_link_get( $url, $locale->english_name . ( 'default' !== $set->slug ? ' ' . $set->name : '' )),21 gp_link_get( $url, $locale->english_name . 'default' !== $set->slug ? ' ' . $set->name : '' ), 22 __( 'Delete', 'glotpress' ), 22 23 ) 23 24 ); -
glotpress/tags/4.0.0-beta.3/gp-templates/translation-set-edit.php
r2699206 r3042570 8 8 ) 9 9 ); 10 gp_breadcrumb( 10 gp_breadcrumb_project( 11 $project, 11 12 array( 12 gp_project_links_from_root( $project ),13 13 gp_link_get( $url, $locale->english_name . 'default' !== $set->slug ? ' ' . $set->name : '' ), 14 __( 'Edit', 'glotpress' ), 14 15 ) 15 16 ); -
glotpress/tags/4.0.0-beta.3/gp-templates/translation-set-new.php
r2699206 r3042570 1 1 <?php 2 2 gp_title( __( 'Create New Translation Set < GlotPress', 'glotpress' ) ); 3 $project ? gp_breadcrumb_project( $project ) : gp_breadcrumb( array( __( 'New Translation Set', 'glotpress' ) ) ); 3 if ( $project ) { 4 gp_breadcrumb_project( 5 $project, 6 array( 7 __( 'Create New Translation Set', 'glotpress' ), 8 ) 9 ); 10 } else { 11 gp_breadcrumb( 12 array( 13 __( 'Create New Translation Set', 'glotpress' ), 14 ) 15 ); 16 } 4 17 5 18 // jQuery is required for the 'translation-set-form' template. -
glotpress/tags/4.0.0-beta.3/gp-templates/translations.php
r3026779 r3042570 21 21 $inactive_bubble = ' <span class="inactive bubble">' . __( 'Inactive', 'glotpress' ) . '</span>'; 22 22 } 23 24 gp_breadcrumb( 23 gp_breadcrumb_project( 24 $project, 25 25 array( 26 gp_project_links_from_root( $project ), 27 gp_link_get( $url, $translation_set->name ) . $inactive_bubble, 26 $translation_set->name . $inactive_bubble, 28 27 ) 29 28 ); … … 430 429 431 430 <?php $class_rtl = 'rtl' === $locale->text_direction ? ' translation-sets-rtl' : ''; ?> 431 <?php 432 /** 433 * Fires before the translation table has been displayed. 434 * 435 * @since 4.0.0 436 * 437 * @param array $def_vars Variables defined in the template. 438 */ 439 do_action( 'gp_before_translation_table', get_defined_vars() ); 440 ?> 432 441 <table id="translations" class="<?php echo esc_attr( apply_filters( 'gp_translation_table_classes', 'gp-table translations ' . $class_rtl, get_defined_vars() ) ); ?>"> 433 442 <thead> -
glotpress/trunk/CHANGELOG.md
r3027320 r3042570 1 1 All notable changes to this project will be documented in this file. 2 2 This project adheres to [Semantic Versioning](http://semver.org/). 3 4 ## [4.0.0-beta.3] (February 28, 2024) 5 6 **Features** 7 * Add a 'gp_before_translation_table' hook ([#1792]) 8 9 **Bugfixes** 10 11 * Add trailing slash to current_url to fix matching URLs without trailing slash ([#1785]) 12 * Breadcrumbs: Improve consistency across all content types ([#1789]) 13 * Glossary: Match single word entries of parts of speech that have no suffix rules. ([#1791]) 14 * Fix redirecting URL with query args ([#1797]) 15 * Add the breadcrumbs for the "New project" actions ([#1800]) 16 * Make the glossary regex more deterministic ([#1801]) 3 17 4 18 ## [4.0.0-beta.2] (January 26, 2024) … … 629 643 630 644 [Unreleased]: https://github.com/GlotPress/GlotPress/compare/3.0.0...HEAD 645 [4.0.0-beta.3]: https://github.com/GlotPress/GlotPress/compare/4.0.0-beta.2...4.0.0-beta.3 631 646 [4.0.0-beta.2]: https://github.com/GlotPress/GlotPress/compare/4.0.0-beta.1...4.0.0-beta.2 632 647 [4.0.0-beta.1]: https://github.com/GlotPress/GlotPress/compare/4.0.0-alpha.11...4.0.0-beta.1 … … 793 808 [#1779]: https://github.com/GlotPress/GlotPress/pull/1779 794 809 [#1745]: https://github.com/GlotPress/GlotPress/pull/1745 810 [#1801]: https://github.com/GlotPress/GlotPress/pull/1801 811 [#1798]: https://github.com/GlotPress/GlotPress/pull/1798 812 [#1800]: https://github.com/GlotPress/GlotPress/pull/1800 813 [#1797]: https://github.com/GlotPress/GlotPress/pull/1797 814 [#1785]: https://github.com/GlotPress/GlotPress/pull/1785 815 [#1791]: https://github.com/GlotPress/GlotPress/pull/1791 816 [#1789]: https://github.com/GlotPress/GlotPress/pull/1789 817 [#1796]: https://github.com/GlotPress/GlotPress/pull/1796 818 [#1786]: https://github.com/GlotPress/GlotPress/pull/1786 819 [#1792]: https://github.com/GlotPress/GlotPress/pull/1792 -
glotpress/trunk/glotpress.php
r3027320 r3042570 4 4 * Plugin URI: https://wordpress.org/plugins/glotpress/ 5 5 * Description: GlotPress is a tool to help translators collaborate. 6 * Version: 4.0.0-beta. 26 * Version: 4.0.0-beta.3 7 7 * Requires at least: 4.6 8 8 * Tested up to: 6.4 … … 30 30 */ 31 31 32 define( 'GP_VERSION', '4.0.0-beta. 2' );32 define( 'GP_VERSION', '4.0.0-beta.3' ); 33 33 define( 'GP_DB_VERSION', '980' ); 34 34 define( 'GP_CACHE_VERSION', '3.0' ); -
glotpress/trunk/gp-includes/route.php
r2296035 r3042570 28 28 public function __construct() { 29 29 30 // Make sure that the current URL has a trailing slash. 31 add_action( 'gp_before_request', array( $this, 'check_uri_trailing_slash' ) ); 30 32 } 31 33 … … 358 360 return status_header( $status ); 359 361 } 362 363 /** 364 * Check if the current URL has trailing slash. If not, redirect to trailed slash URL. 365 * 366 * @since 4.0.0 367 */ 368 public function check_uri_trailing_slash() { 369 370 // Current URL. 371 $current_uri = wp_parse_url( gp_url_current() ); 372 373 // URL path. 374 $current_path = $current_uri['path']; 375 376 // If the current path has no trailing slash, redirect to path with trailing slash. 377 if ( trailingslashit( $current_path ) !== $current_path ) { 378 379 // Add trailing slash to redirect URL. 380 $redirect_url = trailingslashit( $current_path ); 381 382 // Include any existing query. 383 if ( isset( $current_uri['query'] ) ) { 384 $redirect_url .= '?' . $current_uri['query']; 385 } 386 387 // Redirect to URL with trailing slash. 388 $this->redirect( $redirect_url ); 389 } 390 } 360 391 } -
glotpress/trunk/gp-includes/template.php
r2785382 r3042570 254 254 $links[] = empty( $path_from_root ) ? __( 'Projects', 'glotpress' ) : gp_link_get( gp_url( '/projects' ), __( 'Projects', 'glotpress' ) ); 255 255 foreach ( $path_from_root as $project ) { 256 $links[] = gp_link_project_get( $project, esc_html( $project->name ) ); 256 if ( ! is_null( $project->id ) ) { 257 $links[] = gp_link_project_get( $project, esc_html( $project->name ) ); 258 } 257 259 } 258 260 return $links; 259 261 } 260 262 261 function gp_breadcrumb_project( $project ) { 262 return gp_breadcrumb( gp_project_links_from_root( $project ) ); 263 /** 264 * Get project breadcrumb. 265 * 266 * @since 4.0.0 New $extra_items array to append items like Translation Set, Project Glossary or the current action. The last item has no link. 267 * If project ID is '0', set base locales link to breadcrumb. 268 * 269 * @param GP_Project $project GlotPress Project object. 270 * @param array $extra_items Array of additional items to add to the breadcrumb. 271 * 272 * @return string HTML of the breadcrumb. 273 */ 274 function gp_breadcrumb_project( $project, $extra_items = array() ) { 275 276 // If is a translation project, get the links. If is a virtual project with ID '0' for glossary, return base Locale for breadcrumb. 277 $breadcrumb = 0 !== $project->id ? gp_project_links_from_root( $project ) : array( gp_link_get( gp_url( '/languages' ), __( 'Locales', 'glotpress' ) ) ); 278 279 // If no extra items, the last breadcrumb item is the project name with no link. 280 if ( empty( $extra_items ) ) { 281 end( $breadcrumb ); 282 $last_key = key( $breadcrumb ); 283 284 $breadcrumb[ $last_key ] = $project->name; 285 } 286 287 // Add extra items. 288 $breadcrumb = array_merge( $breadcrumb, $extra_items ); 289 return gp_breadcrumb( $breadcrumb ); 263 290 } 264 291 -
glotpress/trunk/gp-templates/glossary-delete.php
r2699206 r3042570 9 9 10 10 gp_title( __( 'Delete glossary < GlotPress', 'glotpress' ) ); 11 gp_breadcrumb( 11 gp_breadcrumb_project( 12 $project, 12 13 array( 13 gp_project_links_from_root( $project ),14 14 gp_link_get( gp_url_project_locale( $project->path, $locale->slug, $translation_set->slug ), $translation_set->name ), 15 gp_link_get( gp_url_join( gp_url_project_locale( $project->path, $locale->slug, $translation_set->slug ), '/glossary' ), __( 'Glossary', 'glotpress' ) ), 15 // Check if is Global or Project Glossary. 16 gp_link_get( gp_url_project_locale( $project->path, $locale->slug, $translation_set->slug ) . 'glossary', 0 === $project->id ? __( 'Locale Glossary', 'glotpress' ) : __( 'Project Glossary', 'glotpress' ), ), 16 17 __( 'Delete', 'glotpress' ), 17 18 ) -
glotpress/trunk/gp-templates/glossary-edit.php
r2699206 r3042570 1 1 <?php 2 gp_title( __( 'Edit Glossary < GlotPress', 'glotpress' ) ); 3 gp_breadcrumb( 2 gp_title( __( 'Edit glossary < GlotPress', 'glotpress' ) ); 3 gp_breadcrumb_project( 4 $project, 4 5 array( 5 gp_project_links_from_root( $project ),6 6 gp_link_get( gp_url_project_locale( $project->path, $locale->slug, $translation_set->slug ), $translation_set->name ), 7 gp_link_get( gp_url_project_locale( $project->path, $locale->slug, $translation_set->slug ) . '/glossary', __( 'Glossary', 'glotpress' ) ), 7 // Check if is Global or Project Glossary. 8 gp_link_get( gp_url_project_locale( $project->path, $locale->slug, $translation_set->slug ) . 'glossary', 0 === $project->id ? __( 'Locale Glossary', 'glotpress' ) : __( 'Project Glossary', 'glotpress' ), ), 8 9 __( 'Edit', 'glotpress' ), 9 10 ) … … 12 13 ?> 13 14 14 <h2><?php _e( 'Edit Glossary', 'glotpress' ); ?></h2>15 <h2><?php _e( 'Edit glossary', 'glotpress' ); ?></h2> 15 16 16 17 <form action="" method="post"> -
glotpress/trunk/gp-templates/glossary-import.php
r2785382 r3042570 1 1 <?php 2 2 gp_title( __( 'Import into Glossary < GlotPress', 'glotpress' ) ); 3 gp_breadcrumb( 3 gp_breadcrumb_project( 4 $project, 4 5 array( 5 gp_project_links_from_root( $project ),6 6 gp_link_get( gp_url_project_locale( $project->path, $locale->slug, $translation_set->slug ), $translation_set->name ), 7 gp_link_get( gp_url_project_locale( $project->path, $locale->slug, $translation_set->slug ) . '/glossary', __( 'Glossary', 'glotpress' ) ), 7 // Check if is Global or Project Glossary. 8 gp_link_get( gp_url_project_locale( $project->path, $locale->slug, $translation_set->slug ) . 'glossary', 0 === $project->id ? __( 'Locale Glossary', 'glotpress' ) : __( 'Project Glossary', 'glotpress' ), ), 8 9 __( 'Import', 'glotpress' ), 9 10 ) -
glotpress/trunk/gp-templates/glossary-new.php
r2699206 r3042570 1 1 <?php 2 2 gp_title( __( 'Create New Glossary < GlotPress', 'glotpress' ) ); 3 gp_breadcrumb( 3 gp_breadcrumb_project( 4 $project, 4 5 array( 5 gp_project_links_from_root( $project ),6 6 gp_link_get( gp_url_project_locale( $project->path, $locale->slug, $translation_set->slug ), $translation_set->name ), 7 __( 'Create Glossary', 'glotpress' ),7 __( 'Create New Glossary', 'glotpress' ), 8 8 ) 9 9 ); -
glotpress/trunk/gp-templates/glossary-view.php
r2979634 r3042570 1 1 <?php 2 2 gp_title( __( 'View Glossary < GlotPress', 'glotpress' ) ); 3 gp_breadcrumb( 3 gp_breadcrumb_project( 4 $project, 4 5 array( 5 6 // Show Projects if is projects path, show Locales if is locales path. 6 gp_project_links_from_root( $project ) ? gp_project_links_from_root( $project ) : gp_link_get( gp_url( '/languages' ), __( 'Locales', 'glotpress' ) ),7 7 gp_link_get( gp_url_project_locale( $project->path, $locale->slug, $translation_set->slug ), $translation_set->name ), 8 8 0 === $project->id ? __( 'Locale Glossary', 'glotpress' ) : __( 'Project Glossary', 'glotpress' ), -
glotpress/trunk/gp-templates/helper-functions.php
r3027320 r3042570 409 409 $suffixes = array_filter( $suffixes, fn( $value ) => ! empty( $value ) ); 410 410 411 // Add suffixes for part_of_speech with rules. 411 412 if ( ! empty( $suffixes[ $type ] ) ) { 412 413 // Loop through rules. … … 463 464 } 464 465 } 466 } else { 467 // Add match for part_of_speech without any suffix rules. 468 $glossary_entries_suffixes[ $term ] = array(); 465 469 } 466 470 } … … 545 549 } 546 550 } 551 // Make the regex more deterministic. 552 ksort( $regex_group ); 547 553 548 554 // Build the regular expression. -
glotpress/trunk/gp-templates/project-branch.php
r2699206 r3042570 7 7 ) 8 8 ); 9 gp_breadcrumb_project( $project ); 9 gp_breadcrumb_project( 10 $project, 11 array( 12 __( 'Branch', 'glotpress' ), 13 ) 14 ); 10 15 gp_tmpl_header(); 11 16 ?> -
glotpress/trunk/gp-templates/project-delete.php
r2699206 r3042570 15 15 ) 16 16 ); 17 gp_breadcrumb_project( $project ); 17 gp_breadcrumb_project( 18 $project, 19 array( 20 __( 'Delete', 'glotpress' ), 21 ) 22 ); 18 23 gp_tmpl_header(); 19 24 ?> -
glotpress/trunk/gp-templates/project-edit.php
r2699206 r3042570 7 7 ) 8 8 ); 9 gp_breadcrumb_project( $project ); 9 gp_breadcrumb_project( 10 $project, 11 array( 12 __( 'Edit', 'glotpress' ), 13 ) 14 ); 10 15 gp_tmpl_header(); 11 16 ?> -
glotpress/trunk/gp-templates/project-import.php
r3026779 r3042570 7 7 ); 8 8 $return_link = gp_url_project( $project ); 9 gp_breadcrumb_project( $project ); 9 gp_breadcrumb_project( 10 $project, 11 array( 12 __( 'Import Originals', 'glotpress' ), 13 ) 14 ); 10 15 } else { 11 16 $gp_title = sprintf( … … 15 20 ); 16 21 $return_link = gp_url_project_locale( $project, $locale->slug, $translation_set->slug ); 17 gp_breadcrumb( 22 gp_breadcrumb_project( 23 $project, 18 24 array( 19 gp_project_links_from_root( $project ),20 25 gp_link_get( $return_link, $translation_set->name ), 26 __( 'Import Translations', 'glotpress' ), 21 27 ) 22 28 ); -
glotpress/trunk/gp-templates/project-mass-create-sets.php
r2699206 r3042570 7 7 ) 8 8 ); 9 gp_breadcrumb_project( $project ); 9 gp_breadcrumb_project( 10 $project, 11 array( 12 __( 'Mass-create Translation Sets', 'glotpress' ), 13 ) 14 ); 10 15 gp_enqueue_scripts( 'gp-mass-create-sets-page' ); 11 16 wp_localize_script( -
glotpress/trunk/gp-templates/project-new.php
r2699206 r3042570 1 1 <?php 2 2 gp_title( __( 'Create New Project < GlotPress', 'glotpress' ) ); 3 gp_breadcrumb( 3 gp_breadcrumb_project( 4 $project, 4 5 array( 5 6 __( 'Create New Project', 'glotpress' ), -
glotpress/trunk/gp-templates/project-permissions.php
r2699206 r3042570 7 7 ) 8 8 ); 9 gp_breadcrumb_project( $project ); 9 gp_breadcrumb_project( 10 $project, 11 array( 12 __( 'Permissions', 'glotpress' ), 13 ) 14 ); 10 15 gp_tmpl_header(); 11 16 ?> -
glotpress/trunk/gp-templates/translation-set-delete.php
r2699206 r3042570 16 16 ) 17 17 ); 18 gp_breadcrumb( 18 gp_breadcrumb_project( 19 $project, 19 20 array( 20 gp_ project_links_from_root( $project),21 gp_link_get( $url, $locale->english_name . ( 'default' !== $set->slug ? ' ' . $set->name : '' )),21 gp_link_get( $url, $locale->english_name . 'default' !== $set->slug ? ' ' . $set->name : '' ), 22 __( 'Delete', 'glotpress' ), 22 23 ) 23 24 ); -
glotpress/trunk/gp-templates/translation-set-edit.php
r2699206 r3042570 8 8 ) 9 9 ); 10 gp_breadcrumb( 10 gp_breadcrumb_project( 11 $project, 11 12 array( 12 gp_project_links_from_root( $project ),13 13 gp_link_get( $url, $locale->english_name . 'default' !== $set->slug ? ' ' . $set->name : '' ), 14 __( 'Edit', 'glotpress' ), 14 15 ) 15 16 ); -
glotpress/trunk/gp-templates/translation-set-new.php
r2699206 r3042570 1 1 <?php 2 2 gp_title( __( 'Create New Translation Set < GlotPress', 'glotpress' ) ); 3 $project ? gp_breadcrumb_project( $project ) : gp_breadcrumb( array( __( 'New Translation Set', 'glotpress' ) ) ); 3 if ( $project ) { 4 gp_breadcrumb_project( 5 $project, 6 array( 7 __( 'Create New Translation Set', 'glotpress' ), 8 ) 9 ); 10 } else { 11 gp_breadcrumb( 12 array( 13 __( 'Create New Translation Set', 'glotpress' ), 14 ) 15 ); 16 } 4 17 5 18 // jQuery is required for the 'translation-set-form' template. -
glotpress/trunk/gp-templates/translations.php
r3026779 r3042570 21 21 $inactive_bubble = ' <span class="inactive bubble">' . __( 'Inactive', 'glotpress' ) . '</span>'; 22 22 } 23 24 gp_breadcrumb( 23 gp_breadcrumb_project( 24 $project, 25 25 array( 26 gp_project_links_from_root( $project ), 27 gp_link_get( $url, $translation_set->name ) . $inactive_bubble, 26 $translation_set->name . $inactive_bubble, 28 27 ) 29 28 ); … … 430 429 431 430 <?php $class_rtl = 'rtl' === $locale->text_direction ? ' translation-sets-rtl' : ''; ?> 431 <?php 432 /** 433 * Fires before the translation table has been displayed. 434 * 435 * @since 4.0.0 436 * 437 * @param array $def_vars Variables defined in the template. 438 */ 439 do_action( 'gp_before_translation_table', get_defined_vars() ); 440 ?> 432 441 <table id="translations" class="<?php echo esc_attr( apply_filters( 'gp_translation_table_classes', 'gp-table translations ' . $class_rtl, get_defined_vars() ) ); ?>"> 433 442 <thead>
Note: See TracChangeset
for help on using the changeset viewer.