Plugin Directory

Changeset 3027320


Ignore:
Timestamp:
01/26/2024 11:42:04 AM (2 years ago)
Author:
glotpress
Message:

Update to version 4.0.0-beta.2 from GitHub

Location:
glotpress
Files:
16 deleted
10 edited
1 copied

Legend:

Unmodified
Added
Removed
  • glotpress/tags/4.0.0-beta.2/CHANGELOG.md

    r3026779 r3027320  
    11All notable changes to this project will be documented in this file.
    22This project adheres to [Semantic Versioning](http://semver.org/).
     3
     4## [4.0.0-beta.2] (January 26, 2024)
     5
     6**Bugfixes**
     7
     8* Solve some warnings with the glossary suffixes ([#1779])
     9* Remove Tour code in favor of using the dedicated Tour plugin ([#1745])
    310
    411## [4.0.0-beta.1] (January 25, 2024)
     
    622629
    623630[Unreleased]: https://github.com/GlotPress/GlotPress/compare/3.0.0...HEAD
     631[4.0.0-beta.2]: https://github.com/GlotPress/GlotPress/compare/4.0.0-beta.1...4.0.0-beta.2
    624632[4.0.0-beta.1]: https://github.com/GlotPress/GlotPress/compare/4.0.0-alpha.11...4.0.0-beta.1
    625633[4.0.0-alpha.11]: https://github.com/GlotPress/GlotPress/compare/4.0.0-alpha.10...4.0.0-alpha.11
     
    783791[#1730]: https://github.com/GlotPress/GlotPress/pull/1730
    784792[#1729]: https://github.com/GlotPress/GlotPress/pull/1729
    785 
     793[#1779]: https://github.com/GlotPress/GlotPress/pull/1779
     794[#1745]: https://github.com/GlotPress/GlotPress/pull/1745
  • glotpress/tags/4.0.0-beta.2/glotpress.php

    r3026779 r3027320  
    44 * Plugin URI: https://wordpress.org/plugins/glotpress/
    55 * Description: GlotPress is a tool to help translators collaborate.
    6  * Version: 4.0.0-beta.1
     6 * Version: 4.0.0-beta.2
    77 * Requires at least: 4.6
    8  * Tested up to: 5.9
     8 * Tested up to: 6.4
    99 * Requires PHP: 7.4
    1010 * Author: the GlotPress team
     
    3030 */
    3131
    32 define( 'GP_VERSION', '4.0.0-beta.1' );
     32define( 'GP_VERSION', '4.0.0-beta.2' );
    3333define( 'GP_DB_VERSION', '980' );
    3434define( 'GP_CACHE_VERSION', '3.0' );
  • glotpress/tags/4.0.0-beta.2/gp-includes/assets-loader.php

    r2979634 r3027320  
    1717    // Register our base style.
    1818    wp_register_style( 'gp-base', $url . '/style' . $suffix, array(), filemtime( $path . 'style' . $suffix ) );
    19     wp_register_style( 'gp-jquery-webui-popover', $url . '/jquery.webui-popover' . $suffix, array( 'gp-base' ), filemtime( $path . 'jquery.webui-popover' . $suffix ) );
    20     wp_register_style( 'driver-js', $url . '/driver-js' . $suffix, array(), filemtime( $path . 'driver-js' . $suffix ) );
    2119}
    2220
     
    3836    wp_register_script( 'gp-translations-page', $url . '/translations-page' . $suffix, array( 'gp-editor' ), filemtime( $path . 'translations-page' . $suffix ) );
    3937    wp_register_script( 'gp-mass-create-sets-page', $url . '/mass-create-sets-page' . $suffix, array( 'gp-editor' ), filemtime( $path . 'mass-create-sets-page' . $suffix ) );
    40     wp_register_script( 'gp-jquery-webui-popover', $url . '/jquery.webui-popover' . $suffix, array( 'jquery' ), filemtime( $path . 'jquery.webui-popover' . $suffix ), false );
    41     wp_register_script( 'driver-js', $url . '/driver-js' . $suffix, array(), filemtime( $path . 'driver-js' . $suffix ) );
    42     wp_register_script( 'gp-tour', $url . '/tour' . $suffix, array( 'jquery', 'gp-jquery-webui-popover', 'driver-js' ), filemtime( $path . 'tour' . $suffix ), false );
    43 
    4438    wp_set_script_translations( 'gp-common', 'glotpress' );
    4539    wp_set_script_translations( 'gp-editor', 'glotpress' );
    4640    wp_set_script_translations( 'gp-glossary', 'glotpress' );
    4741    wp_set_script_translations( 'gp-mass-create-sets-page', 'glotpress' );
    48     wp_set_script_translations( 'gp-tour', 'glotpress' );
    49 
    50     wp_localize_script( 'gp-tour', 'gp_tour', apply_filters( 'gp_tour', array() ) );
    5142}
    5243
  • glotpress/tags/4.0.0-beta.2/gp-templates/header.php

    r2979634 r3027320  
    77    <?php
    88    // Enqueue the base style so we don't have to load it manually on each page.
    9     gp_enqueue_styles( array( 'gp-base', 'driver-js' ) );
    10     gp_enqueue_scripts( array( 'gp-tour', 'driver-js' ) );
     9    gp_enqueue_styles( array( 'gp-base' ) );
    1110
    1211    gp_head();
  • glotpress/tags/4.0.0-beta.2/gp-templates/helper-functions.php

    r3026779 r3027320  
    406406        }
    407407
    408         // Loop through rules.
    409         foreach ( $suffixes[ $type ] as $rule ) {
    410 
    411             // Loop through rule endings.
    412             foreach ( $rule['endings'] as $ending_pattern => $new_ending ) {
    413 
    414                 // Check if noun ends with known suffix.
    415                 if ( preg_match( '/' . $rule['preceded'] . $ending_pattern . '\b/i', $term, $match ) ) {
    416 
    417                     // Set ending.
    418                     $old_ending = preg_replace( '/^' . $rule['preceded'] . '/', '', $match[0] );
    419 
    420                     // Format endings using %s or %1$s placeholders to allow using the ending itself in the changing string.
    421                     // Eg.: '%1$s%1$s' to match 'Commi[t]' -> Commi[tt][ing]
    422                     $new_ending = sprintf(
    423                         $new_ending,
    424                         $old_ending
    425                     );
    426 
    427                     $change_ending = $old_ending === $new_ending ? false : true;
    428 
    429                     // Build suffix with changes and additions.
    430                     $suffix = ( ! $change_ending ? '' : $new_ending ) . $rule['add'];
    431 
    432                     // Set key term.
    433                     $key = $change_ending ? substr( $term, 0, - strlen( $old_ending ) ) : $term;
    434 
    435                     // Check if key term is set.
    436                     if ( ! isset( $glossary_entries_suffixes[ $key ] ) ) {
    437                         // Add the key term with empty array.
    438                         $glossary_entries_suffixes[ $key ] = array();
     408        // Filter out suffixes with empty values.
     409        $suffixes = array_filter( $suffixes, fn( $value ) => ! empty( $value ) );
     410
     411        if ( ! empty( $suffixes[ $type ] ) ) {
     412            // Loop through rules.
     413            foreach ( $suffixes[ $type ] as $rule ) {
     414
     415                // Loop through rule endings.
     416                foreach ( $rule['endings'] as $ending_pattern => $new_ending ) {
     417
     418                    // Check if noun ends with known suffix.
     419                    if ( preg_match( '/' . $rule['preceded'] . $ending_pattern . '\b/i', $term, $match ) ) {
     420
     421                        // Set ending.
     422                        $old_ending = preg_replace( '/^' . $rule['preceded'] . '/', '', $match[0] );
     423
     424                        // Format endings using %s or %1$s placeholders to allow using the ending itself in the changing string.
     425                        // Eg.: '%1$s%1$s' to match 'Commi[t]' -> Commi[tt][ing]
     426                        $new_ending = sprintf(
     427                            $new_ending,
     428                            $old_ending
     429                        );
     430
     431                        $change_ending = $old_ending === $new_ending ? false : true;
     432
     433                        // Build suffix with changes and additions.
     434                        $suffix = ( ! $change_ending ? '' : $new_ending ) . $rule['add'];
     435
     436                        // Set key term.
     437                        $key = $change_ending ? substr( $term, 0, -strlen( $old_ending ) ) : $term;
     438
     439                        // Check if key term is set.
     440                        if ( ! isset( $glossary_entries_suffixes[ $key ] ) ) {
     441                            // Add the key term with empty array.
     442                            $glossary_entries_suffixes[ $key ] = array();
     443                        }
     444
     445                        // If the ending changes, also add the ending.
     446                        if ( $change_ending ) {
     447
     448                            // Check if ending already exist in array of suffixes.
     449                            if ( ! in_array( $old_ending, $glossary_entries_suffixes[ $key ], true ) ) {
     450                                // Add the ending to the suffixes.
     451                                $glossary_entries_suffixes[ $key ][] = $old_ending;
     452                            }
     453                        }
     454
     455                        // Check if suffix already exist in array of suffixes.
     456                        if ( ! in_array( $suffix, $glossary_entries_suffixes[ $key ], true ) ) {
     457                            // Add suffix.
     458                            $glossary_entries_suffixes[ $key ][] = $suffix;
     459                        }
     460
     461                        break;
    439462                    }
    440 
    441                     // If the ending changes, also add the ending.
    442                     if ( $change_ending ) {
    443 
    444                         // Check if ending already exist in array of suffixes.
    445                         if ( ! in_array( $old_ending, $glossary_entries_suffixes[ $key ], true ) ) {
    446                             // Add the ending to the suffixes.
    447                             $glossary_entries_suffixes[ $key ][] = $old_ending;
    448                         }
    449                     }
    450 
    451                     // Check if suffix already exist in array of suffixes.
    452                     if ( ! in_array( $suffix, $glossary_entries_suffixes[ $key ], true ) ) {
    453                         // Add suffix.
    454                         $glossary_entries_suffixes[ $key ][] = $suffix;
    455                     }
    456 
    457                     break;
    458463                }
    459464            }
  • glotpress/trunk/CHANGELOG.md

    r3026779 r3027320  
    11All notable changes to this project will be documented in this file.
    22This project adheres to [Semantic Versioning](http://semver.org/).
     3
     4## [4.0.0-beta.2] (January 26, 2024)
     5
     6**Bugfixes**
     7
     8* Solve some warnings with the glossary suffixes ([#1779])
     9* Remove Tour code in favor of using the dedicated Tour plugin ([#1745])
    310
    411## [4.0.0-beta.1] (January 25, 2024)
     
    622629
    623630[Unreleased]: https://github.com/GlotPress/GlotPress/compare/3.0.0...HEAD
     631[4.0.0-beta.2]: https://github.com/GlotPress/GlotPress/compare/4.0.0-beta.1...4.0.0-beta.2
    624632[4.0.0-beta.1]: https://github.com/GlotPress/GlotPress/compare/4.0.0-alpha.11...4.0.0-beta.1
    625633[4.0.0-alpha.11]: https://github.com/GlotPress/GlotPress/compare/4.0.0-alpha.10...4.0.0-alpha.11
     
    783791[#1730]: https://github.com/GlotPress/GlotPress/pull/1730
    784792[#1729]: https://github.com/GlotPress/GlotPress/pull/1729
    785 
     793[#1779]: https://github.com/GlotPress/GlotPress/pull/1779
     794[#1745]: https://github.com/GlotPress/GlotPress/pull/1745
  • glotpress/trunk/glotpress.php

    r3026779 r3027320  
    44 * Plugin URI: https://wordpress.org/plugins/glotpress/
    55 * Description: GlotPress is a tool to help translators collaborate.
    6  * Version: 4.0.0-beta.1
     6 * Version: 4.0.0-beta.2
    77 * Requires at least: 4.6
    8  * Tested up to: 5.9
     8 * Tested up to: 6.4
    99 * Requires PHP: 7.4
    1010 * Author: the GlotPress team
     
    3030 */
    3131
    32 define( 'GP_VERSION', '4.0.0-beta.1' );
     32define( 'GP_VERSION', '4.0.0-beta.2' );
    3333define( 'GP_DB_VERSION', '980' );
    3434define( 'GP_CACHE_VERSION', '3.0' );
  • glotpress/trunk/gp-includes/assets-loader.php

    r2979634 r3027320  
    1717    // Register our base style.
    1818    wp_register_style( 'gp-base', $url . '/style' . $suffix, array(), filemtime( $path . 'style' . $suffix ) );
    19     wp_register_style( 'gp-jquery-webui-popover', $url . '/jquery.webui-popover' . $suffix, array( 'gp-base' ), filemtime( $path . 'jquery.webui-popover' . $suffix ) );
    20     wp_register_style( 'driver-js', $url . '/driver-js' . $suffix, array(), filemtime( $path . 'driver-js' . $suffix ) );
    2119}
    2220
     
    3836    wp_register_script( 'gp-translations-page', $url . '/translations-page' . $suffix, array( 'gp-editor' ), filemtime( $path . 'translations-page' . $suffix ) );
    3937    wp_register_script( 'gp-mass-create-sets-page', $url . '/mass-create-sets-page' . $suffix, array( 'gp-editor' ), filemtime( $path . 'mass-create-sets-page' . $suffix ) );
    40     wp_register_script( 'gp-jquery-webui-popover', $url . '/jquery.webui-popover' . $suffix, array( 'jquery' ), filemtime( $path . 'jquery.webui-popover' . $suffix ), false );
    41     wp_register_script( 'driver-js', $url . '/driver-js' . $suffix, array(), filemtime( $path . 'driver-js' . $suffix ) );
    42     wp_register_script( 'gp-tour', $url . '/tour' . $suffix, array( 'jquery', 'gp-jquery-webui-popover', 'driver-js' ), filemtime( $path . 'tour' . $suffix ), false );
    43 
    4438    wp_set_script_translations( 'gp-common', 'glotpress' );
    4539    wp_set_script_translations( 'gp-editor', 'glotpress' );
    4640    wp_set_script_translations( 'gp-glossary', 'glotpress' );
    4741    wp_set_script_translations( 'gp-mass-create-sets-page', 'glotpress' );
    48     wp_set_script_translations( 'gp-tour', 'glotpress' );
    49 
    50     wp_localize_script( 'gp-tour', 'gp_tour', apply_filters( 'gp_tour', array() ) );
    5142}
    5243
  • glotpress/trunk/gp-templates/header.php

    r2979634 r3027320  
    77    <?php
    88    // Enqueue the base style so we don't have to load it manually on each page.
    9     gp_enqueue_styles( array( 'gp-base', 'driver-js' ) );
    10     gp_enqueue_scripts( array( 'gp-tour', 'driver-js' ) );
     9    gp_enqueue_styles( array( 'gp-base' ) );
    1110
    1211    gp_head();
  • glotpress/trunk/gp-templates/helper-functions.php

    r3026779 r3027320  
    406406        }
    407407
    408         // Loop through rules.
    409         foreach ( $suffixes[ $type ] as $rule ) {
    410 
    411             // Loop through rule endings.
    412             foreach ( $rule['endings'] as $ending_pattern => $new_ending ) {
    413 
    414                 // Check if noun ends with known suffix.
    415                 if ( preg_match( '/' . $rule['preceded'] . $ending_pattern . '\b/i', $term, $match ) ) {
    416 
    417                     // Set ending.
    418                     $old_ending = preg_replace( '/^' . $rule['preceded'] . '/', '', $match[0] );
    419 
    420                     // Format endings using %s or %1$s placeholders to allow using the ending itself in the changing string.
    421                     // Eg.: '%1$s%1$s' to match 'Commi[t]' -> Commi[tt][ing]
    422                     $new_ending = sprintf(
    423                         $new_ending,
    424                         $old_ending
    425                     );
    426 
    427                     $change_ending = $old_ending === $new_ending ? false : true;
    428 
    429                     // Build suffix with changes and additions.
    430                     $suffix = ( ! $change_ending ? '' : $new_ending ) . $rule['add'];
    431 
    432                     // Set key term.
    433                     $key = $change_ending ? substr( $term, 0, - strlen( $old_ending ) ) : $term;
    434 
    435                     // Check if key term is set.
    436                     if ( ! isset( $glossary_entries_suffixes[ $key ] ) ) {
    437                         // Add the key term with empty array.
    438                         $glossary_entries_suffixes[ $key ] = array();
     408        // Filter out suffixes with empty values.
     409        $suffixes = array_filter( $suffixes, fn( $value ) => ! empty( $value ) );
     410
     411        if ( ! empty( $suffixes[ $type ] ) ) {
     412            // Loop through rules.
     413            foreach ( $suffixes[ $type ] as $rule ) {
     414
     415                // Loop through rule endings.
     416                foreach ( $rule['endings'] as $ending_pattern => $new_ending ) {
     417
     418                    // Check if noun ends with known suffix.
     419                    if ( preg_match( '/' . $rule['preceded'] . $ending_pattern . '\b/i', $term, $match ) ) {
     420
     421                        // Set ending.
     422                        $old_ending = preg_replace( '/^' . $rule['preceded'] . '/', '', $match[0] );
     423
     424                        // Format endings using %s or %1$s placeholders to allow using the ending itself in the changing string.
     425                        // Eg.: '%1$s%1$s' to match 'Commi[t]' -> Commi[tt][ing]
     426                        $new_ending = sprintf(
     427                            $new_ending,
     428                            $old_ending
     429                        );
     430
     431                        $change_ending = $old_ending === $new_ending ? false : true;
     432
     433                        // Build suffix with changes and additions.
     434                        $suffix = ( ! $change_ending ? '' : $new_ending ) . $rule['add'];
     435
     436                        // Set key term.
     437                        $key = $change_ending ? substr( $term, 0, -strlen( $old_ending ) ) : $term;
     438
     439                        // Check if key term is set.
     440                        if ( ! isset( $glossary_entries_suffixes[ $key ] ) ) {
     441                            // Add the key term with empty array.
     442                            $glossary_entries_suffixes[ $key ] = array();
     443                        }
     444
     445                        // If the ending changes, also add the ending.
     446                        if ( $change_ending ) {
     447
     448                            // Check if ending already exist in array of suffixes.
     449                            if ( ! in_array( $old_ending, $glossary_entries_suffixes[ $key ], true ) ) {
     450                                // Add the ending to the suffixes.
     451                                $glossary_entries_suffixes[ $key ][] = $old_ending;
     452                            }
     453                        }
     454
     455                        // Check if suffix already exist in array of suffixes.
     456                        if ( ! in_array( $suffix, $glossary_entries_suffixes[ $key ], true ) ) {
     457                            // Add suffix.
     458                            $glossary_entries_suffixes[ $key ][] = $suffix;
     459                        }
     460
     461                        break;
    439462                    }
    440 
    441                     // If the ending changes, also add the ending.
    442                     if ( $change_ending ) {
    443 
    444                         // Check if ending already exist in array of suffixes.
    445                         if ( ! in_array( $old_ending, $glossary_entries_suffixes[ $key ], true ) ) {
    446                             // Add the ending to the suffixes.
    447                             $glossary_entries_suffixes[ $key ][] = $old_ending;
    448                         }
    449                     }
    450 
    451                     // Check if suffix already exist in array of suffixes.
    452                     if ( ! in_array( $suffix, $glossary_entries_suffixes[ $key ], true ) ) {
    453                         // Add suffix.
    454                         $glossary_entries_suffixes[ $key ][] = $suffix;
    455                     }
    456 
    457                     break;
    458463                }
    459464            }
Note: See TracChangeset for help on using the changeset viewer.