mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-29 08:44:10 +02:00
Fix PHP warning on Windows due to LC_MESSAGES not defined
Signed-off-by: Alexander A. Klimov <alexander.klimov@netways.de> with the following changes: Don't define LC_MESSAGES globally as only 2 methods would need that Use LC_ALL rather than 6 fixes #8912
This commit is contained in:
parent
7ea6eeb20d
commit
e8cdcce61d
1
AUTHORS
1
AUTHORS
@ -18,6 +18,7 @@ Marius Hein <marius.hein@netways.de>
|
|||||||
Markus Frosch <markus@lazyfrosch.de>
|
Markus Frosch <markus@lazyfrosch.de>
|
||||||
Matthias Jentsch <matthias.jentsch@netways.de>
|
Matthias Jentsch <matthias.jentsch@netways.de>
|
||||||
Michael Friedrich <michael.friedrich@netways.de>
|
Michael Friedrich <michael.friedrich@netways.de>
|
||||||
|
Paul Richards <paul@minimoo.org>
|
||||||
Rene Moser <rene.moser@swisstxt.ch>
|
Rene Moser <rene.moser@swisstxt.ch>
|
||||||
Susanne Vestner-Ludwig <susanne.vestner-ludwig@inserteffect.com>
|
Susanne Vestner-Ludwig <susanne.vestner-ludwig@inserteffect.com>
|
||||||
Sylph Lin <sylph.lin@gmail.com>
|
Sylph Lin <sylph.lin@gmail.com>
|
||||||
|
@ -100,7 +100,11 @@ class Translator
|
|||||||
{
|
{
|
||||||
$contextString = "{$context}\004{$text}";
|
$contextString = "{$context}\004{$text}";
|
||||||
|
|
||||||
$translation = dcgettext($domain, $contextString, LC_MESSAGES);
|
$translation = dcgettext(
|
||||||
|
$domain,
|
||||||
|
$contextString,
|
||||||
|
defined('LC_MESSAGES') ? LC_MESSAGES : LC_ALL
|
||||||
|
);
|
||||||
|
|
||||||
if ($translation == $contextString) {
|
if ($translation == $contextString) {
|
||||||
return $text;
|
return $text;
|
||||||
@ -126,7 +130,13 @@ class Translator
|
|||||||
{
|
{
|
||||||
$contextString = "{$context}\004{$textSingular}";
|
$contextString = "{$context}\004{$textSingular}";
|
||||||
|
|
||||||
$translation = dcngettext($domain, $contextString, $textPlural, $number, LC_MESSAGES);
|
$translation = dcngettext(
|
||||||
|
$domain,
|
||||||
|
$contextString,
|
||||||
|
$textPlural,
|
||||||
|
$number,
|
||||||
|
defined('LC_MESSAGES') ? LC_MESSAGES : LC_ALL
|
||||||
|
);
|
||||||
|
|
||||||
if ($translation == $contextString || $translation == $textPlural) {
|
if ($translation == $contextString || $translation == $textPlural) {
|
||||||
return ($number == 1 ? $textSingular : $textPlural);
|
return ($number == 1 ? $textSingular : $textPlural);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user