Does not set global is_rtl variable

This commit is contained in:
Vlad
2017-09-06 20:56:52 -04:00
parent 6584250d1a
commit 77f3a875dd
3 changed files with 7 additions and 27 deletions

View File

@ -170,7 +170,7 @@ class Initializer {
}
function setupLocalizer() {
$localizer = new Localizer($this->renderer);
$localizer = new Localizer();
$localizer->init();
}

View File

@ -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',

View File

@ -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) :