I18n   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 1
cbo 0
dl 0
loc 37
ccs 0
cts 10
cp 0
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A load_plugin_textdomain() 0 9 1
A set_domain() 0 3 1
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       http://example.com
10
 * @since      1.0.0
11
 *
12
 * @package    PluginName
13
 * @subpackage PluginName/includes
14
 */
15
16
namespace logoscon\WP\RedmineEmbed;
17
18
/**
19
 * Define the internationalization functionality.
20
 *
21
 * Loads and defines the internationalization files for this plugin
22
 * so that it is ready for translation.
23
 *
24
 * @since      1.0.0
25
 * @package    PluginName
26
 * @subpackage PluginName/includes
27
 * @author     Your Name <[email protected]>
28
 */
29
class I18n {
30
31
	/**
32
	 * The domain specified for this plugin.
33
	 *
34
	 * @since    1.0.0
35
	 * @access   private
36
	 * @var      string    $domain    The domain identifier for this plugin.
37
	 */
38
	private $domain;
39
40
	/**
41
	 * Load the plugin text domain for translation.
42
	 *
43
	 * @since    1.0.0
44
	 */
45
	public function load_plugin_textdomain() {
46
47
		\load_plugin_textdomain(
48
			$this->domain,
49
			false,
50
			dirname( dirname( \plugin_basename( __FILE__ ) ) ) . '/languages/'
51
		);
52
53
	}
54
55
	/**
56
	 * Set the domain equal to that of the specified domain.
57
	 *
58
	 * @since    1.0.0
59
	 * @param    string    $domain    The domain that represents the locale of this plugin.
60
	 */
61
	public function set_domain( $domain ) {
62
		$this->domain = $domain;
63
	}
64
65
}
66