*/ if ( ! defined( 'ABSPATH' ) ) { exit; } class Group107_AccessibleDocs_i18n { /** * Get the correct popup option name based on Polylang or WPML availability. * * @since 1.0.0 * * @return string The correct option name depending on whether Polylang or WPML is active. */ public static function accessible_docs_get_popup_options_name() { // Check if Polylang is active and get the current language locale. if (function_exists('pll_current_language')) { $locale = pll_current_language('locale'); // Polylang: Get current language locale (e.g., en_US, fr_FR) if (!empty($locale)) { return "accessible_docs_popup_options_{$locale}"; } } // Check if WPML is active and get the current language locale. if (defined('ICL_SITEPRESS_VERSION')) { $current_lang = apply_filters('wpml_current_language', null); $languages = apply_filters('wpml_active_languages', null); if (isset($languages[$current_lang])) { $locale = $languages[$current_lang]['default_locale']; // WPML: Get full locale (e.g., he_IL) return "accessible_docs_popup_options_{$locale}"; } } // Default option name if neither Polylang nor WPML is active. return "accessible_docs_popup_options"; } }