Source
* Translates the string with respect to the given context and plural forms, also replaces placeholders with supplied
<?php
/*
** Zabbix
** Copyright (C) 2001-2022 Zabbix SIA
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 2 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
**/
/**
* In case gettext functions do not exist, just replacing them with our own,
* so user can see at least English translation.
*/
if (!function_exists('_')) {
/**
* Stub gettext function in case gettext is not available.
*
* @param string $string
*
* @return string
*/
function _($string) {
return $string;
}
}
if (!function_exists('ngettext')) {
/**
* Stub gettext function in case gettext is not available. Do not use directly, use _n() instead.
*
* @see _n
*
* @param string $string1
* @param string $string2
* @param string $n
*
* @return string
*/
function ngettext($string1, $string2, $n) {
return ($n == 1) ? $string1 : $string2;
}
}
/**
* Translates the string with respect to the given context.
*
* @see _x
*
* @param string $context
* @param string $msgId
*