1--TEST-- 2Test if dngettext() returns the correct translations (optionally plural). 3--SKIPIF-- 4<?php 5if (!extension_loaded("gettext")) { 6 die("skip gettext extension is not loaded.\n"); 7} 8if (!setlocale(LC_ALL, 'en_US.UTF-8')) { 9 die("skip en_US.UTF-8 locale not supported."); 10} 11--FILE-- 12<?php 13chdir(__DIR__); 14putenv('LC_ALL=en_US.UTF-8'); 15setlocale(LC_ALL, 'en_US.UTF-8'); 16bindtextdomain('dngettextTest', './locale'); 17 18var_dump(dngettext('dngettextTest', 'item', 'items', 1)); 19var_dump(dngettext('dngettextTest', 'item', 'items', 2)); 20--EXPECT-- 21string(7) "Produkt" 22string(8) "Produkte" 23--CREDITS-- 24Till Klampaeckel, till@php.net 25PHP Testfest Berlin 2009-05-09 26