Does not set global is_rtl variable
This commit is contained in:
@ -170,7 +170,7 @@ class Initializer {
|
||||
}
|
||||
|
||||
function setupLocalizer() {
|
||||
$localizer = new Localizer($this->renderer);
|
||||
$localizer = new Localizer();
|
||||
$localizer->init();
|
||||
}
|
||||
|
||||
|
@ -1,32 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace MailPoet\Config;
|
||||
|
||||
if(!defined('ABSPATH')) exit;
|
||||
|
||||
class Localizer {
|
||||
function __construct($renderer) {
|
||||
$this->renderer = $renderer;
|
||||
}
|
||||
|
||||
function init() {
|
||||
add_action(
|
||||
'init',
|
||||
array($this, 'setup')
|
||||
);
|
||||
}
|
||||
|
||||
function setup() {
|
||||
$this->loadGlobalText();
|
||||
$this->loadPluginText();
|
||||
$this->setGlobalRtl();
|
||||
}
|
||||
|
||||
function loadGlobalText() {
|
||||
$language_path =
|
||||
Env::$languages_path
|
||||
. '/'
|
||||
. $this->locale()
|
||||
. '.mo';
|
||||
$language_path = sprintf(
|
||||
'%s/%s.mo',
|
||||
Env::$languages_path,
|
||||
$this->locale()
|
||||
);
|
||||
load_textdomain(Env::$plugin_name, $language_path);
|
||||
}
|
||||
|
||||
@ -38,10 +27,6 @@ class Localizer {
|
||||
);
|
||||
}
|
||||
|
||||
function setGlobalRtl() {
|
||||
$this->renderer->addGlobal('is_rtl', is_rtl());
|
||||
}
|
||||
|
||||
function locale() {
|
||||
$locale = apply_filters(
|
||||
'plugin_locale',
|
||||
|
@ -34,7 +34,6 @@ class Renderer {
|
||||
|
||||
$this->assets_manifest_js = $this->getAssetManifest(Env::$assets_path . '/js/manifest.json');
|
||||
$this->assets_manifest_css = $this->getAssetManifest(Env::$assets_path . '/css/manifest.json');
|
||||
|
||||
$this->setupDebug();
|
||||
$this->setupTranslations();
|
||||
$this->setupFunctions();
|
||||
@ -112,10 +111,6 @@ class Renderer {
|
||||
}
|
||||
}
|
||||
|
||||
function addGlobal($key, $value) {
|
||||
return $this->renderer->addGlobal($key, $value);
|
||||
}
|
||||
|
||||
function getAssetManifest($manifest_file) {
|
||||
return (is_readable($manifest_file)) ?
|
||||
json_decode(file_get_contents($manifest_file), true) :
|
||||
|
Reference in New Issue
Block a user