first commit
This commit is contained in:
18
wp-content/plugins/polylang-pro/vendor/wpsyntex/polylang/modules/machine-translation/load.php
vendored
Normal file
18
wp-content/plugins/polylang-pro/vendor/wpsyntex/polylang/modules/machine-translation/load.php
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
/**
|
||||
* Loads the settings module for Machine Translation.
|
||||
*
|
||||
* @package Polylang
|
||||
*/
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
if ( $polylang->model->has_languages() ) {
|
||||
add_filter(
|
||||
'pll_settings_modules',
|
||||
function ( $modules ) {
|
||||
$modules[] = 'PLL_Settings_Preview_Machine_Translation';
|
||||
return $modules;
|
||||
}
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Polylang
|
||||
*/
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
/**
|
||||
* Class to advertize the Machine Translation module.
|
||||
*
|
||||
* @since 3.6
|
||||
*/
|
||||
class PLL_Settings_Preview_Machine_Translation extends PLL_Settings_Module {
|
||||
/**
|
||||
* Stores the display order priority.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
public $priority = 90;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @since 3.6
|
||||
*
|
||||
* @param PLL_Settings $polylang Polylang object.
|
||||
* @param array $args Optional. Addition arguments.
|
||||
*
|
||||
* @phpstan-param array{
|
||||
* module?: non-falsy-string,
|
||||
* title?: string,
|
||||
* description?: string,
|
||||
* active_option?: non-falsy-string
|
||||
* } $args
|
||||
*/
|
||||
public function __construct( &$polylang, array $args = array() ) {
|
||||
$default = array(
|
||||
'module' => 'machine_translation',
|
||||
'title' => __( 'Machine Translation', 'polylang' ),
|
||||
'description' => __( 'Allows linkage to DeepL Translate.', 'polylang' ),
|
||||
'active_option' => 'preview',
|
||||
);
|
||||
|
||||
parent::__construct( $polylang, array_merge( $default, $args ) );
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user