PluginProbe
Poll Maker by AYS – Versus Polls, Anonymous Polls, Image Polls / 6.3.5
Poll Maker by AYS – Versus Polls, Anonymous Polls, Image Polls v6.3.5
6.4.9 6.4.8 6.4.7 6.4.6 6.4.5 6.4.4 6.4.3 6.4.2 6.4.1 6.4.0 6.3.9 6.3.8 6.3.7 6.3.6 6.3.5 6.3.4 6.3.3 5.6.0 5.6.1 5.6.2 5.6.3 5.6.4 5.6.5 5.6.6 5.6.7 All 152 releases
poll-maker / includes / class-poll-maker-ays-i18n.php

class-poll-maker-ays-i18n.php in Poll Maker by AYS – Versus Polls, Anonymous Polls, Image Polls 6.3.5, at includes/class-poll-maker-ays-i18n.php

72 lines 1.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * Define the internationalization functionality
5 *
6 * Loads and defines the internationalization files for this plugin
7 * so that it is ready for translation.
8 *
9 * @link https://ays-pro.com/
10 * @since 1.0.0
11 *
12 * @package Poll_Maker_Ays
13 * @subpackage Poll_Maker_Ays/includes
14 */
15
16 /**
17 * Define the internationalization functionality.
18 *
19 * Loads and defines the internationalization files for this plugin
20 * so that it is ready for translation.
21 *
22 * @since 1.0.0
23 * @package Poll_Maker_Ays
24 * @subpackage Poll_Maker_Ays/includes
25 * @author Poll Maker Team <info@ays-pro.com>
26 */
27 class Poll_Maker_Ays_i18n {
28
29
30 /**
31 * Load the plugin text domain for translation.
32 *
33 * @since 1.0.0
34 */
35 public function load_plugin_textdomain() {
36
37 if ( version_compare( get_bloginfo( 'version' ), '6.7', '>=' ) ) {
38 $plugin = 'poll-maker';
39
40 if( is_admin() ){
41 $locale = get_user_locale();
42 } else {
43 $locale = get_locale();
44 }
45
46 if ( is_textdomain_loaded( $plugin ) ) {
47 unload_textdomain( $plugin );
48 }
49 $mofile = sprintf( '%s-%s.mo', $plugin, $locale );
50 // check the plugin language folder.
51 $domain_path = path_join( WP_PLUGIN_DIR, "{$plugin}/languages" );
52 $loaded = load_textdomain( $plugin, path_join( $domain_path, $mofile ) );
53
54 if ( ! $loaded ) { //else, check the installation language path first.
55 $domain_path = path_join( WP_LANG_DIR, 'plugins' );
56 load_textdomain( $plugin, path_join( $domain_path, $mofile ) );
57 }
58 } else {
59 load_plugin_textdomain(
60 'poll-maker',
61 false,
62 dirname( dirname( plugin_basename( __FILE__ ) ) ) . '/languages/'
63 );
64
65 }
66
67 }
68
69
70
71 }
72