1--TEST-- 2Test dcgettext() functionality 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(dirname(__FILE__)); 14setlocale(LC_MESSAGES, 'en_US.UTF-8'); 15setlocale(LC_ALL, 'en_US.UTF-8'); 16bindtextdomain('dngettextTest', './locale'); 17 18var_dump(dcgettext('dngettextTest', 'item', LC_CTYPE)); 19var_dump(dcgettext('dngettextTest', 'item', LC_MESSAGES)); 20--EXPECTF-- 21string(8) "cProdukt" 22string(7) "Produkt" 23--CREDITS-- 24Christian Weiske, cweiske@php.net 25PHP Testfest Berlin 2009-05-09