Replace "getlocal2_" function with "getlocal"

This commit is contained in:
Dmitriy Simushev 2014-06-05 08:27:26 +00:00
parent 9ddaba0b4c
commit 8105bfaa1e
5 changed files with 14 additions and 19 deletions

View File

@ -40,7 +40,7 @@ class ButtonController extends AbstractController
if ($referer && isset($_SESSION['threadid'])) { if ($referer && isset($_SESSION['threadid'])) {
$thread = Thread::load($_SESSION['threadid']); $thread = Thread::load($_SESSION['threadid']);
if ($thread && $thread->state != Thread::STATE_CLOSED) { if ($thread && $thread->state != Thread::STATE_CLOSED) {
$msg = getlocal2_( $msg = getlocal(
"chat.client.visited.page", "chat.client.visited.page",
array($referer), array($referer),
$thread->locale, $thread->locale,

View File

@ -167,7 +167,7 @@ class RedirectController extends AbstractController
// Send notification message // Send notification message
$thread->postMessage( $thread->postMessage(
Thread::KIND_EVENTS, Thread::KIND_EVENTS,
getlocal2_( getlocal(
'chat.status.operator.redirect', 'chat.status.operator.redirect',
array(get_operator_name($this->getOperator())), array(get_operator_name($this->getOperator())),
$thread->locale, $thread->locale,
@ -221,7 +221,7 @@ class RedirectController extends AbstractController
// Send notification message // Send notification message
$thread->postMessage( $thread->postMessage(
Thread::KIND_EVENTS, Thread::KIND_EVENTS,
getlocal2_( getlocal(
'chat.status.operator.redirect', 'chat.status.operator.redirect',
array(get_operator_name($this->getOperator())), array(get_operator_name($this->getOperator())),
$thread->locale, $thread->locale,

View File

@ -644,12 +644,12 @@ class ThreadProcessor extends ClientSideProcessor
// Send email // Send email
if ($inbox_mail) { if ($inbox_mail) {
// Prepare message to send by email // Prepare message to send by email
$subject = getlocal2_( $subject = getlocal(
"leavemail.subject", "leavemail.subject",
array($args['name']), array($args['name']),
$message_locale $message_locale
); );
$body = getlocal2_( $body = getlocal(
"leavemail.body", "leavemail.body",
array( array(
$args['name'], $args['name'],

View File

@ -709,14 +709,14 @@ class Thread
// Prepare message // Prepare message
if ($this->nextAgent == $operator['operatorid']) { if ($this->nextAgent == $operator['operatorid']) {
$message_to_post = getlocal2_( $message_to_post = getlocal(
"chat.status.operator.changed", "chat.status.operator.changed",
array($operator_name, $this->agentName), array($operator_name, $this->agentName),
$this->locale, $this->locale,
true true
); );
} else { } else {
$message_to_post = getlocal2_( $message_to_post = getlocal(
"chat.status.operator.returned", "chat.status.operator.returned",
array($operator_name), array($operator_name),
$this->locale, $this->locale,
@ -856,7 +856,7 @@ class Thread
if ($is_user) { if ($is_user) {
$this->postMessage( $this->postMessage(
self::KIND_EVENTS, self::KIND_EVENTS,
getlocal2_( getlocal(
"chat.status.user.left", "chat.status.user.left",
array($this->userName), array($this->userName),
$this->locale, $this->locale,
@ -877,7 +877,7 @@ class Thread
} else { } else {
$this->postMessage( $this->postMessage(
self::KIND_EVENTS, self::KIND_EVENTS,
getlocal2_( getlocal(
"chat.status.operator.left", "chat.status.operator.left",
array($this->agentName), array($this->agentName),
$this->locale, $this->locale,
@ -935,14 +935,14 @@ class Thread
$take_thread = true; $take_thread = true;
if ($this->state == self::STATE_WAITING) { if ($this->state == self::STATE_WAITING) {
if ($operator['operatorid'] != $this->agentId) { if ($operator['operatorid'] != $this->agentId) {
$message = getlocal2_( $message = getlocal(
"chat.status.operator.changed", "chat.status.operator.changed",
array($operator_name, $this->agentName), array($operator_name, $this->agentName),
$this->locale, $this->locale,
true true
); );
} else { } else {
$message = getlocal2_( $message = getlocal(
"chat.status.operator.returned", "chat.status.operator.returned",
array($operator_name), array($operator_name),
$this->locale, $this->locale,
@ -950,7 +950,7 @@ class Thread
); );
} }
} else { } else {
$message = getlocal2_( $message = getlocal(
"chat.status.operator.joined", "chat.status.operator.joined",
array($operator_name), array($operator_name),
$this->locale, $this->locale,
@ -961,7 +961,7 @@ class Thread
// User chatting // User chatting
if ($operator['operatorid'] != $this->agentId) { if ($operator['operatorid'] != $this->agentId) {
$take_thread = true; $take_thread = true;
$message = getlocal2_( $message = getlocal(
"chat.status.operator.changed", "chat.status.operator.changed",
array($operator_name, $this->agentName), array($operator_name, $this->agentName),
$this->locale, $this->locale,
@ -1012,7 +1012,7 @@ class Thread
$this->save(); $this->save();
// Send message about renaming // Send message about renaming
$message = getlocal2_( $message = getlocal(
"chat.status.user.changedname", "chat.status.user.changedname",
array($old_name, $new_name), array($old_name, $new_name),
$this->locale, $this->locale,

View File

@ -278,11 +278,6 @@ function get_localized_string($string, $locale)
return "!" . $string; return "!" . $string;
} }
function getlocal2_($text, $params, $locale, $raw = false)
{
return getlocal($text, $params, $locale, $raw);
}
function getlocal2($text, $params, $raw = false) function getlocal2($text, $params, $raw = false)
{ {
return getlocal($text, $params, CURRENT_LOCALE, $raw); return getlocal($text, $params, CURRENT_LOCALE, $raw);