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

add_action( 'init', 'eael_gphp_load_translations' );
function eael_gphp_load_translations() {
	if ( is_rtl() ) {
		// Load Translations --- Essential Addons for Elementor - Pro
		$text_domain = 'essential-addons-elementor';
		$gphp_mofile = plugin_dir_path( __FILE__ ) . "languages/$text_domain-fa_IR.mo";
		unload_textdomain( $text_domain ); // from default language root 
		load_textdomain( $text_domain, $gphp_mofile );

		// Load Translations --- Essential Addons for Elementor - Lite
		$text_domain = 'essential-addons-for-elementor-lite';
		$gphp_mofile = plugin_dir_path( __FILE__ ) . "languages/$text_domain-fa_IR.mo";
		unload_textdomain( $text_domain ); // from default language root
		load_textdomain( $text_domain, $gphp_mofile );

	}
}


// Custom Admin CSS Styles
add_action( 'admin_enqueue_scripts', 'eael_gphp_admin_css' );
function eael_gphp_admin_css() {
	if ( is_rtl() ) {
		wp_enqueue_style( 'eael-gphp-admin-css', plugin_dir_url( __FILE__ ) . 'css/eael-gphp-admin.css' );
	}
}

// Custom Front-End CSS Styles
add_action( 'wp_enqueue_scripts', 'eael_gphp_front_css' );
function eael_gphp_front_css() {
	if ( is_rtl() ) {
		wp_enqueue_style( 'eael-gphp-front-css', plugin_dir_url( __FILE__ ) . 'css/eael-gphp-front.css' );
	}
}
