Σ(゚Д゚;≡;゚д゚)Σ(゚Д゚;≡;゚д゚)Σ(゚Д゚;≡;゚д゚)始,故人唐宰相鲁公,🆚开府南服,余以布衣从戎。明年,别公漳水湄。后明年,公以事过张睢阳庙及颜杲卿所尝往来处,悲歌慷慨,卒不负其言而从之游。今其诗具在,可考也。😭 HEX
HEX
Server: Apache
System: Linux webm006.cluster120.gra.hosting.ovh.net 6.18.39-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Tue Jul 21 12:03:15 CEST 2026 x86_64
User: studionolh (122383)
PHP: 7.3.33
Disabled: _dyuweyrj4,_dyuweyrj4r,dl
Upload Files
File: /home/studionolh/www/wp-content/plugins/loco-translate/src/fs/LocaleFileList.php
<?php
/**
 * File list indexed by locale codes
 */
class Loco_fs_LocaleFileList extends Loco_fs_FileList {
    
    /**
     * Look up locale entries by their tag
     * @var array
     */
    private $index = [];
    
    
    /**
     * @return Loco_fs_LocaleFileList
     */
    public function addLocalized( Loco_fs_LocaleFile $file ){
        $i = count($this);
        $this->add( $file );
        if( count($this) !== $i ){
            if( $key = $file->getSuffix() ){
                $this->index[$key][] = $i;
            }
        }
        
        return $this;
    }
    


    /**
     * Get a new list containing just files for a given locale (exactly)
     * @return Loco_fs_LocaleFileList
     */
    public function filter( $tag ){
        $list = new Loco_fs_LocaleFileList;
        if( isset($this->index[$tag]) ){
            foreach( $this->index[$tag] as $i ){
                $list->addLocalized( $this[$i] );
            }
        }
        return $list;
    }    



    /**
     * Get a unique list of valid locales for which there are files
     * @return array<Loco_Locale>
     */
    public function getLocales(){
        $list = [];
        foreach( array_keys($this->index) as $tag ){
            $locale = Loco_Locale::parse($tag);
            if( $locale->isValid() ){
                $list[$tag] = $locale;
            }
        }
        return $list;
    }



    /**
     * {@inheritdoc}
     * @return Loco_fs_LocaleFileList
     */
    public function augment( Loco_fs_FileList $list ){
        foreach( $list as $file ){
            $this->addLocalized( $file );
        }
        return $this;
    }
    
}