summaryrefslogtreecommitdiff
path: root/ext/gettext/tests/gettext_ngettext.phpt
blob: e9a7de7e7384ad5e6b1807a271c4abf06346c57f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
--TEST--
Test ngettext() functionality
--SKIPIF--
<?php
	if (!extension_loaded("gettext")) {
		die("SKIP extension gettext not loaded\n");
	}
	if (!setlocale(LC_ALL, 'en_US.UTF-8')) {
		die("SKIP en_US.UTF-8 locale not supported.");
	}
?>
--FILE--
<?php
chdir(__DIR__);
putenv('LC_ALL=en_US.UTF-8');
setlocale(LC_ALL, 'en_US.UTF-8');
bindtextdomain('dngettextTest', './locale');
textdomain('dngettextTest');
var_dump(ngettext('item', 'items', 1));
var_dump(ngettext('item', 'items', 2));
?>
--EXPECT--
string(7) "Produkt"
string(8) "Produkte"
--CREDITS--
Christian Weiske, cweiske@php.net
PHP Testfest Berlin 2009-05-09