Server IP : 162.0.217.223 / Your IP : 216.73.216.153 Web Server : LiteSpeed System : Linux premium269.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64 User : mypckeys ( 1539) PHP Version : 8.1.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/mypckeys/yeslicense.org/wp-content/plugins/yaymail/src/ |
Upload File : |
<?php namespace YayMail; use YayMail\Utils\SingletonTrait; defined( 'ABSPATH' ) || exit; /** * I18n Logic * * @method static I18n get_instance() */ class I18n { use SingletonTrait; private function __construct() { add_action( 'init', [ $this, 'load_plugin_text_domain' ] ); add_filter( 'yaymail_translations', [ $this, 'get_translations' ] ); } public static function load_plugin_text_domain() { if ( function_exists( 'determine_locale' ) ) { $locale = determine_locale(); } else { $locale = is_admin() ? get_user_locale() : get_locale(); } unload_textdomain( 'yaymail' ); load_textdomain( 'yaymail', YAYMAIL_PLUGIN_PATH . 'i18n/languages/yaymail-' . $locale . '.mo' ); load_plugin_textdomain( 'yaymail', false, YAYMAIL_PLUGIN_PATH . 'i18n/languages/' ); } public function get_translations() { $translations = get_translations_for_domain( 'yaymail' ); $messages = []; $entries = $translations->entries; foreach ( $entries as $key => $entry ) { $messages[ $entry->singular ] = $entry->translations; } return [ 'locale_data' => [ 'messages' => $messages, ], ]; } }