PluginProbe
seQura / 4.0.0
seQura v4.0.0
4.3.4 4.3.3 4.3.2 4.3.1 trunk 2.0.0 2.0.10 2.0.11 2.0.12 2.0.5 2.0.6 2.0.7 2.0.8 2.0.9 3.0.0 3.0.2 3.0.5 3.0.6 3.0.7 3.1.0 3.1.1 3.2.0 3.2.1 3.2.2 4.0.0 All 30 releases
sequra / src / Controllers / Hooks / I18n / class-i18n-controller.php

class-i18n-controller.php in seQura 4.0.0, at src/Controllers/Hooks/I18n/class-i18n-controller.php

59 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * I18n Controller
4 *
5 * @package SeQura/WC
6 * @subpackage SeQura/WC/Controllers
7 */
8
9 namespace SeQura\WC\Controllers\Hooks\I18n;
10
11 use SeQura\WC\Controllers\Controller;
12 use SeQura\WC\Services\Log\Interface_Logger_Service;
13
14 /**
15 * Define the internationalization functionality
16 * Loads and defines the internationalization files for this plugin
17 * so that it is ready for translation.
18 */
19 class I18n_Controller extends Controller implements Interface_I18n_Controller {
20
21 /**
22 * The relative path to translation files from wp-content/plugins
23 *
24 * @var string
25 */
26 private $domain_path;
27
28 /**
29 * The text domain of the plugin.
30 *
31 * @var string
32 */
33 private $text_domain;
34
35 /**
36 * Constructor
37 */
38 public function __construct(
39 string $text_domain,
40 string $domain_path,
41 Interface_Logger_Service $logger,
42 string $templates_path
43 ) {
44 parent::__construct( $logger, $templates_path );
45 $this->text_domain = $text_domain;
46 $this->domain_path = \trailingslashit( $domain_path );
47 }
48
49 /**
50 * Load the plugin text domain for translation.
51 *
52 * @return void
53 */
54 public function load_text_domain() {
55 $this->logger->log_debug( 'Hook executed', __FUNCTION__, __CLASS__ );
56 \load_plugin_textdomain( $this->text_domain, false, $this->domain_path );
57 }
58 }
59