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