<?php
/**
 * Translatable strings for PHP and JavaScript.
 *
 * @package MacaHold
 */

defined( 'ABSPATH' ) || exit;

/**
 * Internationalization helpers.
 */
class Maca_Hold_I18n {

	/**
	 * Plugin text domain.
	 */
	public const TEXT_DOMAIN = 'maca-hold';

	/**
	 * Strings passed to maintenance page scripts.
	 *
	 * @return array<string, string>
	 */
	public static function get_script_strings() {
		return array(
			'countdownSoon'     => __( 'Any moment now', 'maca-hold' ),
			/* translators: 1: hours, 2: minutes, 3: seconds. */
			'countdownFormat'   => __( '%1$dh %2$dm %3$ds', 'maca-hold' ),
		);
	}

	/**
	 * Strings passed to admin scripts.
	 *
	 * @return array<string, string>
	 */
	public static function get_admin_script_strings() {
		return array(
			'copiedLabel'           => __( 'Copied', 'maca-hold' ),
			'backgroundSaved'       => __( 'Background updated.', 'maca-hold' ),
			'backgroundSaveError'   => __( 'Could not update background.', 'maca-hold' ),
			'backgroundSaving'      => __( 'Updating background…', 'maca-hold' ),
			'maxLinks'              => (string) (int) apply_filters( 'maca_hold_max_links', 5 ),
		);
	}

	/**
	 * Plugin display name.
	 *
	 * @return string
	 */
	public static function get_plugin_name() {
		return __( 'maca Hold', 'maca-hold' );
	}

	/**
	 * Label for a bundled background image.
	 *
	 * @param string $slug Background slug, e.g. hold1.
	 * @return string
	 */
	public static function get_background_label( $slug ) {
		return sprintf(
			/* translators: %s: background image identifier, for example hold1 */
			__( 'Background %s', 'maca-hold' ),
			$slug
		);
	}
}
