PluginProbe
UpStream: a Project Management Plugin for WordPress / trunk
UpStream: a Project Management Plugin for WordPress vtrunk
trunk 1.39.0 1.39.1 1.39.2 1.39.3 2.0.7 2.1.0
upstream / vendor / alledia / wordpress-plugin-framework / src / library / Textdomain.php

Textdomain.php in UpStream: a Project Management Plugin for WordPress trunk, at vendor/alledia/wordpress-plugin-framework/src/library/Textdomain.php

44 lines 753 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Allex;
4
5 class TextDomain extends Abstract_Service
6 {
7 /**
8 * @var string
9 */
10 protected $locale;
11
12 /**
13 * TextDomain constructor.
14 *
15 * @param Container $container
16 */
17 public function __construct(Container $container)
18 {
19 parent::__construct($container);
20
21 $this->locale = $this->get_locale();
22 }
23
24 /**
25 * @return mixed
26 */
27 protected function get_locale()
28 {
29 return get_locale();
30 }
31
32 /**
33 * Load the framework's text domain.
34 */
35 public function load()
36 {
37 $mo_file = __DIR__ . 'languages/allex-' . $this->locale . '.mo';
38
39 if (file_exists($mo_file)) {
40 load_textdomain('allex', $mo_file);
41 }
42 }
43 }
44