diff options
author | Igor Pashev <pashev.igor@gmail.com> | 2015-02-20 22:25:42 +0300 |
---|---|---|
committer | Igor Pashev <pashev.igor@gmail.com> | 2015-02-20 22:25:42 +0300 |
commit | 71d41ca6bb3a9d888b39f34a30f994ac1cf88873 (patch) | |
tree | 3a11365b77b332c078440204fb82549d34237a35 /ext/gettext | |
parent | 2d50280dd013556e51b6f275ca965fe7b530029b (diff) | |
parent | 1ceec3a053647865493ab417d3ce401b9bc42450 (diff) | |
download | php-71d41ca6bb3a9d888b39f34a30f994ac1cf88873.tar.gz |
Merge branch 'master-5.6' of git://anonscm.debian.org/pkg-php/php
Conflicts:
debian/changelog
debian/patches/series
Diffstat (limited to 'ext/gettext')
-rw-r--r-- | ext/gettext/gettext.c | 2 | ||||
-rw-r--r-- | ext/gettext/php_gettext.h | 2 | ||||
-rw-r--r-- | ext/gettext/tests/66265/de_DE/LC_MESSAGES/domain.mo | bin | 0 -> 458 bytes | |||
-rw-r--r-- | ext/gettext/tests/66265/de_DE/LC_MESSAGES/domain.po | 17 | ||||
-rw-r--r-- | ext/gettext/tests/66265/en_US/LC_MESSAGES/domain.mo | bin | 0 -> 445 bytes | |||
-rw-r--r-- | ext/gettext/tests/66265/en_US/LC_MESSAGES/domain.po | 17 | ||||
-rw-r--r-- | ext/gettext/tests/66265/fr_FR/LC_MESSAGES/domain.mo | bin | 0 -> 458 bytes | |||
-rw-r--r-- | ext/gettext/tests/66265/fr_FR/LC_MESSAGES/domain.po | 17 | ||||
-rw-r--r-- | ext/gettext/tests/bug66267.phpt | 56 |
9 files changed, 109 insertions, 2 deletions
diff --git a/ext/gettext/gettext.c b/ext/gettext/gettext.c index 732ef5499..41d45139f 100644 --- a/ext/gettext/gettext.c +++ b/ext/gettext/gettext.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2014 The PHP Group | + | Copyright (c) 1997-2015 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/gettext/php_gettext.h b/ext/gettext/php_gettext.h index f990d32af..ce4ca1002 100644 --- a/ext/gettext/php_gettext.h +++ b/ext/gettext/php_gettext.h @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2014 The PHP Group | + | Copyright (c) 1997-2015 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | diff --git a/ext/gettext/tests/66265/de_DE/LC_MESSAGES/domain.mo b/ext/gettext/tests/66265/de_DE/LC_MESSAGES/domain.mo Binary files differnew file mode 100644 index 000000000..1aaba7b27 --- /dev/null +++ b/ext/gettext/tests/66265/de_DE/LC_MESSAGES/domain.mo diff --git a/ext/gettext/tests/66265/de_DE/LC_MESSAGES/domain.po b/ext/gettext/tests/66265/de_DE/LC_MESSAGES/domain.po new file mode 100644 index 000000000..d2496d78f --- /dev/null +++ b/ext/gettext/tests/66265/de_DE/LC_MESSAGES/domain.po @@ -0,0 +1,17 @@ +msgid "" +msgstr "" +"Project-Id-Version: bugs.php.net/66265\n" +"POT-Creation-Date: 2014-11-20 16:33+0100\n" +"PO-Revision-Date: 2014-11-20 16:40+0100\n" +"Last-Translator: <ab@php.net>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 1.6.10\n" +"X-Poedit-Basepath: .\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"Language: de_DE\n" + +msgid "hello" +msgstr "hallo" diff --git a/ext/gettext/tests/66265/en_US/LC_MESSAGES/domain.mo b/ext/gettext/tests/66265/en_US/LC_MESSAGES/domain.mo Binary files differnew file mode 100644 index 000000000..79d02c173 --- /dev/null +++ b/ext/gettext/tests/66265/en_US/LC_MESSAGES/domain.mo diff --git a/ext/gettext/tests/66265/en_US/LC_MESSAGES/domain.po b/ext/gettext/tests/66265/en_US/LC_MESSAGES/domain.po new file mode 100644 index 000000000..670d7ddad --- /dev/null +++ b/ext/gettext/tests/66265/en_US/LC_MESSAGES/domain.po @@ -0,0 +1,17 @@ +msgid "" +msgstr "" +"Project-Id-Version: bugs.php.net/66265\n" +"POT-Creation-Date: 2014-11-20 16:33+0100\n" +"PO-Revision-Date: 2014-11-20 16:40+0100\n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 1.6.10\n" +"X-Poedit-Basepath: .\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"Language: en_US\n" + +msgid "hello" +msgstr "hello" diff --git a/ext/gettext/tests/66265/fr_FR/LC_MESSAGES/domain.mo b/ext/gettext/tests/66265/fr_FR/LC_MESSAGES/domain.mo Binary files differnew file mode 100644 index 000000000..c2f3cdd6b --- /dev/null +++ b/ext/gettext/tests/66265/fr_FR/LC_MESSAGES/domain.mo diff --git a/ext/gettext/tests/66265/fr_FR/LC_MESSAGES/domain.po b/ext/gettext/tests/66265/fr_FR/LC_MESSAGES/domain.po new file mode 100644 index 000000000..c2f708c52 --- /dev/null +++ b/ext/gettext/tests/66265/fr_FR/LC_MESSAGES/domain.po @@ -0,0 +1,17 @@ +msgid "" +msgstr "" +"Project-Id-Version: bugs.php.net/66265\n" +"POT-Creation-Date: 2014-11-20 16:33+0100\n" +"PO-Revision-Date: 2014-11-20 16:59+0100\n" +"Last-Translator: <ab@php.net>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 1.6.10\n" +"X-Poedit-Basepath: .\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"Language: fr_FR\n" + +msgid "hello" +msgstr "salut" diff --git a/ext/gettext/tests/bug66267.phpt b/ext/gettext/tests/bug66267.phpt new file mode 100644 index 000000000..56396860b --- /dev/null +++ b/ext/gettext/tests/bug66267.phpt @@ -0,0 +1,56 @@ +--TEST-- +#66265: gettext doesn't switch locales within the same script +--SKIPIF-- +<?php +if (!extension_loaded("gettext")) { + die("skip\n"); +} +if (PHP_ZTS) { + /* this is supposed to fail on the TS build at least on Windows, + should be even XFAIL till it's fixed there */ + die("skip NTS only"); +} +if (substr(PHP_OS, 0, 3) != 'WIN') { + $loc = ["de_DE", "fr_FR", "en_US"]; + foreach($loc as $l) { + if (!setlocale(LC_ALL, $l)) { + die("SKIP '$l' locale not supported."); + } + } +} +?> +--FILE-- +<?php + +$domain = 'domain'; + +$loc = ["de_DE", "fr_FR", "en_US"]; + +foreach ($loc as $l) { + putenv("LC_ALL=$l"); + setlocale(LC_ALL, $l); + + $path = realpath(dirname(__FILE__) . DIRECTORY_SEPARATOR . "66265"); + bindtextdomain($domain, $path); + bind_textdomain_codeset($domain, "UTF-8"); + textdomain($domain); + + echo 'LC_ALL=', getenv('LC_ALL'), "\n"; + echo 'hello=', _('hello'), "\n"; + echo "\n"; +} + +?> +==DONE== +--EXPECTF-- +LC_ALL=de_DE +hello=hallo + +LC_ALL=fr_FR +hello=salut + +LC_ALL=en_US +hello=hello + +==DONE== + |