-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathI18n.php
86 lines (78 loc) · 1.46 KB
/
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<?php
/*
* This file is part of WBF Framework: https://github.com/wagaweb/wbf
*
* @author WAGA Team <dev@waga.it>
*/
namespace WBF\components\pluginsframework;
/**
* Define the internationalization functionality.
*
* Loads and defines the internationalization files for this plugin
* so that it is ready for translation.
*
* @since 1.0.0
* @package Waboot_Plugin
*/
class I18n {
/**
* The domain specified for this plugin.
*
* @since 1.0.0
* @access private
* @var string $domain The domain identifier for this plugin.
*/
private $domain;
/**
* The language directory (relative to WP_PLUGIN_DIR)
*
* @var string
*/
private $dir;
/**
* Load the plugin text domain for translation.
*
* @since 1.0.0
*/
public function load_plugin_textdomain() {
load_plugin_textdomain(
$this->domain,
false,
$this->dir
);
}
/**
* Set the domain equal to that of the specified domain.
*
* @since 1.0.0
*
* @param string $domain The domain that represents the locale of this plugin.
*/
public function set_domain( $domain ) {
$this->domain = $domain;
}
/**
* Language dir setter
*
* @param $dir
*/
public function set_language_dir($dir){
$this->dir = $dir;
}
/**
* Domain getter
*
* @return string
*/
public function get_domain(){
return $this->domain;
}
/**
* Language dir getter
*
* @return string
*/
public function get_language_dir(){
return $this->dir;
}
}