-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathI18n.php
47 lines (42 loc) · 917 Bytes
/
I18n.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
namespace [namespace];
/**
* Define the internationalization functionality.
*
* Loads and defines the internationalization files for this plugin
* so that it is ready for translation.
*
* @since [initial_version]
*/
class I18n {
/**
* The domain specified for this plugin.
*
* @since [initial_version]
* @access private
* @var string
*/
private $domain;
/**
* Load the plugin text domain for translation.
*
* @since [initial_version]
*/
public function load_plugin_textdomain() {
\load_plugin_textdomain(
$this->domain,
false,
dirname( dirname( \plugin_basename( __FILE__ ) ) ) . '/languages/'
);
}
/**
* Set the domain equal to that of the specified domain.
*
* @since [initial_version]
*
* @param string $domain The domain that represents the locale of this plugin.
*/
public function set_domain( $domain ) {
$this->domain = $domain;
}
}