<?php
if (!defined('ABSPATH'))
	exit;

/**
 * Define the internationalization functionality
 *
 * Loads and defines the internationalization files for this plugin
 * so that it is ready for translation.
 *
 * @link       https://sourcecode-agency.it/
 * @since      1.0.0
 *
 * @package    polylai
 * @subpackage polylai/includes
 */

/**
 * Define the internationalization functionality.
 *
 * Loads and defines the internationalization files for this plugin
 * so that it is ready for translation.
 *
 * @since      1.0.0
 * @package    polylai
 * @subpackage polylai/includes
 * @author     Diego Imbriani <diego@sourcecode.team>
 */


class polylai_i18n {


	/**
	 * Load the plugin text domain for translation.
	 *
	 * @since    1.0.0
	 */
	public function load_plugin_textdomain()
	{
		// Debug translation loading
		$domain = 'ai-translator-for-polylang';
		$plugin_rel_path = basename(dirname(dirname(__FILE__))) . '/languages';
		$mofile_path = dirname(dirname(__FILE__)) . '/languages/' . $domain . '-' . get_locale() . '.mo';

		// Attempt to load translation
		$loaded = load_plugin_textdomain(
			$domain,
			false,
			$plugin_rel_path
		);

		// error_log('Translation debug - Translation loaded: ' . ($loaded ? 'Yes' : 'No'));
	}



}
