I am changing
$this->user->lang
to
$this->language>lang
in my extension. In my ACP interface though the language strings aren't getting translated, although those on the sidebar and the title and legend are.
mass_subscribe.png
Here is a snippet of my code. There have been no changes below the
$submit
line except global replaces of
$this->user->lang
to
$this->language>lang
:
Code: Select all
class main_module
{
private $auth;
private $config;
private $db;
private $helper;
private $language;
private $pagination;
private $phpbb_extension_manager;
private $phpbb_log;
private $phpbb_path_helper;
private $phpbb_root_path;
private $phpEx;
private $request;
private $table_prefix;
private $template;
private $user;
function __construct()
{
global $phpbb_container;
// Get global variables via containers to minimize security issues
$this->phpbb_root_path = $phpbb_container->getParameter('core.root_path');
$this->phpEx= $phpbb_container->getParameter('core.php_ext');
$this->table_prefix = $phpbb_container->getParameter('core.table_prefix');
// Encapsulate certain phpBB objects inside this class to minimize security issues
$this->auth = $phpbb_container->get('auth');
$this->config = $phpbb_container->get('config');
$this->db = $phpbb_container->get('dbal.conn');
$this->helper = $phpbb_container->get('phpbbservices.digests.common');
$this->language = $phpbb_container->get('language');
$this->pagination = $phpbb_container->get('pagination');
$this->phpbb_extension_manager = $phpbb_container->get('ext.manager');
$this->phpbb_log = $phpbb_container->get('log');
$this->phpbb_path_helper = $phpbb_container->get('path_helper');
$this->request = $phpbb_container->get('request');
$this->template = $phpbb_container->get('template');
$this->user = $phpbb_container->get('user');
}
function main($id, $mode)
{
$this->language->add_lang(array('acp/info_acp_common', 'acp/common'), 'phpbbservices/digests');
$submit = (isset($_POST['submit'])) ? true : false;
$form_key = 'phpbbservices/digests';
add_form_key($form_key);
Any idea what may be causing this problem? You can see the full pre 3.2 source here:
https://github.com/MarkDHamill/digests/ ... module.php
The problem has to be in lines of code like this one, which were basically copied and pasted from an ACP example:
Code: Select all
'phpbbservices_digests_enable_log' => array('lang' => 'DIGESTS_ENABLE_LOG', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
I've experimented changing
lang
to
language
and adding a L_ prefix but this suppresses the language constants from even showing up.
You do not have the required permissions to view the files attached to this post.