Plugin Directory

Changeset 2174819


Ignore:
Timestamp:
10/17/2019 11:30:53 AM (6 years ago)
Author:
aucor
Message:

bugfix for plural translations

Location:
dynamic-mo-loader/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • dynamic-mo-loader/trunk/dynamic-mo-loader.php

    r2130572 r2174819  
    44Plugin URI: https://github.com/aucor/dynamic-mo-loader
    55Description: Better text domain loading with object cache support
    6 Version: 1.3.0
     6Version: 1.4.0
    77Author: Aucor Oy
    88Author URI:
  • dynamic-mo-loader/trunk/inc/mo_dynamic.php

    r2130572 r2174819  
    144144                wp_cache_replace( $key, $t, 'dymoloader1.0', $cache_time );
    145145            }
    146            
    147146            return json_decode( gzuncompress( $t['data'] ), true );
    148147        }
     
    167166            }
    168167        }
    169        
     168
    170169        if ( $this->translations === NULL ) {
    171170            $this->translations = array();
     
    404403                                $cmpval = strcmp( $key, $mo_original );
    405404
    406                             if ( $cmpval === 0 ) {
     405                            //if ( $cmpval === 0 ) {
    407406                                // key found, read translation string
    408407                                $moitem->reader->seekto( $moitem->translations_table[$pos+1] );
     
    414413                                }
    415414                                return $translation;
    416                             }
     415                            //}
    417416                        }
    418417                    }
     418
    419419                    if ($idx >= $moitem->hash_length - $incr)
    420420                        $idx -= ($moitem->hash_length - $incr);
     
    514514        if ( $context == NULL ) {
    515515            $s = $singular;
    516            
    517516        } else {
    518517            $s = $context . chr(4) . $singular;
     
    535534
    536535        if ( $t !== false ) {
    537             if ( false !== ( $i = strpos( $t, '0' ) ) ) {
     536            if ( false !== ( $i = strpos( $t, 0 ) ) ) {
    538537                if ( $count == 1 ) {
    539538                    return substr ( $t, '0', $i );
    540 
    541539                } else {
    542540                    // only one plural form is assumed - needs improvement
     
    565563                }
    566564            }
    567            
     565
    568566            foreach ( $other->MOs as $moitem ) {
    569567                $i = 0;
  • dynamic-mo-loader/trunk/readme.txt

    r2130572 r2174819  
    33Tags: WordPress, REST API, WP_Query
    44Requires at least: 4.7.3
    5 Tested up to: 4.9.8
     5Tested up to: 5.2.4
    66Requires PHP: 7.0
    77Stable tag: trunk
     
    2323
    2424== Changelog ==
     25= 1.4.0 =
     26* bugfix for plural translation
    2527= 1.3.0 =
    2628* unique function names, sanitized current_url and bugfix for translate function concatenating string with zero
Note: See TracChangeset for help on using the changeset viewer.