Skip to content

Instantly share code, notes, and snippets.

@olleolleolle
Created March 10, 2010 22:49
Show Gist options
  • Save olleolleolle/328553 to your computer and use it in GitHub Desktop.
Save olleolleolle/328553 to your computer and use it in GitHub Desktop.
(it does not yet run right...) PHPT test file for gettext functionality, see bug http://bugs.php.net/bug.php?id=49349 and http://qa.php.net/write-test.php
--TEST--
#49349: gettext behaves differently in php 5.3.0 (5.2.x ignored setlocale errors)
--SKIPIF--
<?php
if (!extension_loaded("gettext")) {
die("skip\n");
}
--FILE--
<?php
$lang = 'en'; //"fi" or "en"
putenv("LANG=$lang");
putenv("LC_ALL=$lang");
$tradFile = 'messages';
bindtextdomain($tradFile, 'locale/'); // We should use the existing en and fi files only!
bind_textdomain_codeset($tradFile,'UTF-8');
textdomain($tradFile);
echo _('Basic test');
?>
==DONE==
<?php exit(0); ?>
--EXPECTF--
Perustesti
==DONE==
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment