<?php

/**
 * LolaCore — Translatable strings for the Playbooks admin page and JS.
 *
 * @package LolaCore
 * @license GPL-2.0-or-later
 */

declare(strict_types=1);

namespace LolaCore\I18n;

// phpcs:disable WordPress.Security.EscapeOutput.ExceptionNotEscaped -- Diagnostic exception messages; escaped at REST/chat presentation layer.

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

/**
 * Playbooks manager copy for templates and lolacore-playbooks.js.
 */
class PlaybooksUiStrings {

	/**
	 * Strings for lolacore-playbooks.js confirmations, modals, and status messages.
	 *
	 * @return array<string, string>
	 */
	public static function forScript(): array {
		return array(
			'distillingDocument'        => \__( 'Distilling document…', 'lolacore' ),
			'documentTooLongTitle'      => \__( 'Document too long', 'lolacore' ),
			/* translators: 1: value */
			'documentTooLongChars'    => \__( 'Your document has %s characters of extracted text.', 'lolacore' ),
			/* translators: 1: value */
			'documentTooLongMax'        => \__( 'The maximum is %s characters.', 'lolacore' ),
			/* translators: 1: value */
			'documentTooLongOver'       => \__( ' (about %s over the limit).', 'lolacore' ),
			'documentTooLongHint'       => \__(
				'Upload a shorter section (for example one chapter), or ask Lola in the chat to help you build a playbook from the parts you need.',
				'lolacore'
			),
			'deletePlaybookTitle'       => \__( 'Delete playbook', 'lolacore' ),
			/* translators: 1: value */
			'deletePlaybookConfirm'     => \__( 'Delete playbook "%s"? This cannot be undone.', 'lolacore' ),
			'toggleServerError'         => \__( 'Server error while toggling playbook.', 'lolacore' ),
			'deleteServerError'         => \__( 'Server error while deleting playbook.', 'lolacore' ),
			'reloadPlaybooks'           => \__( 'Reload playbooks', 'lolacore' ),
			'reloadServerError'         => \__( 'Server error while reloading playbooks.', 'lolacore' ),
			'distillEmptyDraft'         => \__( 'Distillation returned an empty draft.', 'lolacore' ),
			'distillFailed'             => \__( 'Distillation failed.', 'lolacore' ),
			'distillFailedTitle'        => \__( 'Distillation failed', 'lolacore' ),
			'distillErrorHint'          => \__(
				'You can fix the draft in the editor below, or use Regenerate with instructions.',
				'lolacore'
			),
			'dismissMessage'            => \__( 'Dismiss', 'lolacore' ),
			'sourceTextUnavailable'     => \__(
				'Original source text is unavailable. Upload the document again.',
				'lolacore'
			),
			'contentEmpty'              => \__( 'Playbook content cannot be empty.', 'lolacore' ),
			'frontmatterNameRequired'   => \__( 'Add a name: field in the YAML frontmatter.', 'lolacore' ),
			'frontmatterNameOrSlug'     => \__(
				'Add a name: field in the YAML frontmatter (or fill in the slug).',
				'lolacore'
			),
			'saving'                    => \__( 'Saving…', 'lolacore' ),
			'saveFailed'                => \__( 'Save failed.', 'lolacore' ),
			'saveServerError'           => \__( 'Server error while saving playbook.', 'lolacore' ),
			'confirm'                   => \__( 'Confirm', 'lolacore' ),
			'cancel'                    => \__( 'Cancel', 'lolacore' ),
			'delete'                      => \__( 'Delete', 'lolacore' ),
			'toggleFailed'              => \__( 'Toggle failed.', 'lolacore' ),
			'deleteFailed'              => \__( 'Delete failed.', 'lolacore' ),
			'reloadFailed'              => \__( 'Reload failed.', 'lolacore' ),
			'reloading'                 => \__( 'Reloading…', 'lolacore' ),
		);
	}
}

