Change all function L10n calls to one underscore, test updates

That change is done to be compatible with the phpmyadmin translator
class so this can be a drop in replacement or other way around.

Update smarty block.t to only check for _* functions and not any pre
loaded language class
This commit is contained in:
Clemens Schwaighofer
2022-04-18 10:15:02 +09:00
parent 805c695d68
commit daf1f9263c
9 changed files with 153 additions and 113 deletions

View File

@@ -173,11 +173,11 @@ class SmartyExtend extends \Smarty
$this->lang_dir = $this->l10n->getBaseLocalePath();
// opt load functions so we can use legacy init for smarty run perhaps
$this->l10n->loadFunctions();
__setlocale(LC_MESSAGES, $locale['locale']);
__textdomain($this->domain);
__bindtextdomain($this->domain, $this->lang_dir);
__bind_textdomain_codeset($this->domain, $this->encoding);
\CoreLibs\Language\L10n::loadFunctions();
_setlocale(LC_MESSAGES, $locale['locale']);
_textdomain($this->domain);
_bindtextdomain($this->domain, $this->lang_dir);
_bind_textdomain_codeset($this->domain, $this->encoding);
// register smarty variable
$this->registerPlugin('modifier', 'getvar', [&$this, 'getTemplateVars']);