ACIL FM
Dark
Refresh
Current DIR:
/home/mhhtmff/www/site/wp-content/plugins/wpml-string-translation/classes/MO/File
/
home
mhhtmff
www
site
wp-content
plugins
wpml-string-translation
classes
MO
File
Upload
Zip Selected
Delete Selected
Pilih semua
Nama
Ukuran
Permission
Aksi
Builder.php
443 B
chmod
View
DL
Edit
Rename
Delete
FailureHooks.php
3.7 MB
chmod
View
DL
Edit
Rename
Delete
FailureHooksFactory.php
1.04 MB
chmod
View
DL
Edit
Rename
Delete
Generator.php
1.79 MB
chmod
View
DL
Edit
Rename
Delete
makeDir.php
637 B
chmod
View
DL
Edit
Rename
Delete
Manager.php
961 B
chmod
View
DL
Edit
Rename
Delete
ManagerFactory.php
282 B
chmod
View
DL
Edit
Rename
Delete
MOFactory.php
143 B
chmod
View
DL
Edit
Rename
Delete
Edit file: /home/mhhtmff/www/site/wp-content/plugins/wpml-string-translation/classes/MO/File/Generator.php
<?php namespace WPML\ST\MO\File; use WPML\Collect\Support\Collection; use WPML\ST\TranslateWpmlString; use WPML\ST\TranslationFile\StringEntity; use function wpml_collect; class Generator { /** @var MOFactory */ private $moFactory; public function __construct( MOFactory $moFactory ) { $this->moFactory = $moFactory; } /** * @param StringEntity[] $entries * * @return string */ public function getContent( array $entries ) { $mo = $this->moFactory->createNewInstance(); wpml_collect( $entries ) ->reduce( [ $this, 'createMOFormatEntities' ], wpml_collect( [] ) ) ->filter( function( array $entry ) { return ! empty($entry['singular']); } ) ->each( [ $mo, 'add_entry' ] ); $mem_file = fopen( 'php://memory', 'r+' ); if ( $mem_file === false ) { return ''; } $mo->export_to_file_handle( $mem_file ); rewind( $mem_file ); $mo_content = stream_get_contents( $mem_file ); fclose( $mem_file ); return $mo_content; } /** * @param Collection $carry * @param StringEntity $entry * * @return Collection */ public function createMOFormatEntities( $carry, StringEntity $entry ) { $carry->push( $this->mapStringEntityToMOFormatUsing( $entry, 'original' ) ); if ( TranslateWpmlString::canTranslateWithMO( $entry->get_original(), $entry->get_name() ) ) { $carry->push( $this->mapStringEntityToMOFormatUsing( $entry, 'name' ) ); } return $carry; } /** * @param StringEntity $entry * @param string $singularField * * @return array */ private function mapStringEntityToMOFormatUsing( StringEntity $entry, $singularField ) { return [ 'singular' => $entry->{'get_' . $singularField}(), 'translations' => $entry->get_translations(), 'context' => $entry->get_context(), 'plural' => $entry->get_original_plural(), ]; } }
Simpan
Batal
Isi Zip:
Unzip
Create
Buat Folder
Buat File
Terminal / Execute
Run
Chmod Bulk
All File
All Folder
All File dan Folder
Apply