LLMS_Meta_Box_Certificate_Sync::get_text( int $text_type, array $variables = array() )

Returns a translated text of the given type.


Parameters Parameters

$text_type

(int) (Required) One of the LLMS_Abstract_Meta_Box_User_Engagement*Sync::TEXT* constants.

$variables

(array) (Optional) variables that are used in sprintf().

Default value: array()


Top ↑

Return Return

(string)


Top ↑

Source Source

File: includes/admin/post-types/meta-boxes/class-llms-meta-box-certificate-sync.php

	protected function get_text( $text_type, $variables = array() ) {

		switch ( $text_type ) {
			case self::TEXT_SYNC_ALERT_MANY_AWARDED_ENGAGEMENTS:
				return sprintf(
					/* translators: %1$d: number of awarded certificates */
					__(
						'This action will replace the current title, content, background etc. of %1$d awarded certificates with the ones from this certificate template.\nAre you sure you want to proceed?',
						'lifterlms'
					),
					( $variables['awarded_number'] ?? 0 )
				);
			case self::TEXT_SYNC_ALERT_ONE_AWARDED_ENGAGEMENT:
				return sprintf(
					/* translators: %1$d: number of awarded certificates */
					__(
						'This action will replace the current title, content, background etc. of %1$d awarded certificate with the ones from this certificate template.\nAre you sure you want to proceed?',
						'lifterlms'
					),
					( $variables['awarded_number'] ?? 0 )
				);
			case self::TEXT_SYNC_ALERT_THIS_AWARDED_ENGAGEMENT:
				return __(
					'This action will replace the current title, content, background etc. of this awarded certificate with the ones from the certificate template.\nAre you sure you want to proceed?',
					'lifterlms'
				);
			case self::TEXT_SYNC_DESCRIPTION_MANY_AWARDED_ENGAGEMENTS:
				return sprintf(
					/* translators: %1$d: number of awarded certificates */
					__( 'Sync %1$d awarded certificates with this certificate template.', 'lifterlms' ),
					( $variables['awarded_number'] ?? 0 )
				);
			case self::TEXT_SYNC_DESCRIPTION_ONE_AWARDED_ENGAGEMENT:
				return sprintf(
					/* translators: %1$d: number of awarded certificates */
					__( 'Sync %1$d awarded certificate with this certificate template.', 'lifterlms' ),
					( $variables['awarded_number'] ?? 0 )
				);
			case self::TEXT_SYNC_DESCRIPTION_THIS_AWARDED_ENGAGEMENT:
				return sprintf(
					/* translators: %1$s: link to edit the certificate template, %2$s: closing anchor tag */
					__( 'Sync this awarded certificate with its %1$scertificate template%2$s.', 'lifterlms' ),
					'<a href="' . get_edit_post_link( ( $variables['template_id'] ?? 0 ) ) . '" target="_blank">',
					'</a>'
				);
			case self::TEXT_SYNC_ENGAGEMENT_TEMPLATE_NO_AWARDED_ENGAGEMENTS:
				return __( 'This certificate template has no awarded certificates to sync.', 'lifterlms' );
			case self::TEXT_SYNC_TITLE_AWARDED_ENGAGEMENT:
				return __( 'Sync Awarded certificate', 'lifterlms' );
			case self::TEXT_SYNC_TITLE_AWARDED_ENGAGEMENTS:
				return __( 'Sync Awarded certificates', 'lifterlms' );
			default:
				return parent::get_text( $text_type );
		}
	}

Top ↑

Changelog Changelog

Changelog
Version Description
6.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.