mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-07 20:08:53 +00:00
[ticket/17191] Replace lang keys in fucntions with composer output
PHPBB3-17191
This commit is contained in:
parent
36ea0c1f2e
commit
1cc6a479a1
3 changed files with 16 additions and 8 deletions
|
@ -3668,7 +3668,7 @@ function phpbb_get_avatar($row, $alt, $ignore_config = false, $lazy = false)
|
||||||
function page_header($page_title = '', $display_online_list = false, $item_id = 0, $item = 'forum', $send_headers = true)
|
function page_header($page_title = '', $display_online_list = false, $item_id = 0, $item = 'forum', $send_headers = true)
|
||||||
{
|
{
|
||||||
global $db, $config, $template, $SID, $_SID, $_EXTRA_URL, $user, $auth, $phpEx, $phpbb_root_path;
|
global $db, $config, $template, $SID, $_SID, $_EXTRA_URL, $user, $auth, $phpEx, $phpbb_root_path;
|
||||||
global $phpbb_dispatcher, $request, $phpbb_container, $phpbb_admin_path;
|
global $phpbb_dispatcher, $request, $phpbb_container, $phpbb_admin_path, $language_helper;
|
||||||
|
|
||||||
if (defined('HEADER_INC'))
|
if (defined('HEADER_INC'))
|
||||||
{
|
{
|
||||||
|
@ -3824,7 +3824,10 @@ function page_header($page_title = '', $display_online_list = false, $item_id =
|
||||||
$web_path = $phpbb_path_helper->get_web_root_path();
|
$web_path = $phpbb_path_helper->get_web_root_path();
|
||||||
|
|
||||||
// Send a proper content-language to the output
|
// Send a proper content-language to the output
|
||||||
$user_lang = $user->lang['USER_LANG'];
|
$language_file_helper = $phpbb_container->get('language.helper.language_file');
|
||||||
|
|
||||||
|
$available_languages = $language_file_helper->get_available_languages();
|
||||||
|
$user_lang = $available_languages[0]['user_lang'];
|
||||||
if (strpos($user_lang, '-x-') !== false)
|
if (strpos($user_lang, '-x-') !== false)
|
||||||
{
|
{
|
||||||
$user_lang = substr($user_lang, 0, strpos($user_lang, '-x-'));
|
$user_lang = substr($user_lang, 0, strpos($user_lang, '-x-'));
|
||||||
|
@ -3880,6 +3883,10 @@ function page_header($page_title = '', $display_online_list = false, $item_id =
|
||||||
|
|
||||||
$s_login_redirect = build_hidden_fields(array('redirect' => $phpbb_path_helper->remove_web_root_path(build_url())));
|
$s_login_redirect = build_hidden_fields(array('redirect' => $phpbb_path_helper->remove_web_root_path(build_url())));
|
||||||
|
|
||||||
|
// Grab the users lang direction and store it for later use
|
||||||
|
$available_languages = $language_file_helper->get_available_languages();
|
||||||
|
$direction = $available_languages[0]['direction'];
|
||||||
|
|
||||||
// Add form token for login box, in case page is presenting a login form.
|
// Add form token for login box, in case page is presenting a login form.
|
||||||
add_form_key('login', '_LOGIN');
|
add_form_key('login', '_LOGIN');
|
||||||
|
|
||||||
|
@ -3970,9 +3977,9 @@ function page_header($page_title = '', $display_online_list = false, $item_id =
|
||||||
'S_USER_LANG' => $user_lang,
|
'S_USER_LANG' => $user_lang,
|
||||||
'S_USER_BROWSER' => (isset($user->data['session_browser'])) ? $user->data['session_browser'] : $user->lang['UNKNOWN_BROWSER'],
|
'S_USER_BROWSER' => (isset($user->data['session_browser'])) ? $user->data['session_browser'] : $user->lang['UNKNOWN_BROWSER'],
|
||||||
'S_USERNAME' => $user->data['username'],
|
'S_USERNAME' => $user->data['username'],
|
||||||
'S_CONTENT_DIRECTION' => $user->lang['DIRECTION'],
|
'S_CONTENT_DIRECTION' => $direction,
|
||||||
'S_CONTENT_FLOW_BEGIN' => ($user->lang['DIRECTION'] == 'ltr') ? 'left' : 'right',
|
'S_CONTENT_FLOW_BEGIN' => ($direction == 'ltr') ? 'left' : 'right',
|
||||||
'S_CONTENT_FLOW_END' => ($user->lang['DIRECTION'] == 'ltr') ? 'right' : 'left',
|
'S_CONTENT_FLOW_END' => ($direction == 'ltr') ? 'right' : 'left',
|
||||||
'S_CONTENT_ENCODING' => 'UTF-8',
|
'S_CONTENT_ENCODING' => 'UTF-8',
|
||||||
'S_TIMEZONE' => sprintf($user->lang['ALL_TIMES'], $timezone_offset, $timezone_name),
|
'S_TIMEZONE' => sprintf($user->lang['ALL_TIMES'], $timezone_offset, $timezone_name),
|
||||||
'S_DISPLAY_ONLINE_LIST' => ($l_online_time) ? 1 : 0,
|
'S_DISPLAY_ONLINE_LIST' => ($l_online_time) ? 1 : 0,
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
namespace phpbb\language;
|
namespace phpbb\language;
|
||||||
|
|
||||||
use phpbb\language\exception\invalid_plural_rule_exception;
|
use phpbb\language\exception\invalid_plural_rule_exception;
|
||||||
|
use phpbb\language\language_file_helper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Wrapper class for loading translations
|
* Wrapper class for loading translations
|
||||||
|
|
|
@ -116,9 +116,9 @@ class language_file_helper
|
||||||
'version' => $data['version'],
|
'version' => $data['version'],
|
||||||
'phpbb_version' => $data['extra']['phpbb-version'],
|
'phpbb_version' => $data['extra']['phpbb-version'],
|
||||||
'direction' => $data['extra']['direction'],
|
'direction' => $data['extra']['direction'],
|
||||||
'user-lang' => $data['extra']['user-lang'],
|
'user_lang' => $data['extra']['user-lang'],
|
||||||
'plural-rule' => $data['extra']['plural-rule'],
|
'plural_rule' => $data['extra']['plural-rule'],
|
||||||
'recaptcha-lang'=> $data['extra']['recaptcha-lang'],
|
'recaptcha_lang'=> $data['extra']['recaptcha-lang'],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue