mirror of
https://github.com/php/php-src.git
synced 2024-10-04 16:26:13 +00:00
33 lines
800 B
PHP
33 lines
800 B
PHP
--TEST--
|
|
Gettext basic test with en_US locale that should be on nearly every system
|
|
--SKIPIF--
|
|
<?php
|
|
if (!extension_loaded("gettext")) {
|
|
die("skip\n");
|
|
}
|
|
if (!setlocale(LC_ALL, 'en_US.UTF-8')) {
|
|
die("skip en_US.UTF-8 locale not supported.");
|
|
}
|
|
?>
|
|
--FILE--
|
|
<?php
|
|
|
|
// Using deprectated setlocale() in PHP6. The test needs to be changed
|
|
// when there is an alternative available.
|
|
|
|
chdir(dirname(__FILE__));
|
|
setlocale(LC_ALL, 'en_US.UTF-8');
|
|
bindtextdomain ("messages", "./locale");
|
|
textdomain ("messages");
|
|
echo gettext("Basic test"), "\n";
|
|
echo _("Basic test"), "\n";
|
|
|
|
?>
|
|
--EXPECTF--
|
|
Deprecated: setlocale(): deprecated in Unicode mode, please use ICU locale functions in %s.php on line %d
|
|
A basic test
|
|
A basic test
|
|
--CREDITS--
|
|
Christian Weiske, cweiske@php.net
|
|
PHP Testfest Berlin 2009-05-09
|