PluginProbe
Survey Maker by AYS / 5.2.2.9
Survey Maker by AYS v5.2.2.9
5.2.4.1 5.2.4.0 5.2.3.9 5.2.3.8 5.2.3.7 5.2.3.6 5.2.3.5 5.2.3.4 5.2.3.3 5.2.3.2 5.2.3.1 5.2.3.0 5.2.2.9 5.2.2.8 5.2.2.7 5.2.2.6 5.2.2.5 5.2.2.4 5.2.2.3 5.2.2.2 5.2.2.1 5.2.2.0 5.2.1.9 5.2.1.8 5.2.0.8 All 154 releases
survey-maker / includes / class-survey-maker-i18n.php

class-survey-maker-i18n.php in Survey Maker by AYS 5.2.2.9, at includes/class-survey-maker-i18n.php

78 lines 1.9 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 Survey_Maker
13 * @subpackage Survey_Maker/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 Survey_Maker
24 * @subpackage Survey_Maker/includes
25 * @author Survey Maker team <[email protected]>
26 */
27 class Survey_Maker_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 // load_plugin_textdomain(
38 // 'survey-maker',
39 // false,
40 // dirname( dirname( plugin_basename( __FILE__ ) ) ) . '/languages/'
41 // );
42
43 if ( version_compare( get_bloginfo( 'version' ), '6.7', '>=' ) ) {
44 $plugin = 'survey-maker';
45 if( is_admin() ){
46 $locale = get_user_locale();
47 } else {
48 $locale = get_locale();
49 }
50
51
52 if ( is_textdomain_loaded( $plugin ) ) {
53 unload_textdomain( $plugin );
54 }
55 $mofile = sprintf( '%s-%s.mo', $plugin, $locale );
56 // check the plugin language folder.
57 $domain_path = path_join( WP_PLUGIN_DIR, "{$plugin}/languages" );
58 $loaded = load_textdomain( $plugin, path_join( $domain_path, $mofile ) );
59
60 if ( ! $loaded ) { //else, check the installation language path first.
61 $domain_path = path_join( WP_LANG_DIR, 'plugins' );
62 load_textdomain( $plugin, path_join( $domain_path, $mofile ) );
63 }
64 } else {
65 load_plugin_textdomain(
66 'survey-maker',
67 false,
68 dirname( dirname( plugin_basename( __FILE__ ) ) ) . '/languages/'
69 );
70 }
71
72
73 }
74
75
76
77 }
78