<?php
/**
 * Internationalization service for Flux Plugins suite.
 *
 * @package FluxAIMediaAltCreator\FluxPlugins\Common\Services
 * @since 1.0.0
 */

namespace FluxAIMediaAltCreator\FluxPlugins\Common\Services;

/**
 * Internationalization service.
 *
 * Stores and retrieves the text domain for the current plugin instance.
 * Each plugin instance is namespaced via Strauss, so this service handles one plugin.
 *
 * @since 1.0.0
 */
class I18n {

	/**
	 * Text domain for translations.
	 *
	 * @since 1.0.0
	 * @var string|null
	 */
	private static $text_domain = null;

	/**
	 * Set the text domain for this plugin instance.
	 *
	 * @since 1.0.0
	 * @param string $text_domain Text domain (e.g., 'flux-media-optimizer').
	 * @return void
	 */
	public static function set_domain( $text_domain ) {
		self::$text_domain = $text_domain;
	}

	/**
	 * Get the text domain for this plugin instance.
	 *
	 * @since 1.0.0
	 * @return string Text domain, or empty string if not set.
	 */
	public static function domain() {
		return self::$text_domain !== null ? self::$text_domain : '';
	}
}

