1--TEST-- 2Test dgettext() functionality 3--EXTENSIONS-- 4gettext 5--SKIPIF-- 6<?php 7 8if (!setlocale(LC_ALL, 'en_US.UTF-8')) { 9 die("SKIP en_US.UTF-8 locale not supported."); 10} 11?> 12--FILE-- 13<?php 14chdir(__DIR__); 15putenv('LC_MESSAGES=en_US.UTF-8'); 16setlocale(LC_MESSAGES, 'en_US.UTF-8'); 17putenv('LC_ALL=en_US.UTF-8'); 18setlocale(LC_ALL, 'en_US.UTF-8'); 19bindtextdomain('dgettextTest', './locale'); 20bindtextdomain('dgettextTest_switch', './locale'); 21textdomain('dgettextTest'); 22 23var_dump(gettext('item')); 24var_dump(dgettext('dgettextTest_switch', 'item')); 25var_dump(gettext('item')); 26?> 27--EXPECT-- 28string(7) "Produkt" 29string(16) "Produkt_switched" 30string(7) "Produkt" 31--CREDITS-- 32Moritz Neuhaeuser, info@xcompile.net 33PHP Testfest Berlin 2009-05-09 34