service = $service; $this->user_meta = new PLL_Toggle_User_Meta( sprintf( 'pll_machine_translation_%s', $this->service->get_slug() ) ); $args = array( 'position' => 'before_post_translations', 'activate' => sprintf( /* translators: %s is the name of the machine translation service. */ __( 'Activate %s machine translation', 'polylang-pro' ), $this->service->get_name() ), 'deactivate' => sprintf( /* translators: %s is the name of the machine translation service. */ __( 'Deactivate %s machine translation', 'polylang-pro' ), $this->service->get_name() ), 'icon' => $this->service->get_icon(), 'priority' => 20, ); parent::__construct( 'pll-machine-translation', $args ); add_action( 'admin_notices', array( $this, 'display_errors' ) ); } /** * Prints translation errors into the page. * * @since 3.6 * * @return void */ public function display_errors() { settings_errors( 'polylang' ); } }